Skip to content

Fix __array_function__ dispatching for tril/triu#7457

Merged
jakirkham merged 5 commits intodask:mainfrom
pentschev:fix-cupy-tri
Mar 25, 2021
Merged

Fix __array_function__ dispatching for tril/triu#7457
jakirkham merged 5 commits intodask:mainfrom
pentschev:fix-cupy-tri

Conversation

@pentschev
Copy link
Member

@pentschev pentschev commented Mar 23, 2021

This PR fixes __array_function__ dispatching for tril/triu, which broke for downstream libraries such as CuPy after #6997 .

Copy link
Contributor

@Illviljan Illviljan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I added some comments.

Although it might be necessary I think it's a little unfortunate that you had to reimagine the implementation a bit. When I added it was pretty much a straight copy/paste from numpy. It made it very easy to review and see through possible errors (although not the cupy errors apparently...). But the numpy implementation has already changed since I copy/pasted it so keeping up with upstream is not easy.

@pentschev
Copy link
Member Author

Hello, I added some comments.

Thank you! They should all have been addressed now.

Although it might be necessary I think it's a little unfortunate that you had to reimagine the implementation a bit. When I added it was pretty much a straight copy/paste from numpy. It made it very easy to review and see through possible errors (although not the cupy errors apparently...). But the numpy implementation has already changed since I copy/pasted it so keeping up with upstream is not easy.

Yes, supporting multiple backends can come with this sort of adapting when some functionality isn't supported. With that said, I'm not really worried about Dask having a diverging implementation to that of NumPy, due to its different requirements and different project paces it's generally impractical to keep everything in sync. Regardless of that, the new code is indeed much simpler than it used to be, thanks for working on that!

Copy link
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Peter! 😄

@jakirkham jakirkham merged commit cdb89fe into dask:main Mar 25, 2021
@pentschev
Copy link
Member Author

Thanks John for merging!

@pentschev pentschev deleted the fix-cupy-tri branch June 30, 2021 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dask.array.triu does not works with cupy array Failing CuPy tests

3 participants