Add sum.dim_IntList to RemovePermutesAroundElementwiseOps#19243
Add sum.dim_IntList to RemovePermutesAroundElementwiseOps#19243mcremon-meta wants to merge 1 commit intomainfrom
Conversation
Summary: `DecomposeMeanDimPass` decomposes `mean.dim` into `sum.dim_IntList + mul.Tensor`. While `mean.dim` and `mul.Tensor` are both in the `permutable_ops` set of `RemovePermutesAroundElementwiseOps`, `sum.dim_IntList` is not — so the pass cannot traverse through the decomposed chain to find the matching exit permute. This adds `aten.sum.dim_IntList` to `permutable_ops` with the same keepdim validation and dimension-adjustment logic already used for `mean.dim`. This is safe because: - `sum.dim_IntList` has identical dimension semantics to `mean.dim` - `DecomposeMeanDimPass` always calls sum with `keepdim=True` - `mul.Tensor` (the other half of the decomposition) is already handled Reviewed By: 3l1 Differential Revision: D103272273
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19243
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New Failures, 2 Unrelated FailuresAs of commit a4593f1 with merge base 94d2881 ( NEW FAILURES - The following jobs have 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 D103272273. |
This PR needs a
|
|
Looks good. |
Summary:
DecomposeMeanDimPassdecomposesmean.dimintosum.dim_IntList + mul.Tensor.While
mean.dimandmul.Tensorare both in thepermutable_opsset ofRemovePermutesAroundElementwiseOps,sum.dim_IntListis not — so the passcannot traverse through the decomposed chain to find the matching exit permute.
This adds
aten.sum.dim_IntListtopermutable_opswith the same keepdimvalidation and dimension-adjustment logic already used for
mean.dim. This issafe because:
sum.dim_IntListhas identical dimension semantics tomean.dimDecomposeMeanDimPassalways calls sum withkeepdim=Truemul.Tensor(the other half of the decomposition) is already handledReviewed By: 3l1
Differential Revision: D103272273
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell