Improve RemovePermutesAroundElementwiseOps robustness (#18980)#18980
Improve RemovePermutesAroundElementwiseOps robustness (#18980)#18980meta-codesync[bot] merged 1 commit intomainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18980
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 2 Unrelated FailuresAs of commit 4e8cd57 with merge base 063f9c9 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@mcremon-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101430531. |
This PR needs a
|
Summary: Improve the RemovePermutesAroundElementwiseOps pass with several defensive enhancements: 1. Add output node boundary check: reject subgraphs where a permutable op feeds directly into the graph output, since removing permutes would silently change the output format. 2. Add constant input handling: when a subgraph boundary is a compile-time constant (parameter, buffer, get_attr, or ops computed entirely from constants), insert a compensating permute/view on it instead of rejecting the subgraph. This is free since it gets constant-folded. 3. Add clamp.default to the set of permutable ops. 4. Handle rank-mismatch for constant inputs (e.g. rank-1 bias with rank-4 permute) by using view_copy with appropriate shape reordering. Reviewed By: DrJessop Differential Revision: D101430531
39e6447 to
931fdc3
Compare
Summary: Improve the RemovePermutesAroundElementwiseOps pass with several defensive enhancements: 1. Add output node boundary check: reject subgraphs where a permutable op feeds directly into the graph output, since removing permutes would silently change the output format. 2. Add constant input handling: when a subgraph boundary is a compile-time constant (parameter, buffer, get_attr, or ops computed entirely from constants), insert a compensating permute/view on it instead of rejecting the subgraph. This is free since it gets constant-folded. 3. Add clamp.default to the set of permutable ops. 4. Handle rank-mismatch for constant inputs (e.g. rank-1 bias with rank-4 permute) by using view_copy with appropriate shape reordering. Reviewed By: DrJessop Differential Revision: D101430531
931fdc3 to
dca1584
Compare
Summary: Pull Request resolved: #18980 Improve the RemovePermutesAroundElementwiseOps pass with several defensive enhancements: 1. Add output node boundary check: reject subgraphs where a permutable op feeds directly into the graph output, since removing permutes would silently change the output format. 2. Add constant input handling: when a subgraph boundary is a compile-time constant (parameter, buffer, get_attr, or ops computed entirely from constants), insert a compensating permute/view on it instead of rejecting the subgraph. This is free since it gets constant-folded. 3. Add clamp.default to the set of permutable ops. 4. Handle rank-mismatch for constant inputs (e.g. rank-1 bias with rank-4 permute) by using view_copy with appropriate shape reordering. Reviewed By: DrJessop Differential Revision: D101430531
dca1584 to
aaec56d
Compare
Summary: Pull Request resolved: #18980 Improve the RemovePermutesAroundElementwiseOps pass with several defensive enhancements: 1. Add output node boundary check: reject subgraphs where a permutable op feeds directly into the graph output, since removing permutes would silently change the output format. 2. Add constant input handling: when a subgraph boundary is a compile-time constant (parameter, buffer, get_attr, or ops computed entirely from constants), insert a compensating permute/view on it instead of rejecting the subgraph. This is free since it gets constant-folded. 3. Add clamp.default to the set of permutable ops. 4. Handle rank-mismatch for constant inputs (e.g. rank-1 bias with rank-4 permute) by using view_copy with appropriate shape reordering. Reviewed By: DrJessop Differential Revision: D101430531
aaec56d to
4e8cd57
Compare
Summary:
Improve the RemovePermutesAroundElementwiseOps pass with several
defensive enhancements:
Add output node boundary check: reject subgraphs where a permutable
op feeds directly into the graph output, since removing permutes
would silently change the output format.
Add constant input handling: when a subgraph boundary is a
compile-time constant (parameter, buffer, get_attr, or ops computed
entirely from constants), insert a compensating permute/view on it
instead of rejecting the subgraph. This is free since it gets
constant-folded.
Add clamp.default to the set of permutable ops.
Handle rank-mismatch for constant inputs (e.g. rank-1 bias with
rank-4 permute) by using view_copy with appropriate shape reordering.
Reviewed By: DrJessop
Differential Revision: D101430531