Conversation
|
Thank you for the PR! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2138 +/- ##
==========================================
- Coverage 91.63% 91.63% -0.01%
==========================================
Files 89 89
Lines 14016 14012 -4
==========================================
- Hits 12844 12840 -4
Misses 1172 1172
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mtar
left a comment
There was a problem hiding this comment.
Thanks, the PR looks fine. The added edge case doesn't work properly. Something's wrong with the indexing.
heat/core/tests/test_indexing.py
Outdated
| for split in [None, 1]: | ||
| a = ht.zeros((4, 3), dtype=ht.bool, split=split) | ||
| a[1, 2] = True | ||
| nz = ht.indexing.nonzero(a) | ||
| self.assertEqual(nz.gshape, (1, 2)) | ||
| self.assertTrue(ht.allclose(a[nz], a[a])) |
There was a problem hiding this comment.
The edge case for split=1 doesn't work. All local tensors have no data after indexing.
print(a.comm.rank, a[nz].larray)
print(a.comm.rank, a[a].larray)
0 tensor([], dtype=torch.bool)
1 tensor([], dtype=torch.bool)
0 tensor([], dtype=torch.bool)
1 tensor([], dtype=torch.bool)
There was a problem hiding this comment.
That's true, good catch!
This PR is kind of working on two issues. The first is in heat.indexing.nonzero and the second is in the advanced indexing. Turns out this fixes the advanced indexing bug only when the array is non-distributed.
However, the primary function of this PR, which is fixing the bug in nonzero is still valid. I modified the test to index only non-distributed data. Note that this test fails on the current main.
I suggest we merge this anyways and hope that #938 will fix the indexing.
|
Thank you for the PR! |
|
Thank you for the PR! |
d92a30d to
c1e8c2b
Compare
|
Successfully created backport PR for |
Due Diligence
Description
This fixes the bugs documented in #2136 and #2135. It makes the function
heat.indexing.nonzerocompatible with the sanity checks proposed in #2137.Issue/s resolved: #2136, #2135
Changes proposed:
heat.indexing.nonzeroType of change
Does this change modify the behaviour of other functions? If so, which?
no