-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
sklearn/gaussian_process/tests/test_gpr.py:test_sample_statistics segfaults with libopenblas 0.3.10 #17980
Comments
This can be fixed by switching the env to use MKL instead of OpenBLAS:
|
I can reproduce the segfault with the main channel openblas 0.3.10:
|
Pinning openblas to 0.3.9 fixes the issue. I tested with conda-forge using this env:
|
The segfault is happening in import numpy as np
y_mean = np.ones((5))
y_cov = np.ones((5, 5))
rng = np.random.RandomState(0)
# segfaults
rng.multivariate_normal(y_mean, y_cov, 300000) |
Thanks @thomasjpfan, I was trying to slowly narrow it down. Not sure how this is related to openblas. Will use a debugger to run step by step. |
In sklearn, the call to scikit-learn/sklearn/gaussian_process/_gpr.py Line 410 in 1278181
|
I used you code snippet to get a backtrace:
|
So it's a double precision matrix matrix multiplication that's crashing... |
If you disable openblas blas threads, the crash goes away (both for your script and the original test):
|
Looks like this only segfaults when import numpy as np
y_mean = np.ones((5))
y_cov = np.ones((5, 5))
rng = np.random.RandomState(0)
# segfaults
rng.multivariate_normal(y_mean, y_cov, size=249033)
# does not segfault
rng.multivariate_normal(y_mean, y_cov, size=249032) I think we have enough context to raise an issue on the numpy issue tracker. |
I simplified it down to: import numpy as np
np.ones(shape=(300000, 5)) @ np.ones(shape=(5, 5)) |
I will try to write a minimal C program to report it to the OpenBLAS developers. |
This was fixed upstream in OpenMathLib/OpenBLAS#2729 and the conda-forge package has already been updated with the fix. Closing. |
Steps to reproduce:
conda create -n cf -y -c conda-forge cython pillow numpy scipy pytest joblib threadpoolctl conda activate cf pip install -e . --no-build-isolation
Then:
The text was updated successfully, but these errors were encountered: