-
Notifications
You must be signed in to change notification settings - Fork 43
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
Recycling the same device.so
by different quantum.set_state
causes a crash
#1044
Labels
bug
Something isn't working
Comments
A minimal frontend example to reproduce this error (as of main branch b405fbb): dev = qml.device("lightning.qubit", wires=2)
@qml.qnode(dev)
def f():
qml.StatePrep(
np.array([complex(1, 0), complex(0, 0), complex(0, 0), complex(0, 0)]),
wires=[0, 1],
)
return qml.probs()
@qml.qnode(dev)
def g():
qml.StatePrep(
np.array([complex(1, 0), complex(0, 0), complex(0, 0), complex(0, 0)]),
wires=[0, 1],
)
return qml.probs()
@qjit
def main():
return f(), g()
main()
Quick note: this is an mlir issue and not a jax issue so I know this wouldn't help, but I checked it anyway, and swapping out |
paul0403
added a commit
to PennyLaneAI/pennylane-lightning
that referenced
this issue
Aug 23, 2024
paul0403
added a commit
that referenced
this issue
Aug 26, 2024
…time (#1047) **Context:** Recycling a device when a previous execution involves stateprep causes a crash. See #1044 **Description of the Change:** In `LightningSimulator`, `SetState` and `SetBasisState` now correctly query the DevQubits from the SimQubits in its qubit_manger's map. **Benefits:** We can now have multiple qnode functions involving stateprep in a workflow **Related GitHub Issues:** closes #1044 [sc-71894]
5 tasks
paul0403
added a commit
to PennyLaneAI/pennylane-lightning
that referenced
this issue
Aug 27, 2024
…kos (#869) **Context:** Catalyst recently fixed a bug where recycling a device when a previous execution involves stateprep causes a crash: PennyLaneAI/catalyst#1047 The fix is made to `lightning.qubit`, and thus we need to fix it for `lightning.kokkos` here as well. **Description of the Change:** In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now correctly query the DevQubits from the SimQubits in its qubit_manger's map. **Benefits:** We can now have multiple qnode functions involving stateprep in a workflow **Possible Drawbacks:** **Related GitHub Issues:** PennyLaneAI/catalyst#1044 --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai> Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com> Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
vincentmr
added a commit
to PennyLaneAI/pennylane-lightning
that referenced
this issue
Aug 28, 2024
…kos (#869) **Context:** Catalyst recently fixed a bug where recycling a device when a previous execution involves stateprep causes a crash: PennyLaneAI/catalyst#1047 The fix is made to `lightning.qubit`, and thus we need to fix it for `lightning.kokkos` here as well. **Description of the Change:** In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now correctly query the DevQubits from the SimQubits in its qubit_manger's map. **Benefits:** We can now have multiple qnode functions involving stateprep in a workflow **Possible Drawbacks:** **Related GitHub Issues:** PennyLaneAI/catalyst#1044 --------- Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai> Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com> Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
vincentmr
added a commit
to PennyLaneAI/pennylane-lightning
that referenced
this issue
Sep 5, 2024
…okkos (#878) **Context:** Catalyst recently fixed a bug where recycling a device when a previous execution involves stateprep causes a crash: PennyLaneAI/catalyst#1047 The fix is made to `lightning.qubit`, and thus we need to fix it for `lightning.kokkos` here as well. **Description of the Change:** In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now correctly query the DevQubits from the SimQubits in its qubit_manger's map. **Benefits:** We can now have multiple qnode functions involving stateprep in a workflow **Possible Drawbacks:** **Related GitHub Issues:** PennyLaneAI/catalyst#1044 --------- Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com> Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai> Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
multiphaseCFD
pushed a commit
to PennyLaneAI/pennylane-lightning
that referenced
this issue
Sep 5, 2024
…okkos (#878) **Context:** Catalyst recently fixed a bug where recycling a device when a previous execution involves stateprep causes a crash: PennyLaneAI/catalyst#1047 The fix is made to `lightning.qubit`, and thus we need to fix it for `lightning.kokkos` here as well. **Description of the Change:** In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now correctly query the DevQubits from the SimQubits in its qubit_manger's map. **Benefits:** We can now have multiple qnode functions involving stateprep in a workflow **Possible Drawbacks:** **Related GitHub Issues:** PennyLaneAI/catalyst#1044 --------- Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com> Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai> Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
multiphaseCFD
pushed a commit
to PennyLaneAI/pennylane-lightning
that referenced
this issue
Sep 8, 2024
…okkos (#878) **Context:** Catalyst recently fixed a bug where recycling a device when a previous execution involves stateprep causes a crash: PennyLaneAI/catalyst#1047 The fix is made to `lightning.qubit`, and thus we need to fix it for `lightning.kokkos` here as well. **Description of the Change:** In `LightningKokkosSimulator`, `SetState` and `SetBasisState` now correctly query the DevQubits from the SimQubits in its qubit_manger's map. **Benefits:** We can now have multiple qnode functions involving stateprep in a workflow **Possible Drawbacks:** **Related GitHub Issues:** PennyLaneAI/catalyst#1044 --------- Co-authored-by: paul0403 <79805239+paul0403@users.noreply.github.com> Co-authored-by: ringo-but-quantum <github-ringo-but-quantum@xanadu.ai> Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following mlir has multiple functions using set_state on the same device shared object file and it crashes:
However, if we do one of the two following, then there won't be a crash:
cp librtd_lightning.so librtd_lightning_1.so && cp librtd_lightning.so librtd_lightning_2.so
, and use these copies inquantum.device
quantum.set_state
, i.e.The text was updated successfully, but these errors were encountered: