Skip to content

Move output tensor resize to before XNNPACK subgraph execution#17661

Merged
GregoryComer merged 1 commit intopytorch:mainfrom
GregoryComer:export-D94148443
Apr 29, 2026
Merged

Move output tensor resize to before XNNPACK subgraph execution#17661
GregoryComer merged 1 commit intopytorch:mainfrom
GregoryComer:export-D94148443

Conversation

@GregoryComer
Copy link
Copy Markdown
Member

Summary:
ET's XNNPACK delegate currently resizes output tensors after running the XNNPACK subgraph. This is normally fine, as the buffer is large enough. However, if there is a logic bug or corrupt model file, the current code doesn't catch if XNNPACK's output is larger than the planned buffer until after execution, where it may crash.

To fix this, I've moved the resize up. This fails gracefully in the above case.

Differential Revision: D94148443

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 24, 2026

🔗 Helpful Links

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

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:

✅ You can merge normally! (2 Unrelated Failures)

As of commit 3b7281d with merge base 321c029 (image):

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

meta-codesync Bot commented Feb 24, 2026

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

GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Feb 24, 2026
…ch#17661)

Summary:

ET's XNNPACK delegate currently resizes output tensors after running the XNNPACK subgraph. This is normally fine, as the buffer is large enough. However, if there is a logic bug or corrupt model file, the current code doesn't catch if XNNPACK's output is larger than the planned buffer until after execution, where it may crash.

To fix this, I've moved the resize up. This fails gracefully in the above case.

Differential Revision: D94148443
GregoryComer added a commit to GregoryComer/executorch that referenced this pull request Feb 25, 2026
…ch#17661)

Summary:

ET's XNNPACK delegate currently resizes output tensors after running the XNNPACK subgraph. This is normally fine, as the buffer is large enough. However, if there is a logic bug or corrupt model file, the current code doesn't catch if XNNPACK's output is larger than the planned buffer until after execution, where it may crash.

To fix this, I've moved the resize up. This fails gracefully in the above case.

Differential Revision: D94148443
@github-actions
Copy link
Copy Markdown

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions Bot added the Stale PRs inactive for over 60 days label Apr 28, 2026
@GregoryComer GregoryComer removed the Stale PRs inactive for over 60 days label Apr 28, 2026
…ch#17661)

Summary:

ET's XNNPACK delegate currently resizes output tensors after running the XNNPACK subgraph. This is normally fine, as the buffer is large enough. However, if there is a logic bug or corrupt model file, the current code doesn't catch if XNNPACK's output is larger than the planned buffer until after execution, where it may crash.

To fix this, I've moved the resize up. This fails gracefully in the above case.

Differential Revision: D94148443
@GregoryComer GregoryComer added the release notes: none Do not include this in the release notes label Apr 28, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 28, 2026

@GregoryComer has imported this pull request. If you are a Meta employee, you can view this in D94148443.

@GregoryComer GregoryComer merged commit d767516 into pytorch:main Apr 29, 2026
180 of 182 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