Skip to content

Instantly share code, notes, and snippets.

@mlazos
Created September 13, 2022 17:33
Show Gist options
  • Save mlazos/6a63ad1e6470dc12329b165adab20df8 to your computer and use it in GitHub Desktop.
Save mlazos/6a63ad1e6470dc12329b165adab20df8 to your computer and use it in GitHub Desktop.
repro
import logging
import torch
import torchdynamo
torchdynamo.config.log_level = logging.WARNING
def test_assertion_error():
y = torch.ones(200, 200)
z = {y: 5}
return z
@torchdynamo.optimize("eager")
def level1():
x = torch.ones(1, 1)
level2()
def level2():
x = torch.ones(1, 1)
print("hi")
test_assertion_error()
try:
level1()
except:
pass
torchdynamo.symbolic_convert: [WARNING] Graph break: call_function BuiltinVariable(print) [ConstantVariable(str)] {} from user code at File "/scratch/mlazos/test/errors.py", line 28, in level2
print("hi")
torchdynamo.symbolic_convert: [WARNING] Graph break: call_function BuiltinVariable(print) [ConstantVariable(str)] {} from user code at File "/scratch/mlazos/test/errors.py", line 28, in level2
print("hi")
hi
torchdynamo.convert_frame: [ERROR] WON'T CONVERT <graph break in level2> /scratch/mlazos/test/errors.py line 28
due to:
Traceback (most recent call last):
File "/scratch/mlazos/torchdynamo/torchdynamo/symbolic_convert.py", line 837, in BUILD_MAP
assert isinstance(k, ConstantVariable) or (
AssertionError
from user code:
File "/scratch/mlazos/test/errors.py", line 30, in <graph break in level2>
test_assertion_error()
Set torchdynamo.config.verbose=True for more information
==========
torchdynamo.convert_frame: [ERROR] WON'T CONVERT test_assertion_error /scratch/mlazos/test/errors.py line 12
due to:
Traceback (most recent call last):
File "/scratch/mlazos/torchdynamo/torchdynamo/symbolic_convert.py", line 837, in BUILD_MAP
assert isinstance(k, ConstantVariable) or (
AssertionError
from user code:
File "/scratch/mlazos/test/errors.py", line 14, in test_assertion_error
z = {y: 5}
Set torchdynamo.config.verbose=True for more information
==========
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment