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
NumPy 1.21 support #7483
NumPy 1.21 support #7483
Conversation
As title. Also updates python version that was incorrect
As title.
As title.
278f003
to
4fd6ef6
Compare
This is a start to support NumPy 1.21 use of FASTCALL methods in ufuncs. There are probably better ways to achieve this support. NumPy further uses `tp_vectorcall_offset` on newer versions. This PR does not add support for this (meaning that a DUfunc will be unnecessarily slow on NumPy >=1.21 when kwargs are used).
Will this close #7176? |
Not sure yet. I've got this patch running all tests locally to see if there's any more failures (there's usually a few floating point issues with a NumPy upgrade but we might be lucky!). |
Testing locally on linux x86_64: Run 1:
Run 2:
|
Run 3:
|
Results on my linux-64 system:
I didn't have scipy installed so some BLAS tests have not run. Also I saw messages about not having enough cores for some tests (I have 6 physical, 12 HT). Going to install SciPy and do another run. |
@gmarkall thanks for trying. I'm surprised there's tests that need more than 6 cores, maybe it's a bug in a test/some logic, if you get a moment and can identify the culprit that'd be very helpful, thanks! |
This time with SciPy installed:
|
An example:
which comes from: numba/numba/tests/test_num_threads.py Line 525 in 679ade8
somehow |
Is this easy to run locally? I am confused why |
@seberg Thanks for taking a look. It should just be building Numba from this branch and then from the Numba repo root:
I presume you've got a local build working already so as to create the original 1.21 PR? RE:
Numba's public CI is a bit unusual: https://numba.readthedocs.io/en/stable/developer/contributing.html#continuous-integration-testing, there's a possibility that it just wasn't hit by the right combination of tests/packages/systems/pythons. |
No, to be honest, I trusted the CI to run it... I will try to have a look later today probably. |
Thanks @seberg! Development builds (of e.g. llvmlite) are in the conda channel |
Trivial error, my |
First local test run against 4df2640 passed. |
Second local test run against 4df2640 passed. |
I think all that is left here is a build farm run? |
283bb98
to
635e056
Compare
|
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.
The changes on NaT looks good as well.
Once NumPy stabilizes on the behavior for NaT comparison, we can come back to update the test. But for now, the changes here is avoiding tests that contains NaT in median.
Note: once this passes on the farm, it can be merged. |
@sklam @seberg @stuartarchibald @gmarkall thank you all! |
With the exception of the ppcle64 build, due to missing Numpy 1.21 -- as I just double checked -- @sklam still good to go? |
One thing to note, is that on Python 3.8+, NumPy also uses If keywords are being used, numba will have some extra overhad for e.g. |
Hi, is this supported in Numba 0.54.1? |
This will be released in Numba 0.55.0, coming soon. (Edit: I should say, a release candidate will be coming soon. Due to the magnitude of changes in 0.55, we're going to give people a long RC period to test it before a final release in January 2022.) |
As far as I know, it doesn't. I think you should install numba by cloning the repository, otherwise, we need to wait for the new version release... |
I expect the patch applies cleanly to 0.54.x, although I guess that won't help much... |
If you are using conda, we also automatically build packages whenever a PR is merged, which you can install:
(Edit: Note that while these packages have to pass our full test suite, they don't have any of the community testing that comes with an official release. So be careful. :) ) |
Thanks, @seibert! |
This PR:
setup.py
,__init__.py
and docs for 1.21.ufunc
C code patch (df8442f) from BUG: Fastcall fix ufunc methods (NumPy 1.21 support) #7449 (with thanks to @seberg).