-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Basis translation can fail if run in parallel #13504
Comments
The specific issue here is around having the pass manager reused between multiple executions and then having the multiprocessing dispatching for the second run. My guess is that is most likely the round trip pickling of the equivalence library in the pass manager after we've bound parameters once during the basis translator messing up shared state in the cached pygates. This wasn't caught before #13482 because weren't updating the cache properly before but now we are. |
We noticed this as well in Mitiq. We have a jupyter notebook failing in the Github actions build, where platform=linux and execution is in parallel. The tutorial is cumbersome, but we extracted a minimum non-working example from there: from qiskit import transpile, QuantumCircuit
from qiskit_aer import QasmSimulator
from qiskit_aer.noise import NoiseModel
backend = QasmSimulator(noise_model=NoiseModel())
qc = QuantumCircuit(1)
qc.rx(1, 0)
exec_circuits = transpile(
qc,
backend=backend,
)
exec_circuits = transpile(
[qc, qc],
backend=backend,
) I hope this helps. |
Environment
main
What is happening?
This is the problem underlying Qiskit/qiskit-addon-cutting#714.
Running basis translation in parallel (see snippet below) causes the following failure
This seems to be due to the recent port of the basis translator to Rust (see #12246 for an overview). Dissecting the code, the error seems to be triggered by
compose_transforms
, so it might be worth checking if this already existed after #13137 and before the rest of the basis translator was moved to Rust.How can we reproduce the issue?
From @mtreinish:
Note that this only happens with multiprocessing turned on. On Mac this is turned off per default but can be enabled with
export QISKIT_PARALLEL=TRUE
.What should happen?
The above should run, as it did in 1.2.4.
Any suggestions?
One possible solution is to delete the cached
py_op
upon parameter assignment, i.e. replaceqiskit/crates/circuit/src/circuit_data.rs
Lines 1385 to 1389 in 6979d91
But this comes at a ~5% performance overhead on my machine, benchmarked on some utility scale circuits. Maybe there's another way to avoid this overhead?
The text was updated successfully, but these errors were encountered: