-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ufunc method incompatibility with Numpy 1.21 #7175
Comments
Thanks for the report! NumPy 1.21 is not yet supported, but this will be looked at as part of supporting it. |
#7176 created to track items needed for NumPy 1.21 support. |
This issue is marked as stale as it has had no activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with any updates and confirm that this issue still needs to be addressed. |
I've removed needtriage so the stale bot doesn't turn up on this issue again. |
I completely randomly stumbled on this issue. It seems fairly likely to me that this is a NumPy issue! Please make sure to bug me/us about this type of thing! |
OK, nevermind. I thought the problem here might be that NumPy does not take into account the possible existance of Trying it out, NumPy actually reports 0 arguments being passed. Which means the problem is quite different: It looks like Numba is calling the NumPy method slot directly in C, but simply assumes the method is a normal Python method and not a vectorcall/fastcall one? I guess as a micro-optimization to avoid using The reduction crash seems like exactly the same problem. EDIT: Or I suppose more likely: Numba copies the function pointer into its own object or so? But fails to also copy the |
Yeah, the code below will not work because it does not know about vectorcall. That is a bit unfortunate, I hope numba can easily catch up and use the vectorcall protocol on newer NumPy versions. numba/numba/np/ufunc/_internal.c Lines 289 to 351 in 3927115
|
I'm just a curious bystander, but I'd like to note that numpy 1.21.3 will become the default numpy in GNU Guix in a few days. We'll keep around numpy 1.20 specifically for numba, but it will complicate the installation of numba together with other Python packages using numpy 1.21 by default. I'd be happy to upgrade numba in Guix as soon as compatibility with numpy 1.21 is achieved. (Subscribing to this issue to be get notification when this happens.) Good luck! |
@rekado Numba 0.55 release candidates will be out within the next week or so (hopefully!), these will have NumPy 1.21.x series support. A post will be made to https://numba.discourse.group/c/announcements/ when RC builds are shipped. |
Using ufunc methods of Numba-generated ufuncs doesn't work with Numpy 1.21. In Numpy 1.21 they added argument checking to ufuncs. It seems to have implications here.
Numpy complains that exactly two arguments are required, but two arguments are passed in. So I'm unsure what the actual error is.
Numpy version: 1.21.0
Numba version: 0.53.1
Minimal example
Output with Numpy 1.20.3
Output with Numpy 1.21.0
The text was updated successfully, but these errors were encountered: