GB0059

Graph-Break Type

Short name describing what triggered the graph break

Failed to trace builtin operator

Context

Values or code snippet captured at the break point

builtin {fn.name} {arg_types} {has_kwargs}

Explanation

Explanation of why the graph break was triggered

Dynamo does not know how to trace builtin operator {fn.__name__} with argument types {real_arg_types} (has_kwargs {has_kwargs})

Hints

Hints on how to resolve the graph break

Additional Information

Example code that causes the graph break is:

def fn():
    print("This is a debug message inside the compiled function.")
compiled_fn = torch.compile(fn, backend="eager", fullgraph=True)
compiled_fn()

A sample workaround around this is:

def fn():
    print("This is a debug message inside the compiled function.")

with torch._dynamo.config.patch(reorderable_logging_functions={print}):
    compiled_fn = torch.compile(fn, backend="eager", fullgraph=True)
    result = compiled_fn()

Click here to add Additional Info

Back to Registry