From 9aa9000e55628bb2243f84fd9b5278e450b52ca8 Mon Sep 17 00:00:00 2001 From: Andrew Pullin Date: Thu, 27 Aug 2026 08:34:44 -0700 Subject: [PATCH] Drop redundant recompiles before ARM pass retracing (#22162) Summary: Drop redundant recompile() before ARM pass retracing. Remove redundant GraphModule.recompile() calls immediately before super().call(graph_module) in CanonicalizeViewCopyPermutePass and FuseDuplicateUsersPass. The following ExportPass retrace/interpreter does not consume compiled Python code object, so recompile adds wall time without changing graph. Keep graph.lint() in modified paths for invariant checking. Behavior-preserving lowering speedup. Differential Revision: D114790155 --- backends/arm/_passes/fuse_duplicate_users_pass.py | 1 - backends/transforms/canonicalize_view_copy_permute_pass.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/arm/_passes/fuse_duplicate_users_pass.py b/backends/arm/_passes/fuse_duplicate_users_pass.py index 9bd21112569..9134f361acf 100644 --- a/backends/arm/_passes/fuse_duplicate_users_pass.py +++ b/backends/arm/_passes/fuse_duplicate_users_pass.py @@ -88,7 +88,6 @@ def call(self, graph_module: GraphModule) -> PassResult: producers.append(representative) if modified: - graph_module.recompile() graph_module.graph.lint() graph_module = super().call(graph_module).graph_module diff --git a/backends/transforms/canonicalize_view_copy_permute_pass.py b/backends/transforms/canonicalize_view_copy_permute_pass.py index 56dbc14bb0a..b99222d2237 100644 --- a/backends/transforms/canonicalize_view_copy_permute_pass.py +++ b/backends/transforms/canonicalize_view_copy_permute_pass.py @@ -81,7 +81,7 @@ def call(self, graph_module: GraphModule) -> PassResult: if modified: graph_module.graph.eliminate_dead_code() - graph_module.recompile() + graph_module.graph.lint() graph_module = super().call(graph_module).graph_module return PassResult(graph_module, modified)