Skip to content

Commit 72d8082

Browse files
authored
Unify reorder passes.
Differential Revision: D85264577 Pull Request resolved: #15561
1 parent f4e1bd0 commit 72d8082

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

backends/cadence/aot/reorder_ops.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,7 @@ 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+
class CommonReorderPasses:
826824
passes = [
827825
# Hoist/sink nodes closer to their SSA def/use
828826
HoistOpsCloserToDefPass,
@@ -832,6 +830,13 @@ class CadenceReorderOpsInGraph:
832830
# nodes closer to their def/use.
833831
AdvanceQuantizeOpAboveDefChainPass,
834832
PostponeDequantizeOpBelowUseChainPass,
833+
]
834+
835+
836+
# The following class consolidates functions to reoder ops (i.e., either hoist
837+
# or sink some ops in the graph).
838+
class CadenceReorderOpsInGraph:
839+
passes = CommonReorderPasses.passes + [
835840
# These passes work on branches instead of linear chains to advance
836841
# quantize op beyond their def.
837842
AdvanceQuantizeOpAboveDefInBranchPass,

0 commit comments

Comments
 (0)