Skip to content

Instantly share code, notes, and snippets.

@d4l3k
Created October 28, 2023 08:34
Show Gist options
  • Save d4l3k/32902e6a8a66c80b19ac09471aff7843 to your computer and use it in GitHub Desktop.
Save d4l3k/32902e6a8a66c80b19ac09471aff7843 to your computer and use it in GitHub Desktop.
Traceback (most recent call last):
File "/home/rice/Developer/test_torch_export.py", line 11, in <module>
compiled = export(foo, args=tuple())
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/export/__init__.py", line 440, in export
return export__RC__(f, args, kwargs, dynamic_shapes=dynamic_shapes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_export/__init__.py", line 252, in export__RC__
return _export(f, args, kwargs, constraints=constraints)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_export/__init__.py", line 596, in _export
gm_torch_level = _export_to_torch_ir(
^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_export/__init__.py", line 517, in _export_to_torch_ir
gm_torch_level, _ = torch._dynamo.export(
^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/eval_frame.py", line 1226, in inner
result_traced = opt_f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/eval_frame.py", line 410, in _fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/eval_frame.py", line 558, in catch_errors
return callback(frame, cache_entry, hooks, frame_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/convert_frame.py", line 148, in _fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/convert_frame.py", line 402, in _convert_frame_assert
return _compile(
^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/convert_frame.py", line 610, in _compile
guarded_code = compile_inner(code, one_graph, hooks, transform)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/utils.py", line 221, in time_wrapper
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/convert_frame.py", line 527, in compile_inner
out_code = transform_code_object(code, transform)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/bytecode_transformation.py", line 1028, in transform_code_object
transformations(instructions, code_options)
File "/home/rice/Developer/pytorch/torch/_dynamo/convert_frame.py", line 497, in transform
tracer.run()
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 2126, in run
super().run()
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 750, in run
and self.step()
^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 713, in step
getattr(self, inst.opname)(inst)
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 404, in wrapper
return inner_fn(self, inst)
^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 1779, in CALL
self.call_function(fn, args, kwargs)
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 585, in call_function
self.push(fn.call_function(self, args, kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/user_defined.py", line 184, in call_function
return var.add_options(var.call_method(tx, "__init__", args, kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/user_defined.py", line 315, in call_method
).call_function(tx, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/functions.py", line 307, in call_function
return super().call_function(tx, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/functions.py", line 261, in call_function
return super().call_function(tx, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/functions.py", line 90, in call_function
return tx.inline_user_function_return(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 621, in inline_user_function_return
result = InliningInstructionTranslator.inline_call(self, fn, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 2254, in inline_call
return cls.inline_call_(parent, func, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/symbolic_convert.py", line 2319, in inline_call_
sub_locals, closure_cells = func.bind_args(parent, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/functions.py", line 157, in bind_args
[
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/functions.py", line 158, in <listcomp>
wrap(val=arg, source=source)
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/functions.py", line 33, in wrap_bound_arg
return SourcelessBuilder()(tx, val).add_options(options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rice/Developer/pytorch/torch/_dynamo/variables/builder.py", line 1876, in __call__
unimplemented(f"Unexpected type in sourceless builder {type(value)}")
File "/home/rice/Developer/pytorch/torch/_dynamo/exc.py", line 184, in unimplemented
raise Unsupported(msg)
torch._dynamo.exc.Unsupported: Unexpected type in sourceless builder <class 'torch.dtype'>
from user code:
File "/home/rice/Developer/test_torch_export.py", line 9, in foo
return Foo().value
Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment