You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We encountered a serious issue when running jupyter notebook code with the support of sparse library.
Can someone help?
Thanks!
Describe the bug
In a Qiskit 0.30 conda virtual env, after installing the required sparse library using pip, the ipython run will error out with
"Segmentation fault (core dumped)" message. issue_with_sparse.log
To Reproduce
Activate conda virtual env and run the "01_neural_networks.ipynb" sample code with below commands:
conda activate qiskit0.30_test
ipython -c "%run 01_neural_networks.ipynb"
This will prompt you to install the sparse library.
Install sparse library by executing "pip install 'qiskit-machine-learning[sparse]'" inside the conda virtual env
Rerun the "01_neural_networks.ipynb" sample code will produce the "Segmenttation fault" error.
Expected behavior
expect no prompt for install sparse library and no errors popped up for the ipython run
System
OS and version: RHEL 8.4 (s390x)
Conda: 4.10.1
Sparse: version: 0.13.0
NumPy version: 1.20.3
Numba version: 0.54.1
Additional context
Add any other context about the problem here.
I cannot tell from your issue where the notebook is, could you give a link to it or upload it? Also could you show where you got the conda environment to run the notebook?
I cannot tell from your issue where the notebook is, could you give a link to it or upload it? Also could you show where you got the conda environment to run the notebook?
I installed anaconda for z on RHEL 8.4 (s390x) and created virtual env using below commands:
conda create -n qiskit0.30 python=3.8
conda activate qiskit0.30
pip install qiskit==0.30
pip install qiskit-machine-learning
........
then i can run the notebook inside this virtual env.
Current thread 0x000003ffb7278240 (most recent call first):
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/ctypes/init.py", line 373 in init
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/llvmlite/binding/ffi.py", line 185 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 1042 in _handle_fromlist
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/llvmlite/binding/dylib.py", line 3 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/llvmlite/binding/init.py", line 4 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/numba/core/config.py", line 16 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 1042 in _handle_fromlist
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/numba/init.py", line 19 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/sparse/_coo/core.py", line 9 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/sparse/_coo/init.py", line 1 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/sparse/init.py", line 1 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/qiskit_machine_learning/neural_networks/circuit_qnn.py", line 21 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/qiskit_machine_learning/neural_networks/init.py", line 52 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "01_neural_networks.py", line 66 in
Segmentation fault (core dumped)
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]#
It seems to be a problem importing Numba on S390x, IIUC. Can you try that on your system to see if it is indeed the issue?
If it is, can you install as many packages from conda as possible, and the conda compilers package as well, so things are built in an ABI compatible way?
Activity
hameerabbasi commentedon Oct 19, 2021
I cannot tell from your issue where the notebook is, could you give a link to it or upload it? Also could you show where you got the conda environment to run the notebook?
hameerabbasi commentedon Oct 19, 2021
Also can you run with the environment variable
NUMBA_DISABLE_JIT=1
and post the stack trace?seafolk-cn commentedon Oct 20, 2021
We got the sample notebook from below official repo, it's inside the docs/tutorials/ folder.
https://github.com/Qiskit/qiskit-machine-learning
01_neural_networks.ipynb.zip
Download link for anaconda for IBM z
https://www.anaconda.com/products/individual#Downloads
https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-s390x.sh
I installed anaconda for z on RHEL 8.4 (s390x) and created virtual env using below commands:
hameerabbasi commentedon Oct 20, 2021
Unfortunately I don't have access to an s390x machine, but I can try to reproduce it on x86_64 over the weekend.
seafolk-cn commentedon Oct 20, 2021
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]# jupyter nbconvert --to script 01_neural_networks.ipynb
[NbConvertApp] Converting notebook 01_neural_networks.ipynb to script
[NbConvertApp] Writing 9419 bytes to 01_neural_networks.py
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]#
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]#
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]#
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]# python 01_neural_networks.py
Segmentation fault (core dumped)
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]# export NUMBA_DISABLE_JIT=1
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]# python 01_neural_networks.py
Segmentation fault (core dumped)
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]# python -q -X faulthandler 01_neural_networks.py
Fatal Python error: Segmentation fault
Current thread 0x000003ffb7278240 (most recent call first):
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/ctypes/init.py", line 373 in init
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/llvmlite/binding/ffi.py", line 185 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 1042 in _handle_fromlist
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/llvmlite/binding/dylib.py", line 3 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/llvmlite/binding/init.py", line 4 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/numba/core/config.py", line 16 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "", line 219 in _call_with_frames_removed
File "", line 1042 in _handle_fromlist
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/numba/init.py", line 19 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/sparse/_coo/core.py", line 9 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/sparse/_coo/init.py", line 1 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/sparse/init.py", line 1 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/qiskit_machine_learning/neural_networks/circuit_qnn.py", line 21 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "/opt/anaconda/envs/qiskit0.30_test/lib/python3.8/site-packages/qiskit_machine_learning/neural_networks/init.py", line 52 in
File "", line 219 in _call_with_frames_removed
File "", line 843 in exec_module
File "", line 671 in _load_unlocked
File "", line 975 in _find_and_load_unlocked
File "", line 991 in _find_and_load
File "01_neural_networks.py", line 66 in
Segmentation fault (core dumped)
(qiskit0.30_test) [root@rhel84 qiskit-machine-learning]#
seafolk-cn commentedon Oct 20, 2021
Let me check if i can share this env to you. :)
hameerabbasi commentedon Oct 20, 2021
It seems to be a problem importing Numba on S390x, IIUC. Can you try that on your system to see if it is indeed the issue?
If it is, can you install as many packages from conda as possible, and the conda compilers package as well, so things are built in an ABI compatible way?
seafolk-cn commentedon Oct 20, 2021
Is below your mailbox?
hameerabbasi@yahoo.com
seafolk-cn commentedon Oct 20, 2021
hameer, mailed you just now, thanks!
seafolk-cn commentedon Oct 20, 2021
Hameer, sorry, just found the mentioned env not on this machine, i need create one to reproduce the issue, wait a moment.
hameerabbasi commentedon Oct 20, 2021
I'm doing it already following your instructions! 😆
seafolk-cn commentedon Oct 20, 2021
OK! Great!
But that will take some time to complete!
You can create a new env with below clone command:
conda create -n qiskit0.30_test --clone qiskit0.30_py3.8
the qiskit 0.30 already installed in it, then you can install extension like machine learning (pip install qiskit-machine-learning) etc.
the sample code are located in below folder.
/root/tutorials/application-tutorials/qiskit-machine-learning
hameerabbasi commentedon Oct 20, 2021
I see that you reported numba/llvmlite#780. This is the root cause here. I will mark this as upstream.
seafolk-cn commentedon Oct 21, 2021
Yes, i originally considered these were different issues.
But i now feel it maybe the same by comparing the stack trace.
Thanks!