Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit cbfa91e

Browse files
committed
Nit
1 parent 06e94c8 commit cbfa91e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

torchdynamo/debug_utils.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ def dump_dynamo_gm_state(gm, args, compiler_name):
366366
gm.recompile()
367367

368368
with open(file_name, "w") as fd:
369+
# TODO - Add the readable version of to_folder when available
369370
gm.to_folder(gm_dir, "ReproModule")
370371
fd.write(generate_backend_repro_string(gm, args, compiler_name))
371372
local_dir = os.path.join(torchdynamo.config.base_dir, "repro")
@@ -434,15 +435,12 @@ def debug_wrapper(gm, example_inputs, **kwargs):
434435
fx.GraphModule(gm, copy.deepcopy(gm.graph)), example_inputs
435436
)
436437
else:
437-
# Instead of creating a new file that we could minify
438-
# further, as is the case with wrap_post_aot_debug, we
439-
# directly run the minifier here.
440-
441-
# The key reason is that minifier needs Fx GraphModule to
442-
# run. wrap_post_aot_debug uses make_fx to generate Fx
443-
# GraphModule, which is ok because it is run after
444-
# AotAutograd has completed. In our case, we plan to run
445-
# torchdynamo.optimize, and make_fx is the not right choice.
438+
# As opposed to using dump_to_minify, like we do in
439+
# wrap_post_aot_debug, we directly run minifier here. This
440+
# is because we can't serialize compiler_fn here.
441+
442+
# The minified version uses
443+
# torchdynamo.optimize(compiler_str) to repro the error.
446444

447445
# Directly running the minifier could be bad if something
448446
# goes bad while minification is running. We will have to

0 commit comments

Comments
 (0)