-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
KeyError shape,stack,cos
on pennylane quantum circuit
#93624
Labels
dynamo-must-fix
These bugs affect TorchDynamo reliability.
module: dynamo
oncall: pt2
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Comments
albanD
added
the
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
label
Feb 7, 2023
Not sure if the error is caused by pacakge upgrade in pennylane. But here is the repro: import torch
import pennylane as qml
dev = qml.device('default.qubit', wires=2)
@qml.qnode(dev, interface='torch')
def circuit4(phi, theta):
qml.RX(phi[0], wires=0)
qml.RZ(phi[1], wires=1)
qml.CNOT(wires=[0, 1])
qml.RX(theta, wires=0)
return qml.expval(qml.PauliZ(0))
def cost(phi, theta):
return torch.abs(circuit4(phi, theta) - 0.5)**2
phi = torch.tensor([0.011, 0.012], requires_grad=True)
theta = torch.tensor(0.05, requires_grad=True)
opt = torch.optim.Adam([phi, theta], lr = 0.1)
steps = 200
def closure():
opt.zero_grad()
loss = cost(phi, theta)
loss.backward()
return loss
def f():
for i in range(steps):
opt.step(closure)
torch.compile(f, backend="eager")() Error log:
|
The problem is we're hashing a user defined object, which can result in arbitrary code execution. We should not do this
|
This was referenced May 9, 2024
williamwen42
added a commit
that referenced
this issue
May 10, 2024
williamwen42
added a commit
that referenced
this issue
May 13, 2024
williamwen42
added a commit
that referenced
this issue
May 13, 2024
williamwen42
added a commit
that referenced
this issue
May 14, 2024
Fixes #93624 but also requires jcmgray/autoray#20 to be fixed. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
williamwen42
added a commit
that referenced
this issue
May 14, 2024
Fixes #93624 but also requires jcmgray/autoray#20 to be fixed. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang [ghstack-poisoned]
williamwen42
added a commit
that referenced
this issue
May 14, 2024
williamwen42
added a commit
that referenced
this issue
May 15, 2024
ZelboK
pushed a commit
to ZelboK/pytorch
that referenced
this issue
May 19, 2024
Fixes pytorch#93624 but also requires jcmgray/autoray#20 to be fixed. Pull Request resolved: pytorch#125945 Approved by: https://github.com/jansel ghstack dependencies: pytorch#125882, pytorch#125943
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dynamo-must-fix
These bugs affect TorchDynamo reliability.
module: dynamo
oncall: pt2
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
@anijain2305 would you rather I create an "interesting model" tracker or should I keep creating unique issues for each kind of model
Repro
python -m pip install pennylane
Logs
https://gist.github.com/msaroufim/ce9ec004536e762fb5c94eb3ab2670f1
cc @ezyang @wconstab @bdhirsh @anijain2305 @zou3519 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @aakhundov @kadeng @soumith @ngimel
The text was updated successfully, but these errors were encountered: