-
Notifications
You must be signed in to change notification settings - Fork 182
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
matplotlib plots crash due to conflicting BLAS versions in numpy #471
Comments
Looks like this may impact scikit-learn as well, which binds lapack / blas independently. Simplest solution for now may be to opt out of openblas, e.g.
|
I think you could also just rely on |
Thanks @eddelbuettel! We've had openblas enabled by default on the From what I understand, the segfault here is not due to multithreading per se, but something to do with how openblas uses LP64 suffixes on it's symbols, and whether the numpy wheels from pypi are being built using I don't really understand why the same python binary behaves differently with respect to BLAS libraries when it is called via |
The problem really is that "all this is hard". In theory one could a assume a well managed and current distro and you get R and Python/numpy from it and all works. In practice and for a million different reason you two decided to not go with neither the distro R nor the distro Python (for |
I don't know why, but it seems that this bug does not occur with Ubuntu 22.04-based images (e.g. |
@eitsupi do you think it would make sense to put openblas back on by default then in the ubuntu 22.04 images? |
@cboettig Yes, but I am wondering if the bug could recur as long as I don't know why it is not occurring. |
@eitsupi Good point. I believe the origin of the bug comes from the fact that openblas was not using LP64 suffixes on it's symbols, causing numpy to grab the wrong methods. Since we install openblas from the Ubuntu repos, it's probable that bug was patched a while ago and now that we are pulling from the jammy repos we would start seeing the newer version of openblas that no longer lacks the suffixes. But I haven't been able to dig deep enough into the openblas changelog to confirm that to be the case. |
Thank you for the explanation. |
Close #471 (and related to #582 (comment)) This workaround seems to be sufficient if it is executed only on Ubuntu 20.04, since OpenBLAS on Ubuntu 22.04 does not seem to have the problem of crashing numpy.
The pre-compiled binaries for numpy are built against a different BLAS library than the openblas library included on rocker images. This leads to unexpected errors unless numpy is installed from source, e.g.
I don't yet know the best work around here, it's difficult as the error is both relatively opaque for users to track down, and there are just oh so many ways users will install and re-install numpy from binary without realizing it in different virtualenvs.
A start but no means a complete solution would be to at least build numpy from source in the python images. Open to any better solutions / ideas? (cc @yuvipanda ?)
The text was updated successfully, but these errors were encountered: