-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
00 - Bug57 - Close?Issues which may be closable unless discussion continuedIssues which may be closable unless discussion continuedcomponent: numpy.linalg
Description
Describe the issue:
On Apple M1, calling np.linalg.det on complex matrix generates incorrect warning message (still correct results).
| env | libblas | results | warning |
|---|---|---|---|
env00 |
openblas | correct | yes |
env01 |
accelerate | correct | no |
minimum working example (MWE) to reproduce warning
#libblas from openblas
conda create -c conda-forge -n env00 numpy
conda activate env00MWE without warning (use libblas from accelerate)
conda create -c conda-forge -n env01 numpy "libblas=*=*accelerate"
conda activate env01seems related issues: #22025
I also did other tests
- no warning message on
ubuntu-22.04,AMD R7,openblas,dtype=complex128 - no warning message on
mac-M1, openblas, dtype=float64
Reproduce the code example:
# python -c "import numpy as np; print(np.linalg.det(np.array([[0,1],[1,0]], dtype=np.complex128)))"
import numpy as np
print(np.linalg.det(np.array([[0,1],[1,0]], dtype=np.complex128)))
# (-1+0j) #still give correct resultsError message:
/Users/zhangc/miniconda3/envs/env00/lib/python3.11/site-packages/numpy/linalg/linalg.py:2180: RuntimeWarning: divide by zero encountered in det
r = _umath_linalg.det(a, signature=signature)
/Users/zhangc/miniconda3/envs/env00/lib/python3.11/site-packages/numpy/linalg/linalg.py:2180: RuntimeWarning: invalid value encountered in det
r = _umath_linalg.det(a, signature=signature)Runtime information:
import sys, numpy
print(numpy.__version__); print(sys.version)
# 1.25.2
# 3.11.5 | packaged by conda-forge | (main, Aug 27 2023, 03:33:12) [Clang 15.0.7 ]Context for the issue:
Low priority, it gives the correct results.
JMuff22
Metadata
Metadata
Assignees
Labels
00 - Bug57 - Close?Issues which may be closable unless discussion continuedIssues which may be closable unless discussion continuedcomponent: numpy.linalg