Skip to content

Reorder slice before view (#20240)#20240

Open
DrJessop wants to merge 1 commit into
pytorch:mainfrom
DrJessop:export-D108217652
Open

Reorder slice before view (#20240)#20240
DrJessop wants to merge 1 commit into
pytorch:mainfrom
DrJessop:export-D108217652

Conversation

@DrJessop

@DrJessop DrJessop commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary:

The closer slice is to compute, the easier it is to perform certain optimizations you couldn't previously. Have seen cases where we have linear -> view -> slice nodes, and if those slice nodes were right after the linear, we could have sliced out the channel dim directly in those weights at compile time rather than hitting runtime non-contiguous slice performance penalties.

Reviewed By: abeakkas

Differential Revision: D108217652

@pytorch-bot

pytorch-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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:

❌ 3 New Failures, 2 Pending

As of commit b36f218 with merge base 185bd09 (image):

NEW FAILURES - The following jobs have failed:

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 Jun 12, 2026
@meta-codesync

meta-codesync Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown

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.

@meta-codesync meta-codesync Bot changed the title Reorder slice before view Reorder slice before view (#20240) Jun 12, 2026
DrJessop added a commit to DrJessop/executorch that referenced this pull request Jun 12, 2026
Summary:

The closer slice is to compute, the easier it is to perform certain optimizations you couldn't previously. Have seen cases where we have linear -> view -> slice nodes, and if those slice nodes were right after the linear, we could have sliced out the channel dim directly in those weights at compile time rather than hitting runtime non-contiguous slice performance penalties.

Differential Revision: D108217652
@DrJessop DrJessop force-pushed the export-D108217652 branch from 24dea61 to 25ddb69 Compare June 12, 2026 20:58
Summary:

The closer slice is to compute, the easier it is to perform certain optimizations you couldn't previously. Have seen cases where we have linear -> view -> slice nodes, and if those slice nodes were right after the linear, we could have sliced out the channel dim directly in those weights at compile time rather than hitting runtime non-contiguous slice performance penalties.

Reviewed By: abeakkas

Differential Revision: D108217652
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants