Repository navigation
offered a fix for rechunking with zero-size-chunks - #8703
Conversation
|
The currently failing CI's seem to be unrelated to this PR. |
0775aa4 to
7fb1ec1
Compare
7fb1ec1 to
8dcc511
Compare
|
I have also checked x = da.ones((8,8), chunks=(4,4))
dd = da.ones((8,8), chunks=(4,4))
d = da.diagonal(dd)
print(d.compute()) # works
print((d+d).compute()) # also works
A = (d + x)
A.compute() # no longer breaks.and gives the right result, as far as I can see. |
746004e to
2e95120
Compare
2e95120 to
a2d101a
Compare
a3aa993 to
9a61536
Compare
jcrist
left a comment
There was a problem hiding this comment.
Thanks @ParticularMiner, this looks pretty good to me.
I do agree with the comment here though (#5661 (comment)) that avoiding generating 0 size chunks in the first place would be a good fix. These are still bound to come up periodically, but they only represent extra bookkeeping for the scheduler, as their outputs will always be size 0. Was the fix for that included in your other diagonal PR (#8689)?
|
Hi @jcrist Yes, in the diagonal PR #8689, I indeed completely avoided zero-size-chunks, but only for those routines: I'm not sure if we'll always be able to avoid zero-size-chunks throughout My feeling (though don't quote me on this) is that there might exist a simple mathematical theory that clarifies and guides the the treatment of zero-size-chunks. But I'm yet to explore this. |
1556013 to
e80a453
Compare
|
Hi @jcrist Please examine the new diffs to see if the comments I've added are helpful or not. 😄 |
* offered a fix for rechunking with zero-size-chunks dask#5661 * added and catered for more test cases of zero-sized chunks * added new test-case of rechunking with zero-size-array * catered for yet another test-case of rechunking with zero-size-array * added helpful comments as per @jcrist's advice
pre-commit run --all-files@TomAugspurger
I copied your tests (with a few modifications) which you recommended in #5661 to this PR. These proved very useful in bringing about this fix.
@TAdeJong, may I invite you to test whether this PR fixes your problem with
diagonal(A, k)or not.To clarify: as you've mentioned already,
diag(A, k)of #8689 does not depend ondiagonal(A, k). Nevertheless, sincediagonal(A, k)depends on howdaskhandles zero-size-chunks, it would be prudent to check thatdiagonal(A, k)works under this PR.