-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: consider shipping numpy 2 final (or rc2) with OpenBLAS 0.3.27 #26240
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
Comments
Note that we also discovered that We will update threadpoolctl to accept this naming pattern. |
Good idea, I think we should update to 0.3.27 for rc2 indeed.
That's fine as a band-aid, but let's do something a bit more future-proof after that. We should be able to rename the shared library again without breaking |
Here is the PR for threadpoolctl: Note: threadpoolctl now has a pluggable controller system, so numpy could ship its own library backend: https://github.com/joblib/threadpoolctl?tab=readme-ov-file#writing-a-custom-library-controller |
BTW, is there an issue somewhere that gives motivation for the filename / symbol renaming? If found #25505 that upgrades the numpy build system to download the library from pypi.org but as far as I understand, both numpy and scipy still ship their own copies of openblas, scipy-openblas32/scipy-openblas64 is not meant to be a shared runtime dependency but rather a pre-built artifact vendored as build time by each project. EDIT: I guess this is a partial step towards the plan described in the description of #24857. |
The plan is to get SciPy to a point where it can use the same wheel at build time as NumPy. The decision to prefix the symbols with |
NumPy itself (excluding BLAS calls) is always single-threaded. So this is probably not useful? We can't deal with the threading behavior of any underlying BLAS library, that's already in the
To add to that: when trying the initial non-prefixed library, we very quickly ran into symbol name conflicts. For example, using See scipy/scipy#19381 for more detail.
As Matti said, it is meant for that. Packaging standards/assumptions are getting in the way though. We are actively discussing that on the packaging Discourse right now - here is the most relevant explanation of the issue: https://discuss.python.org/t/enforcing-consistent-metadata-for-packages/50008/32 (and I need to reply to that thread again asap). |
I meant that if numpy wants to take control of the way threadpoolctl accesses the OpenBLAS vendored by numpy, it is possible for numpy to register a dedicated OpenBLAS controller into threadpoolctl (e.g. at numpy import time). I do not necessarily recommend it, but it's technically possible. However, I think I would rather evolve the default openblas controller provided in threadpoolctl by following the flexible naming approach you suggested in joblib/threadpoolctl#175 (comment). |
Thanks for explaining, makes sense now. And I agree with your assessment. |
NumPy 2.0.0rc1 currently ships OpenBLAS 0.3.26 that has a thread-safety bug on Windows:
This was fixed in OpenBLAS 0.3.27 but is not yet packaged on pypi.org:
This bug is causing the scikit-learn release CI to freeze when testing against numpy 2.0.0rc1.
The text was updated successfully, but these errors were encountered: