Skip to content

Add sum.dim_IntList to RemovePermutesAroundElementwiseOps#19243

Open
mcremon-meta wants to merge 1 commit intomainfrom
export-D103272273
Open

Add sum.dim_IntList to RemovePermutesAroundElementwiseOps#19243
mcremon-meta wants to merge 1 commit intomainfrom
export-D103272273

Conversation

@mcremon-meta
Copy link
Copy Markdown
Contributor

@mcremon-meta mcremon-meta commented May 1, 2026

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

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell

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
@mcremon-meta mcremon-meta requested a review from kimishpatel as a code owner May 1, 2026 03:53
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 1, 2026

🔗 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 Failures

As of commit a4593f1 with merge base 94d2881 (image):

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.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 1, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 1, 2026

@mcremon-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103272273.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@gggekov gggekov added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk labels May 1, 2026
@gggekov
Copy link
Copy Markdown
Collaborator

gggekov commented May 1, 2026

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants