-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
BUG: default BLAS to LP64 and add Alpine preload smoke test #30299
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
base: main
Are you sure you want to change the base?
Conversation
|
I can't speak to the meson changes, or the default option, but I will to the CI job. |
|
This should not be needed. The official wheels use a modified OpenBLAS from scipy-openblas that mangles the exported function names, there should be no overlap with the system OpenBLAS. This is done by using the
Please submit an issue documenting the problem, preferably with a reproducer, so we can try to figure out which symbols are not being mangled. Be sure to specify how you installed NumPy. |
|
The reproducer in the R issue is I tried the equivalent on Ubuntu24.04 x86_64 (glibc) and it did not segfault |
|
OK, I can reproduce in a docker with musllinux I wonder how this differs from glibc? |
|
This seems like another case of #21643. I wonder why compilation for alpine is different. |
|
When I run under But on alpine linux it does seem to go to the preloaded |
|
Another difference I see, using tracing on alpineOn glibc the tracing on glibc |
|
Maybe connected to lazy bindings? |
|
@rgommers pointed out (in private communication) that this has to do with the vs. On glibc both of these succeed. Symbols like |
|
This is a bit of a mess in OpenBLAS unfortunately. There was one aborted attempt at cleaning this up in OpenMathLib/OpenBLAS#3658. The last comment there seems on point to me. The other way to deal with this is with a linker script when building With some tweaking of that and adding |
|
I played with versioning but always get the preloaded symbols like |
|
Static linking isn't worth trying I think, it isn't well-supported by OpenBLAS and my previous attempt at statically linking |
|
yeah, I see. When the DLL is opened |
|
Let's go back to the start. @t-kalinowski could you expand on
How exactly did the process load the system OpenBLAS? Is there a way to change that to use the equivalent of |
I don’t think so in the Alpine + R + reticulate case. Alpine’s
So there isn’t a supported knob in R to “re-open” BLAS with |
|
This PR also doesn't do much to help - it may happen to work if R and NumPy both load the same version of LP64 OpenBLAS, but when they're using different versions and the public functions in one library end up calling routines from the other loaded |
|
I'm inclined to say we should aim for the proper solution (OpenMathLib/OpenBLAS#3658 (comment)), since that is just the right thing to do and in the end "just" plumbing. I will open a new OpenBLAS issue for this now. |
|
Done in OpenMathLib/OpenBLAS#5560 |
Hello,
We recently hit a segfault on Alpine when importing NumPy in a process that had already loaded the system OpenBLAS. After some investigation, it seems Alpine’s system OpenBLAS is LP64 (32-bit BLAS ints) while the musllinux wheels default to ILP64 (64-bit BLAS ints), and mixing the two in one process can crash (seen via a reticulate workflow, rstudio/reticulate#1858 (comment)). From what I can tell, most distro OpenBLAS packages (including Alpine) and MKL defaults are LP64, while manylinux wheels use ILP64 for large-array support, so this change tries to align musl builds with the system default, but please let me know if I’m missing a better precedent.
What changed
LD_PRELOAD=/usr/lib/libopenblas.so.3.Testing
numpy.test(verbose=0, extra_argv=['-q'])from/tmp(pass).Happy to adjust anything. Thanks!