-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
ENH, BLD: use wheels to get BLAS implementations #24857
Comments
Except on 32 bit platforms. |
From a naming point of view,
In particular for WASM / Pyodide-based deployments. |
@ogrisel that's an interesting idea. It could be added on top later - given that name, I think it'd be an extra level of abstraction, that would only be needed if one would want to make OpenBLAS runtime swappable with another library. I think at that point we should build against FlexiBLAS though, which is already designed to do this and "forward" calls to routines to the relevant implementation. For now I think I'd be happy with a plain
Those don't live on PyPI though - at least not yet. Right now, we have no 32-bit BLAS on PyPI at all; we still have |
I did not know about flexiblas but it sounds promising. It might also allow to switch between scipy-openblas-pthreads and scipy-openblas-openmp for instance. |
Yes, FlexiBLAS indeed seems quite nice. The two potential issues with it at the moment:
|
This should not be a blocker (if the owners consider switching the license to LGPL as discussed in the scipy issue). If numpy/scipy want to rely on FlexiBLAS we will add support for FlexiBLAS to threadpoolctl. I opened an issue to not forget about this. Futhermore the latest version of threadpoolctl is pluggable: so numpy or scipy can already start prototyping without having to wait for an official release of threadpoolctl with FlexiBLAS support. For |
Thanks for the update @ogrisel. I'll note that NumPy now has the option of building against FlexiBLAS, and will try to find it as one of the supported libraries. SciPy doesn't support it yet. It'll be a while before we can consider using it in wheels, due to the suffix issue below.
Oh we definitely want symbol suffixes, because in a stack with numpy and scipy we use a mix of LP64 and ILP64 APIs. There's no good control over that with wheels, and without suffixes it's too easy to get symbol clashes. |
I agree but can we hope to have ecosystem-wide recommendations to adopt one vs the other in the long run? That would avoiding linking to two different OpenBLAS copies for a typical scipy runtime env. This would be both helpful to reduce the size of deployed Python apps (particularly important on edge or WASM and more generally for people with not so great network connections). It would also help reduce debugging complexity in case two OpenBLASes interact in the same Python program (I can imagine spin-waiting threads causing performance problems when calling successively one OpenBLAS implementation and then the other in a tight loop. |
A couple of thoughts there:
|
In PR #24839, we began using scipy-openblas wheels in the CI build/test cycles. In order to use these in wheel building as well, we need to declare a dependency, so that
pip install numpy
in all its variations (build a wheel, build an sdist, install a wheel, install from an sdist) willscipy-openblas
befor compiling_distributor_init.py
(or add a_distributor_init_local.py
) to importscipy-openblas
beforenumpy
scipy-openblas.pc
file when buildingThis is tricky since (take from the short discussion starting in this comment
We cannot currently have different metadata in the sdist than we have in the wheel on PyPI. There are some ideas in the draft PEP 725. Or perhaps we could have a meta-package
scipy-openblasX
?The text was updated successfully, but these errors were encountered: