Skip to content

Arm backend: Rewrite cat->slice patterns - #22868

Open
oscarandersson8218 wants to merge 2 commits into
pytorch:mainfrom
oscarandersson8218:rewrite_cat_slices
Open

oscarandersson8218 wants to merge 2 commits into
pytorch:mainfrom
oscarandersson8218:rewrite_cat_slices

Conversation

@oscarandersson8218

@oscarandersson8218 oscarandersson8218 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Add RewriteCatSlicePass to rewrite static unit-stride slices along a concat dimension in terms of their overlapping original inputs.

Only rewrite complete groups of slice users when the replacement does not increase the operation count. Preserve qparams for cat's tensor-list input and void materializing no-op slices for complete inputs.

This avoids materializing an intermediate concat when only part of its result is needed.

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

Add RewriteCatSlicePass to rewrite static unit-stride slices along a
concat dimension in terms of their overlapping original inputs.

Only rewrite complete groups of slice users when the replacement does
not increase the operation count. Preserve qparams for cat's tensor-list
input and void materializing no-op slices for complete inputs.

This avoids materializing an intermediate concat when only part of its
result is needed.

Change-Id: I93b2f987948ff715063e3dcfdf6d8efd501434f9
Signed-off-by: Oscar Andersson <oscar.andersson@arm.com>
@pytorch-bot

pytorch-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 Cancelled Job, 2 Pending, 2 Unrelated Failures

As of commit 5dd9b9f with merge base b0bc7b2 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

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 Sep 16, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Sep 16, 2026
@oscarandersson8218 oscarandersson8218 added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate release notes: none Do not include this in the release notes and removed release notes: arm Changes to the ARM backend delegate labels Sep 16, 2026
Signed-off-by: Oscar Andersson <oscar.andersson@arm.com>
Change-Id: Iefce2ef195b47b3b7aeb7c01e87f2b8789d8c943
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. module: arm Issues related to arm backend partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant