Skip to content

Commit de50102

Browse files
eigen-kfacebook-github-bot
authored andcommitted
Unify reorder passes.
Differential Revision: D85264577
1 parent e3b7eda commit de50102

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

backends/cadence/aot/reorder_ops.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,8 @@ def call(self, graph_module: torch.fx.GraphModule) -> PassResult:
820820
return super().call(self.graph_module)
821821

822822

823-
# The following class consolidates functions to reoder ops (i.e., either hoist
824-
# or sink some ops in the graph).
825-
class CadenceReorderOpsInGraph:
823+
824+
class CommonReorderPasses:
826825
passes = [
827826
# Hoist/sink nodes closer to their SSA def/use
828827
HoistOpsCloserToDefPass,
@@ -832,6 +831,13 @@ class CadenceReorderOpsInGraph:
832831
# nodes closer to their def/use.
833832
AdvanceQuantizeOpAboveDefChainPass,
834833
PostponeDequantizeOpBelowUseChainPass,
834+
]
835+
836+
837+
# The following class consolidates functions to reoder ops (i.e., either hoist
838+
# or sink some ops in the graph).
839+
class CadenceReorderOpsInGraph:
840+
passes = CommonReorderPasses.passes + [
835841
# These passes work on branches instead of linear chains to advance
836842
# quantize op beyond their def.
837843
AdvanceQuantizeOpAboveDefInBranchPass,

0 commit comments

Comments
 (0)