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
12 changes: 6 additions & 6 deletions backends/cadence/aot/replace_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1665,13 +1665,13 @@ def maybe_remove_or_replace(self, node: torch.fx.Node) -> bool:

def call(self, graph_module: torch.fx.GraphModule) -> PassResult:
result = super().call(graph_module)
# If this pass made modifications, fuse any cascaded view ops that may have been created
if result.modified:
fuse_cascaded_result = FuseCascadedViewOps().call(result.graph_module)

# True because we are in the 'if modified' block
return PassResult(fuse_cascaded_result.graph_module, True)
return result
# TODO: I tried conditionally running this only if the above made any modifications,
# but for whatever reason was getting numerical failures in
# test_mtl_e2e_test_a16w8_two_layers_turing_3_1_1k. Always running this pass
# resolved that issue.
fuse_cascaded_result = FuseCascadedViewOps().call(result.graph_module)
return PassResult(fuse_cascaded_result.graph_module, True)


@register_cadence_pass(CadencePassAttribute(opt_level=2))
Expand Down
Loading