Skip to content

Add null runtime check for XNNExecutor::prepare_args #9265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2025

Conversation

zhenyan-zhang-meta
Copy link
Contributor

Summary

Fixes #9131

In the event that an XNNPACK-delegated model is freed right when inference happens, XNNExecutor::prepare_args can crash accessing the runtime. Hence we need to check for null runtime for it, similar to what we are already doing for XNNExecutor::forward.

Test plan

Pass all CI/CD.

Copy link

pytorch-bot bot commented Mar 14, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 2d2928b with merge base 2bee76e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-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 Mar 14, 2025
@zhenyan-zhang-meta
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@mergennachin mergennachin self-requested a review March 14, 2025 18:40
@mergennachin
Copy link
Contributor

Can you write a test to exercise this code path?

@GregoryComer
Copy link
Member

I'm going to merge this as is, since it's a small change, and existing CI should be sufficient.

@GregoryComer GregoryComer merged commit b8a0edd into pytorch:main Mar 18, 2025
5 checks passed
DannyYuyang-quic pushed a commit to CodeLinaro/executorch that referenced this pull request Apr 2, 2025
### Summary
Fixes pytorch#9131

In the event that an XNNPACK-delegated model is freed right when
inference happens, `XNNExecutor::prepare_args` can crash accessing the
runtime. Hence we need to check for null runtime for it, similar to what
we are already doing for `XNNExecutor::forward`.

### Test plan
Pass all CI/CD.
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XNNExecutor::prepare_args should check for null runtime
4 participants