Skip to content

Add fast path for contiguous innermost-dim reduction in sum.IntList_out#18789

Merged
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
pssrawat:export-D99293418
Apr 9, 2026
Merged

Add fast path for contiguous innermost-dim reduction in sum.IntList_out#18789
meta-codesync[bot] merged 1 commit intopytorch:mainfrom
pssrawat:export-D99293418

Conversation

@pssrawat
Copy link
Copy Markdown
Contributor

@pssrawat pssrawat commented Apr 9, 2026

Summary:
Add a fast path to the portable sum.IntList_out kernel for the common case of reducing a contiguous tensor over its innermost (last) dimension with matching input/output dtypes. The fast path uses a tight loop over contiguous memory (acc += row[j]) that the compiler can auto-vectorize, bypassing the generic MapReduceOverDimListPlan infrastructure which has
5 layers of lambda indirection, per-output-element get_init_index() calls, and strided access patterns.

Differential Revision: D99293418

Summary:
Add a fast path to the portable sum.IntList_out kernel for the common case of reducing a contiguous tensor over its innermost (last) dimension with matching input/output dtypes. The fast path uses a tight loop over contiguous memory (`acc += row[j]`) that the compiler can auto-vectorize, bypassing the generic MapReduceOverDimListPlan infrastructure which has
5 layers of lambda indirection, per-output-element get_init_index() calls, and strided access patterns.

Differential Revision: D99293418
@pssrawat pssrawat requested a review from manuelcandales as a code owner April 9, 2026 15:23
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 9, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18789

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure, 2 Unrelated Failures

As of commit 561b4d4 with merge base 463f07b (image):

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.

@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 Apr 9, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 9, 2026

@pssrawat has exported this pull request. If you are a Meta employee, you can view the originating Diff in D99293418.

pssrawat added a commit to pssrawat/executorch that referenced this pull request Apr 9, 2026
…ut (pytorch#18789)

Summary:

Add a fast path to the portable sum.IntList_out kernel for the common case of reducing a contiguous tensor over its innermost (last) dimension with matching input/output dtypes. The fast path uses a tight loop over contiguous memory (`acc += row[j]`) that the compiler can auto-vectorize, bypassing the generic MapReduceOverDimListPlan infrastructure which has
5 layers of lambda indirection, per-output-element get_init_index() calls, and strided access patterns.

Differential Revision: D99293418
pssrawat added a commit to pssrawat/executorch that referenced this pull request Apr 9, 2026
…ut (pytorch#18789)

Summary:

Add a fast path to the portable sum.IntList_out kernel for the common case of reducing a contiguous tensor over its innermost (last) dimension with matching input/output dtypes. The fast path uses a tight loop over contiguous memory (`acc += row[j]`) that the compiler can auto-vectorize, bypassing the generic MapReduceOverDimListPlan infrastructure which has
5 layers of lambda indirection, per-output-element get_init_index() calls, and strided access patterns.

Differential Revision: D99293418
@pssrawat pssrawat added the release notes: none Do not include this in the release notes label Apr 9, 2026
@meta-codesync meta-codesync bot merged commit 6b63d3d into pytorch:main Apr 9, 2026
172 of 186 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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 release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants