Cache param/buffer/constant names in RemovePermutesAroundElementwiseTosaOps (#22164) - #22164
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22164
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 2 PendingAs of commit 0a8bc0a with merge base ff679f5 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@apullin has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114224782. |
This PR needs a
|
…osaOps (pytorch#22164) Summary: `RemovePermutesAroundElementwiseTosaOps._is_constant` called `is_param_node()` for every node reached during recursive `visit()` walk. Each `is_param_node` rebuilds immutable dict over full input_specs via uncached graph_signature properties. This made pass O(nodes * inputs). Precompute union of param/buffer/lifted-constant placeholder names once in `__init__` and use O(1) set membership. Semantics unchanged. Differential Revision: D114224782
adbba66 to
fc5b29a
Compare
…osaOps (pytorch#22164) Summary: `RemovePermutesAroundElementwiseTosaOps._is_constant` called `is_param_node()` for every node reached during recursive `visit()` walk. Each `is_param_node` rebuilds immutable dict over full input_specs via uncached graph_signature properties. This made pass O(nodes * inputs). Precompute union of param/buffer/lifted-constant placeholder names once in `__init__` and use O(1) set membership. Semantics unchanged. Differential Revision: D114224782
ca334bb to
4d6cdeb
Compare
…osaOps (pytorch#22164) Summary: `RemovePermutesAroundElementwiseTosaOps._is_constant` called `is_param_node()` for every node reached during recursive `visit()` walk. Each `is_param_node` rebuilds immutable dict over full input_specs via uncached graph_signature properties. This made pass O(nodes * inputs). Precompute the union of param/buffer/lifted-constant placeholder names once per pass invocation in `call()` and use O(1) set membership. Refreshing it at invocation time tracks the current `ExportedProgram` when a pass instance is reused. Semantics unchanged. Differential Revision: D114224782
4d6cdeb to
90268dd
Compare
…osaOps (pytorch#22164) Summary: `RemovePermutesAroundElementwiseTosaOps._is_constant` called `is_param_node()` for every node reached during recursive `visit()` walk. Each `is_param_node` rebuilds immutable dict over full input_specs via uncached graph_signature properties. This made pass O(nodes * inputs). Precompute the union of param/buffer/lifted-constant placeholder names once per pass invocation in `call()` and use O(1) set membership. Refreshing it at invocation time tracks the current `ExportedProgram` when a pass instance is reused. Semantics unchanged. Differential Revision: D114224782
…osaOps (pytorch#22164) Summary: `RemovePermutesAroundElementwiseTosaOps._is_constant` called `is_param_node()` for every node reached during recursive `visit()` walk. Each `is_param_node` rebuilds immutable dict over full input_specs via uncached graph_signature properties. This made pass O(nodes * inputs). Precompute the union of param/buffer/lifted-constant placeholder names once per pass invocation in `call()` and use O(1) set membership. Refreshing it at invocation time tracks the current `ExportedProgram` when a pass instance is reused. Semantics unchanged. Differential Revision: D114224782
90268dd to
4113e2d
Compare
…osaOps (pytorch#22164) Summary: `RemovePermutesAroundElementwiseTosaOps._is_constant` called `is_param_node()` for every node reached during recursive `visit()` walk. Each `is_param_node` rebuilds immutable dict over full input_specs via uncached graph_signature properties. This made pass O(nodes * inputs). Precompute the union of param/buffer/lifted-constant placeholder names once per pass invocation in `call()` and use O(1) set membership. Refreshing it at invocation time tracks the current `ExportedProgram` when a pass instance is reused. Semantics unchanged. On an ensemble network of ~1M parameters, lowering produced identical output while running 10.5 seconds faster (2.7%). Differential Revision: D114224782
4113e2d to
0a8bc0a
Compare
Summary:
RemovePermutesAroundElementwiseTosaOps._is_constantcalledis_param_node()for every node reached during recursivevisit()walk. Eachis_param_noderebuilds immutable dict over full input_specs via uncached graph_signature properties. This made pass O(nodes * inputs). Precompute the union of param/buffer/lifted-constant placeholder names once per pass invocation incall()and use O(1) set membership. Refreshing it at invocation time tracks the currentExportedProgramwhen a pass instance is reused. Semantics unchanged.On an ensemble network of ~1M parameters, lowering produced identical output while running 10.5 seconds faster (2.7%).
Differential Revision: D114224782