-
-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Generalized Universal Functions #4675
Conversation
cc @seberg @pentschev (in case this is of interest 🙂) |
Since @seberg its pinged, I'd like to know whether #4549 (which this PR is trying to fix) should be considered as a NumPy bug or not. NumPy made the gufuncs not dispatchable via |
I am not sure I understand. Since I admit it is a bit weird that some cases will actually dispatch to a ufunc from within a non-ufunc wrapped with |
Hi! |
Btw, although the code is 60% straight from dask I added support for stuff such as optional dimensions in signatures How should I reference Dask here? All the matrix transposition credits goes to them, so I don't know if I have to reproduce their license in the code. |
Usually Dask itself adds a comment to where it was taken from with a GitHub permalink (see https://github.com/dask/dask/blob/91cee5b7944e47959f475eaebc42dc75be14bc21/dask/array/numpy_compat.py#L167-L208 for reference), so maybe do the same here? |
PTAL, Cythonize -> better performance BTW, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't finished a full pass and will do so asap 😅 Found two minor issues so far.
PTAL! |
@emcastillo Could you merge the master branch to pass CI? |
14afbde
to
7a0ea54
Compare
rebased :) |
Jenkins, test this please. |
Jenkins CI test (for commit b1bce6a, target branch master) failed with status FAILURE. |
Jenkins, test this please |
Jenkins CI test (for commit b1bce6a, target branch master) succeeded! |
LGTM! |
This is a big nasty one.
Currently wip.
Adds a GUFunc class (all the axes and batching stuff has been copied straight from dask).
There are some heavy incompatibilities here with things such as
matmul
since all the batching is done in the relevant cublas routine, we should avoid doing repeated calls at any cost. So for some gufuncs we need to skip several of these steps.Also, we need to find a way to blend this with the regular
UniversalFunction
, probably wrapping it and doing a straight call should be enough, but we will provide additional support for currently non-supported kwargs such aswhere
.This needs to be cythonized too.
Fixes:
#4549
#2552