[WIP] Reduce BLAS dependency#1496
Conversation
|
Is this something we are capable of detecting within the library? It feels like some bug in our defaults that this can happen. |
|
The official FAQ said:
Maybe Another solution may be not to use BLAS. Currently, only matrix.hpp uses it to support matrix operators. Aer uses them only for small size of matrices. I guess that few performance impact from reduction of BLAS. BTW, the current CI errors are from recent terra release. CI does not download binary from pypi, and then fails to compile qiskit-terra because of lack of rust compiler. |
|
We need to update our wheel jobs to use manylinux2014 so the terra binaries are compatible with the build env |
Yeah, I was thinking something along these lines - we know if we're spawning threads/processes already, and we should know whether we're linked against OpenBLAS or something else, so we should make sure we're not conflicting with their assumptions. We should set up our defaults to "just work" for the most part - if we're having trouble with a simple |
8d67d9a to
1d2eba3
Compare
| [[tool.cibuildwheel.overrides]] | ||
| select = "cp3{6,7,8,9}-manylinux*" | ||
| manylinux-x86_64-image = "manylinux2010" | ||
| # manylinux-x86_64-image = "manylinux2010" |
|
I'm not sure this fixes the underlying issue. For me locally when I run with main I'm able to still get a segfault when I run with I also tried with this PR applied and I also get a segfault in openblas although a without the allocation error message. It might be something with my local openblas install though. But I think we should avoid setting things via env variables via python like this if there is a bug in how we're using openblas I think we should fix that in the source. |
|
OK. I believe that we need more time to resolve OpenBLAS issue and this PR should not block 0.10.4 release. |
dba8990 to
b555807
Compare
|
matrix multiplication is frequently used in Another comparisons on Macbook Pro(Intel Core i7, 6core x 2HT, macOS BigSur). Aer does not use matrix multiplication heavily, in general. |
|
In |
fec92f6 to
168f7b7
Compare
|
qiskit-aer/src/simulators/matrix_product_state/matrix_product_state.hpp Lines 1055 to 1064 in a21260c The above OMP loop produces SEGV in |
168f7b7 to
f0e4782
Compare
e604353 to
c62caf8
Compare
94ca954 to
d7e6357
Compare
d7e6357 to
224525b
Compare
|
#1555 will resolve this BLAS issue |






Summary
Work around memory allocation errors in OpenBLAS when multi-threads run
Details and comments
OpenBLAS sometimes fail test cases of Aer when multiple threads run.
This error can be worked around by setting
OPENBLAS_NUM_THREADS=1:In CI, stestr runs multiple threads or multiple processes and then encounters unsuitability:
This PR sets
OPENBLAS_NUM_THREADS=1whenAerBackendis loaded.