Skip to content

Commit

Permalink
Revert "inductor: only do the conv+bn folding for the freezing path (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pytorchmergebot committed Sep 18, 2023
1 parent 5cd8a6d commit 70ca3ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions torch/_inductor/fx_passes/pre_grad.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ def fuse_fx(gm: torch.fx.GraphModule, example_inputs):
gm = permute_matmul_fusion(gm)

# make sure the autograd is disabled.
if torch.is_grad_enabled() or not is_cpu:
if torch.is_grad_enabled():
return gm
if config.freezing:
gm = remove_identity(gm)
gm = fuse_conv_bn(gm)
if not is_cpu:
return gm
gm = remove_identity(gm)
gm = fuse_conv_bn(gm)
return gm


Expand Down

0 comments on commit 70ca3ee

Please sign in to comment.