Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions backends/cadence/aot/reorder_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,7 @@ def call(self, graph_module: torch.fx.GraphModule) -> PassResult:
return super().call(self.graph_module)


# The following class consolidates functions to reoder ops (i.e., either hoist
# or sink some ops in the graph).
class CadenceReorderOpsInGraph:
class CommonReorderPasses:
passes = [
# Hoist/sink nodes closer to their SSA def/use
HoistOpsCloserToDefPass,
Expand All @@ -832,6 +830,13 @@ class CadenceReorderOpsInGraph:
# nodes closer to their def/use.
AdvanceQuantizeOpAboveDefChainPass,
PostponeDequantizeOpBelowUseChainPass,
]


# The following class consolidates functions to reoder ops (i.e., either hoist
# or sink some ops in the graph).
class CadenceReorderOpsInGraph:
passes = CommonReorderPasses.passes + [
# These passes work on branches instead of linear chains to advance
# quantize op beyond their def.
AdvanceQuantizeOpAboveDefInBranchPass,
Expand Down
Loading