Skip to content

Commit 37998d3

Browse files
eigen-kfacebook-github-bot
authored andcommitted
Move remove passes to iterative section (pytorch#16049)
Summary: This change reorganizes the pass execution order by moving the remove passes (clone removal, permute removal, etc.) into the iterative section of the pass manager. Previously, these passes were executed in a single-shot manner. By moving them to the iterative section, the pass manager can now run these optimization passes repeatedly until a fixed point is reached, where no further optimizations can be applied. This is important because removing one operation may enable additional removal opportunities that weren't visible before. Differential Revision: D88109852
1 parent 6e22520 commit 37998d3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

backends/cadence/aot/remove_ops.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ def maybe_remove_or_replace(self, node: Node) -> bool:
912912
return False
913913

914914

915-
class CommonRemovePasses:
915+
class CadenceRemoveNops:
916916
passes: List[Type[ExportPass]] = [
917917
RemoveAliasCopyOpPass,
918918
RemoveNopExpandOpPass,
@@ -923,12 +923,6 @@ class CommonRemovePasses:
923923
RemoveSqueezeViewBeforeElementwiseOps,
924924
RemoveCatFromSliceCopyPass,
925925
RemoveCloneOpsTransformImported,
926-
]
927-
928-
929-
class CadenceRemoveNops:
930-
passes: List[Type[ExportPass]] = CommonRemovePasses.passes + [
931-
SimplifySliceOpPass,
932926
RemoveNopRequantizeOpPass,
933927
RemoveZeroSizedConstantPadNd,
934928
RemoveContiguousOpPass,

0 commit comments

Comments
 (0)