Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ class FuseIdenticalInputTransformsPass(

# Both bases declare this; restate it once so the two agree.
target_ops: set[Any] = _FuseIdenticalInputTransformsPass.target_ops
_recompile_before_retrace = False
4 changes: 3 additions & 1 deletion backends/transforms/fuse_identical_input_transforms_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class FuseIdenticalInputTransformsPass(ExportPass):
_ELEMENTWISE_OPS = _BINARY_ELEMENTWISE_OPS | _NARY_ELEMENTWISE_OPS

target_ops = _ELEMENTWISE_OPS | _CONCAT_OPS
_recompile_before_retrace = True

def __init__(self, exported_program: ExportedProgram | None = None) -> None:
super().__init__()
Expand Down Expand Up @@ -179,7 +180,8 @@ def call(self, graph_module: GraphModule) -> PassResult:
if modified:
graph_module.graph.eliminate_dead_code()
graph_module.graph.lint()
graph_module.recompile()
if self._recompile_before_retrace:
graph_module.recompile()
graph_module = super().call(graph_module).graph_module

return PassResult(graph_module, modified)
Expand Down
Loading