Skip to content

Commit 3cce4b7

Browse files
mengluyfacebook-github-bot
authored andcommitted
Commit 2
Differential Revision: D60572467
1 parent ef0f591 commit 3cce4b7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

torch/_inductor/fx_passes/post_grad.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ def post_grad_passes(gm: torch.fx.GraphModule, is_inference: bool):
145145

146146
gm.recompile()
147147
optimus_scuba_log["after_recompile_post_grad"] = upload_graph(gm.graph)
148+
print("after recompile in post grad: ", upload_graph(gm.graph))
149+
print("counters of inductor: ", counters["inductor"])
148150
gm.graph.lint()
149151

150152

torch/_inductor/fx_passes/pre_grad.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ def shape_prop(mod) -> None:
244244
)
245245
# we support run same pattern multiple times, the default is to run only once
246246
counter = config.pre_grad_fusion_options[pass_name].get("counter", 1)
247+
print("before apply pass: ", pattern_matcher_pass.pass_name, upload_graph(gm.graph))
247248
for _ in range(counter):
248249
pattern_matcher_pass.apply(gm.graph) # type: ignore[arg-type]
250+
print("after apply pass: ", pattern_matcher_pass.pass_name, upload_graph(gm.graph))
249251
if not is_same_dict(counters["inductor"], inductor_before_change):
250252
optimus_scuba_log[
251253
f"{pattern_matcher_pass.pass_name}_pre_grad"
@@ -267,6 +269,8 @@ def shape_prop(mod) -> None:
267269
gm.graph.lint()
268270
gm.recompile()
269271
optimus_scuba_log["after_recompile_pre_grad"] = upload_graph(gm.graph)
272+
print("after recompile in pre grad: ", upload_graph(gm.graph))
273+
print("inductor counter: ", counters["inductor"])
270274

271275
if (
272276
config.pattern_matcher

0 commit comments

Comments
 (0)