Comments (7)
I'm closing this issue as we've replaced processpool with threadpool and added some additional resource counting checks which should be in 0.2. We can reopen a new issue if similar problems arise with trying to run a circuit that uses more than the available memory.
from qiskit-aer.
Btw, here it is a minimal program which reproduces the same behavior
from qiskit import QuantumCircuit, QuantumRegister
from qiskit import execute, Aer
if __name__ == "__main__":
n = 31
flip = QuantumRegister(n)
qc = QuantumCircuit(flip)
qc.h(flip)
backend = Aer.get_backend('statevector_simulator')
job = execute(qc, backend)
result = job.result()
from qiskit-aer.
Ok, I'm experimenting a little bit. With the same minimal program posted before and 30 qubits instead of 31, I get this error
AerBackend: simulation failed
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib64/python3.6/concurrent/futures/process.py", line 175, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/mnt/residential_zone/home/sperriello/virtual_envs/qiskit_env/lib64/python3.6/site-packages/qiskit/providers/aer/backends/aerb$ckend.py", line 102, in _run_job
self._validate_controller_output(output)
File "/mnt/residential_zone/home/sperriello/virtual_envs/qiskit_env/lib64/python3.6/site-packages/qiskit/providers/aer/backends/aerb$ckend.py", line 149, in _validate_controller_output
raise AerError(res.get("status", None))
qiskit.providers.aer.aererror.AerError: 'ERROR: std::bad_alloc'
"""
The above exception was the direct cause of the following exception:Traceback (most recent call last):
File "test_31.py", line 11, in
result = job.result()
File "/mnt/residential_zone/home/sperriello/virtual_envs/qiskit_env/lib64/python3.6/site-packages/qiskit/providers/aer/aerjob.py", line 38, in _wrapper
return func(self, *args, **kwargs)
File "/mnt/residential_zone/home/sperriello/virtual_envs/qiskit_env/lib64/python3.6/site-packages/qiskit/providers/aer/aerjob.py", line 95, in result
return self._future.result(timeout=timeout)
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib64/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
qiskit.providers.aer.aererror.AerError: 'ERROR: std::bad_alloc'
With 29 qubits, the same error of the original post is reported.
from qiskit-aer.
The coupling map error is because of changes in Terra, if you use master qiskit-aer you also need to use the latest master of qiskit-terra.
My guess is the std::bad_alloc
error is due to not having enough memory to initialize the statevector. But its strange it happens only for 30 qubits and not 31. Any ideas @hhorii ?
from qiskit-aer.
@chriseclectic I've had the same problem, and it was indeed caused by a memory error. However, I previously run experiments on the same server with 32 qubits without problems, but I was using the qasm simulator. Rereading our previous discussion, however, maybe it could be the case that 125GiB of RAM are enough for a 32-qubit qasm simulation and not for a statevector one?
Also, as far as I remember, a check on the available memory was introduced in Aer. Was it removed?
from qiskit-aer.
That might be it! The statevector simulator has some large inefficiencies when producing the output data: the vector is copied in memory when it's converted to the output data (and the JSON output version likely requires more memory than the raw array version of the vector used in the simulator).
There is a simple memory check on the python side, but I believe it might be too generous since it isn't taking into account any memory copy operations.
from qiskit-aer.
Ok, so maybe we have an explanation. Is there any other way or trick that could allow me explore the output avoiding the in-memory copy (and hence the crash)?
from qiskit-aer.
Related Issues (20)
- Should be possible to pass a backend to the Aer primitives HOT 3
- Missing `cp39-cp39-macosx_11_0_arm64` wheels since `0.14.1` HOT 3
- Performance difference for generating the unitary of a circuit using AerSimulator vs quantum_info.Operator HOT 3
- Control flow is not working after I upgrade to 0.14.1 HOT 1
- qiskit-aer-gpu throws an error when using AerSimulator(method='tensor_network', device='GPU') HOT 1
- Typo in docstring for qiskit_aer
- DeprecationWarning about Provider
- AerSimulator does not support expr.shift_left (Binary.Op.SHIFT_LEFT)
- Remove standalone
- Remove qobj
- Unavailability of Probabilities in result after successfull simulation HOT 4
- Progress bar for qiskit-aer
- Error when building cvxpy dependency in Ubuntu 22.04 HOT 2
- `QuantumCircuit.reverse_bits()` affects the state vector but not the density matrix HOT 2
- Some fake simulators throw NoiseError when running an empty circuit
- qiskit-aer not getting imported HOT 2
- Qiskit-aer-gpu does not work as expected HOT 3
- TypeError: (): incompatible function arguments. AerConfig, arg0: list[list[tuple[tuple[int, int], list[float]]]]) -> None HOT 4
- Qiskit is deprecating `qiskit.providers.models`, which it is used by Aer HOT 2
- MPI execution related information missing from results metadata
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qiskit-aer.