Skip to content
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

Print AOT Autograd graph name when accuracy failed #99366

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion torch/_dynamo/debug_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ def debug_wrapper(gm, example_inputs, **kwargs):

compiler_fn = functools.partial(unconfigured_compiler_fn, **kwargs)

from torch._functorch.aot_autograd import get_aot_graph_name
graph_name = get_aot_graph_name()

# TODO: Why do we have to save the orig_graph?
orig_graph = copy.deepcopy(gm.graph)
assert config.repro_after in ("dynamo", "aot", None)
inner_compiled_fn = None
Expand Down Expand Up @@ -578,7 +582,7 @@ def deferred_for_real_inputs(real_inputs):
if inner_compiled_fn is None:
inner_compiled_fn = compiler_fn(gm, example_inputs)
if backend_aot_accuracy_fails(gm, real_inputs, compiler_fn):
log.warning("Accuracy failed for the AOT Autograd graph")
log.warning("Accuracy failed for the AOT Autograd graph %s", graph_name)
dump_compiler_graph_state(
fx.GraphModule(gm, orig_graph),
copy_tensor_attrs,
Expand Down