-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
numpy and scipy: drop Accelerate, use openblas #33207
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
Conversation
Got stuck almost at the end of testing 😢 |
Many thanks! |
Came in here to disagree but ended up agreeing with the above reasoning. Nice work all 👍 |
Thanks @MikeMcQuaid, I hesitated to tag this one with a “maintainer feedback” label because I know we try hard to stick to macOS-provided libraries… but indeed, here it became untenable. |
cc @dpo |
The issue with Accelerate is twofold:
Back in the days of homebrew/science, issue 2 prompted us to use vecLibFort, which effectively "patches" Accelerate. I believe it still does its job. If you wanted to stick with Accelerate as much as possible, it should be safe to use vecLibFort, unless you also need access to some of the missing LAPACK routines. I filed a bug report with Apple several years ago about issue 1 and I'm told a forthcoming update to Accelerate will correct it. It's not clear to me whether or not it will also resolve issue 2. vecLibFort's advantage is that it's a thin interface that fixes issue 2 and so still allows you to use Accelerate. In a sense, it's minimally invasive. OpenBLAS suffers from neither issue. I've observed it to be slightly slower than Accelerate in certain cases, but it's definitely a safe alternative. One caveat is that it's possible to run into problems when a formula has a dependency that uses Accelerate (via vecLibFort or not) and another that uses OpenBLAS because both basically package the same libraries. One can shadow the other and/or the performance may not be what the user expects. |
I believe there are more issues with Accelerate, like integer overflows even in BLAS routines. Apparently (somewhere in the middle of https://github.com/scipy/scipy/wiki/Dropping-support-for-Accelerate), the scipy folks also considered vecLibFort but concluded that the result remains too unstable for their purposes. |
Thus, it makes sense to me to switch.
Fixes #31404
Thanks to @cmarquardt for reporting a clear analysis of the current situation and upstream policy changes.