-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
BUG: np.linalg.eigh(complex)
give wrong eigenvectors with accelerate and netlib blas
#24640
Comments
Solved in 1.26. conda create -y -n env00 -c conda-forge "libblas=*=*accelerate" pip
conda activate env00
pip install numpy
conda create -y -n env01 -c conda-forge "libblas=*=*netlib" pip
conda activate env01
pip install numpy 20231021 updated: change |
I reproduced this bug on M2 Mac using numpy version 1.26.0, and it seems that it has not been resolved or is there something wrong with my installation method?
name: foundation_accel
channels:
- conda-forge
dependencies:
- python=3.11
- libblas=*=*accelerate
- nc-time-axis
- xarray
- matplotlib
- bottleneck
- dask
- seaborn
- netcdf4
- scipy
- jupyterlab
- ipympl
- mpl-probscale
- pytables
- scikit-image
- scikit-learn
- plotly
- vega_datasets
- altair
- tqdm
- palettable
- scienceplots
- joypy
- openpyxl
prefix: /Users/fff8e7/anaconda3/envs/foundation_accel numpy version: 1.26.0 with accelerate blas There is no problem running the example code in another conda venv with openblas implemented 1.26.0. |
Please try the commands above to create environment ( conda create -y -n env02 -c conda-forge "libblas=*=*accelerate" pip numpy In this case, i do reproduce this bug. I think this is a bug of |
After I installed numpy using pip, there was no problem. Now it seems that there is a problem with numpy provided by |
There again,
Despite the use of According to this code, when running See the following function output message: "Build Dependencies": {
"blas": {
"name": "openblas64",
"found": true,
"version": "0.3.23.dev",
"detection method": "pkgconfig",
"include directory": "/opt/arm64-builds/include",
"lib directory": "/opt/arm64-builds/lib",
"openblas configuration": "USE_64BITINT=1 DYNAMIC_ARCH=1 DYNAMIC_OLDER= NO_CBLAS= NO_LAPACK= NO_LAPACKE= NO_AFFINITY=1 USE_OPENMP= SANDYBRIDGE MAX_THREADS=3",
"pc file directory": "/usr/local/lib/pkgconfig"
},
"lapack": {
"name": "dep4347366432",
"found": true,
"version": "1.26.1",
"detection method": "internal",
"include directory": "unknown",
"lib directory": "unknown",
"openblas configuration": "unknown",
"pc file directory": "unknown"
}
}, So I'm a little confused as to what the problem is. |
I apologize for the oversight in my previous response. I've since learned that |
Since the above problem does not exist in versions built against OpenBLAS and Intel MKL, I speculate that this bug may come from the upstream libraries: Apple Accelerate and netlib blas? I have learned through research that these basic BLAS libraries can indeed give incorrect results, I am posting this link here as an example, it should be noted that the bug mentioned in this external link may NOT correlate with the bug in this issue. This requires further investigation, and if it is determined that the bug is coming from upstream libraries, it should be reported to Apple Inc. as well as netlib blas. |
Describe the issue:
macos-arm (apple silicon M2) only, not reproducible on
ubuntu-22.04,AMD-R7
call
np.linalg.eigh
on a hermitian complex matrix, the eigenvectors are wrong with accelerate and netlib blas, but correct with openblas.env00
env01
env02
seems related issue: #21950
Reproduce the code example:
Error message:
Runtime information:
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: