Skip to content

Commit

Permalink
Print AOT Autograd graph name when accuracy failed
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Z. Yang <ezyangmeta.com>

ghstack-source-id: bc335ef7657ef28042665fc04f3c49a67e7ae321
Pull Request resolved: #99366
  • Loading branch information
ezyang committed Apr 20, 2023
1 parent ccd5ad8 commit fe57767
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion torch/_dynamo/repro/after_aot.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,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 need to deepcopy the original graph?
orig_graph = copy.deepcopy(gm.graph)
assert config.repro_after in ("dynamo", "aot", None)
Expand Down Expand Up @@ -104,7 +108,9 @@ def deferred_for_real_inputs(real_inputs):
"Accuracy minification is supported for inductor only"
)
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

0 comments on commit fe57767

Please sign in to comment.