Skip to content

Instantly share code, notes, and snippets.

@msaroufim
Created August 13, 2022 00:06
Show Gist options
  • Save msaroufim/ce9ec004536e762fb5c94eb3ab2670f1 to your computer and use it in GitHub Desktop.
Save msaroufim/ce9ec004536e762fb5c94eb3ab2670f1 to your computer and use it in GitHub Desktop.
## Logs
```
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/misc.py", line 531, in call_function
return self.obj.call_method(tx, self.name, args, kwargs).add_options(self)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/user_defined.py", line 76, in call_method
return super().call_method(tx, args, kwargs)
TypeError: call_method() missing 1 required positional argument: 'kwargs'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
========== End debug info ==========
ERROR FROM offset=12 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
ERROR FROM offset=24 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
ERROR FROM offset=38 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 534 KeyError
ERROR FROM offset=8 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py 1574 KeyError
ERROR FROM offset=20 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py 1574 KeyError
ERROR FROM offset=94 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py 117 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 678, in call_getattr
obj.var_getattr(tx, name).clone(source=source).add_options(options)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/user_defined.py", line 298, in var_getattr
return variables.UserMethodVariable(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 200, in call_function
return super().call_function(tx, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 678, in call_getattr
obj.var_getattr(tx, name).clone(source=source).add_options(options)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/user_defined.py", line 298, in var_getattr
return variables.UserMethodVariable(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 200, in call_function
return super().call_function(tx, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'round'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 99, in wrapper
@wraps(fn)
========== End debug info ==========
ERROR FROM offset=12 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
ERROR FROM offset=24 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
ERROR FROM offset=38 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 534 KeyError
ERROR FROM offset=8 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py 1574 KeyError
ERROR FROM offset=20 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py 1574 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 678, in call_getattr
obj.var_getattr(tx, name).clone(source=source).add_options(options)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/user_defined.py", line 298, in var_getattr
return variables.UserMethodVariable(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 200, in call_function
return super().call_function(tx, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'round'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 117, in wrapper
h = tape.hash
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py", line 1570, in hash
@property
========== End debug info ==========
ERROR FROM offset=12 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
ERROR FROM offset=24 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
ERROR FROM offset=38 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 534 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'round'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 117, in wrapper
h = tape.hash
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py", line 1574, in hash
fingerprint.extend(op.hash for op in self.operations)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py", line 1574, in <genexpr>
fingerprint.extend(op.hash for op in self.operations)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py", line 526, in hash
@property
========== End debug info ==========
ERROR FROM offset=12 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
ERROR FROM offset=24 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py 350 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'round'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 117, in wrapper
h = tape.hash
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py", line 1574, in hash
fingerprint.extend(op.hash for op in self.operations)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/tape/tape.py", line 1574, in <genexpr>
fingerprint.extend(op.hash for op in self.operations)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py", line 534, in hash
_process_data(self),
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py", line 344, in _process_data
def _process_data(op):
========== End debug info ==========
ERROR FROM offset=6 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/autoray/autoray.py 1148 AssertionError
ERROR FROM offset=6 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py 236 NotImplementedError
ERROR FROM offset=44 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py 596 NotImplementedError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 678, in CALL_FUNCTION_KW
self.call_function(fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/misc.py", line 531, in call_function
return self.obj.call_method(tx, self.name, args, kwargs).add_options(self)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/user_defined.py", line 211, in call_method
return UserMethodVariable(method, self, **options).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 200, in call_function
return super().call_function(tx, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 539, in call_isinstance
arg_type = arg.python_type()
File "/home/ubuntu/torchdynamo/torchdynamo/variables/base.py", line 140, in python_type
raise NotImplementedError(f"{self} has no type")
NotImplementedError: NumpyVariable() has no type
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 172, in wrapper
res = fn(execution_tapes.values(), **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 97, in fn
return original_fn(tapes, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 765, in reset
def reset(self):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 584, in _create_basis_state
def _create_basis_state(self, index):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 584, in _create_basis_state
def _create_basis_state(self, index):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 584, in _create_basis_state
def _create_basis_state(self, index):
========== End debug info ==========
ERROR FROM offset=6 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py 236 NotImplementedError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 539, in call_isinstance
arg_type = arg.python_type()
File "/home/ubuntu/torchdynamo/torchdynamo/variables/base.py", line 140, in python_type
raise NotImplementedError(f"{self} has no type")
NotImplementedError: NumpyVariable() has no type
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 172, in wrapper
res = fn(execution_tapes.values(), **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 97, in fn
return original_fn(tapes, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 765, in reset
def reset(self):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 584, in _create_basis_state
def _create_basis_state(self, index):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 584, in _create_basis_state
def _create_basis_state(self, index):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 596, in _create_basis_state
state = self._asarray(state, dtype=self.C_DTYPE)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 235, in _asarray
def _asarray(self, a, dtype=None):
========== End debug info ==========
ERROR FROM offset=4 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/ops/qubit/parametric_ops.py 99 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'cos'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 172, in wrapper
res = fn(execution_tapes.values(), **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 97, in fn
return original_fn(tapes, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 205, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 205, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 228, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 257, in execute
self.apply(circuit.operations, rotations=circuit.diagonalizing_gates, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 207, in apply
def apply(self, operations, rotations=None, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 240, in _apply_operation
def _apply_operation(self, state, operation):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 305, in _get_unitary_matrix
return self._asarray(unitary.matrix(), dtype=self.C_DTYPE)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py", line 1414, in matrix
canonical_matrix = self.compute_matrix(*self.parameters, **self.hyperparameters)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/ops/qubit/parametric_ops.py", line 78, in compute_matrix
@staticmethod
========== End debug info ==========
ERROR FROM offset=10 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/autoray/autoray.py 260 KeyError
ERROR FROM offset=56 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/autoray/autoray.py 85 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 105, in impl
self.push(fn_var.call_function(self, self.popn(nargs), {}))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 536, in call_getitem
return args[0].call_method(tx, "__getitem__", args[1:], kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/dicts.py", line 67, in call_method
return self.getitem_const(args[0])
File "/home/ubuntu/torchdynamo/torchdynamo/variables/dicts.py", line 51, in getitem_const
return self.items[ConstDictVariable.get_key(arg)].add_options(self, arg)
KeyError: ('torch', 'stack')
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 172, in wrapper
res = fn(execution_tapes.values(), **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 97, in fn
return original_fn(tapes, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 205, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 205, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 228, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 257, in execute
self.apply(circuit.operations, rotations=circuit.diagonalizing_gates, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 207, in apply
def apply(self, operations, rotations=None, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 240, in _apply_operation
def _apply_operation(self, state, operation):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 305, in _get_unitary_matrix
return self._asarray(unitary.matrix(), dtype=self.C_DTYPE)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py", line 1414, in matrix
canonical_matrix = self.compute_matrix(*self.parameters, **self.hyperparameters)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/ops/qubit/parametric_ops.py", line 109, in compute_matrix
return qml.math.stack([stack_last([c, js]), stack_last([js, c])], axis=-2)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/math/multi_dispatch.py", line 154, in wrapper
@functools.wraps(fn)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/math/multi_dispatch.py", line 154, in wrapper
@functools.wraps(fn)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/math/multi_dispatch.py", line 507, in stack
return np.stack(values, axis=axis, like=like)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/autoray/autoray.py", line 29, in do
def do(fn, *args, like=None, **kwargs):
========== End debug info ==========
ERROR FROM offset=38 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/ops/qubit/parametric_ops.py 315 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'exp'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 172, in wrapper
res = fn(execution_tapes.values(), **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 97, in fn
return original_fn(tapes, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/contextlib.py", line 75, in inner
return func(*args, **kwds)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 331, in batch_execute
def batch_execute(self, circuits):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 205, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 205, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 228, in execute
def execute(self, circuit, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/_qubit_device.py", line 257, in execute
self.apply(circuit.operations, rotations=circuit.diagonalizing_gates, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 207, in apply
def apply(self, operations, rotations=None, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 207, in apply
def apply(self, operations, rotations=None, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit.py", line 240, in _apply_operation
def _apply_operation(self, state, operation):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py", line 304, in _get_unitary_matrix
return self._asarray(unitary.eigvals(), dtype=self.C_DTYPE)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py", line 1424, in eigvals
def eigvals(self):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/operation.py", line 689, in eigvals
return self.compute_eigvals(*self.parameters, **self.hyperparameters)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/ops/qubit/parametric_ops.py", line 284, in compute_eigvals
@staticmethod
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/ops/qubit/parametric_ops.py", line 284, in compute_eigvals
@staticmethod
========== End debug info ==========
ERROR FROM offset=12 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/devices/default_qubit_torch.py 141 AssertionError
ERROR FROM offset=4 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py 319 KeyError
ERROR FROM offset=12 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/cachetools/__init__.py 74 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 151, in wrapper
return inner_fn(self, inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 629, in CALL_FUNCTION
self.call_function(fn, args, {})
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 226, in call_function
self.push(fn.call_function(self, args, kwargs))
File "/home/ubuntu/torchdynamo/torchdynamo/variables/functions.py", line 64, in call_function
return tx.inline_user_function_return(
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 261, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1352, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 1398, in inline_call_
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'shape'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 189, in wrapper
cache[hashes[i]] = r
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/cachetools/__init__.py", line 216, in __setitem__
def __setitem__(self, key, value, cache_setitem=Cache.__setitem__):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/cachetools/__init__.py", line 72, in __setitem__
def __setitem__(self, key, value):
========== End debug info ==========
ERROR FROM offset=4 filename /home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py 319 KeyError
========== TorchDynamo Stack Trace ==========
Traceback (most recent call last):
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 288, in _convert_frame_assert
code = transform_code_object(frame.f_code, transform)
File "/home/ubuntu/torchdynamo/torchdynamo/bytecode_transformation.py", line 338, in transform_code_object
transformations(instructions, code_options)
File "/home/ubuntu/torchdynamo/torchdynamo/convert_frame.py", line 264, in transform
tracer.run()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 312, in run
and self.step()
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 290, in step
getattr(self, inst.opname)(inst)
File "/home/ubuntu/torchdynamo/torchdynamo/symbolic_convert.py", line 694, in LOAD_ATTR
result = BuiltinVariable(getattr).call_function(
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 335, in call_function
result = handler(tx, *args, **kwargs)
File "/home/ubuntu/torchdynamo/torchdynamo/variables/builtin.py", line 691, in call_getattr
member = obj.value.__dict__[name]
KeyError: 'shape'
========== Exception (above) while processing ==========
File "penny-quantum-torch.py", line 33, in <module>
opt.step(closure)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 105, in step
@torch.no_grad()
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py", line 118, in step
loss = closure()
File "penny-quantum-torch.py", line 27, in closure
loss = cost(phi, theta)
File "penny-quantum-torch.py", line 15, in cost
def cost(phi, theta):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 588, in __call__
def __call__(self, *args, **kwargs):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/qnode.py", line 619, in __call__
res = qml.execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 197, in execute
def execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 344, in execute
qml.interfaces.cache_execute(
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 189, in wrapper
cache[hashes[i]] = r
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/cachetools/__init__.py", line 216, in __setitem__
def __setitem__(self, key, value, cache_setitem=Cache.__setitem__):
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/cachetools/__init__.py", line 74, in __setitem__
size = self.getsizeof(value)
File "/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/pennylane/interfaces/execution.py", line 319, in <lambda>
cache = LRUCache(maxsize=cachesize, getsizeof=lambda x: qml.math.shape(x)[0])
========== End debug info ==========
WARNING torchdynamo.convert_frame: torchdynamo hit config.cache_size_limit (64)
function: '__setitem__' (/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/cachetools/__init__.py:216)
reasons: ['key == 6899054623475161868']
to diagnose recompilation issues, see https://github.com/pytorch/torchdynamo/blob/main/TROUBLESHOOTING.md.
WARNING torchdynamo.convert_frame: torchdynamo hit config.cache_size_limit (64)
function: '_single_tensor_adam' (/home/ubuntu/anaconda3/envs/quantum/lib/python3.8/site-packages/torch/optim/adam.py:229)
reasons: ['___stack1 == 1.0']
to diagnose recompilation issues, see https://github.com/pytorch/torchdynamo/blob/main/TROUBLESHOOTING.md.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment