Add input size validation to Module.execute#10701
Merged
shoumikhin merged 4 commits intopytorch:mainfrom May 19, 2025
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10701
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit bb83697 with merge base d069d65 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following job 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. |
Contributor
Author
|
@pytorchbot label "topic: not user facing" |
Contributor
Author
|
@pytorchbot label "release notes: none" |
shoumikhin
approved these changes
May 16, 2025
Contributor
Author
|
Hi @shoumikhin, the CI failures are unrelated to this PR; they're due to |
hinriksnaer
pushed a commit
to hinriksnaer/executorch
that referenced
this pull request
May 19, 2025
### Summary Adds input size validation to `Module.execute` to prevent possible silent memory corruption when too many EValue inputs are passed. Fixes pytorch#10510 ### Test plan - Added unit test `TestExecuteWithTooManyInputs` - Verified by successfully running all `module_test.cpp` tests, except `TestPTD` (did not have access to `ModuleLinear.ptd`) - To run locally: - Bypass `is_fbcode` guard in `targets.bzl` and redirect test file paths to use a locally exported `ModuleAdd.pte` file - Build and run tests via: ``` buck2 build //extension/module/test:test buck2 run //extension/module/test:test --------- Co-authored-by: Anthony Shoumikhin <anthony@shoumikh.in>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds input size validation to
Module.executeto prevent possible silent memory corruption when too many EValue inputs are passed.Fixes #10510
Test plan
Added unit test
TestExecuteWithTooManyInputsVerified by successfully running all
module_test.cpptests, exceptTestPTD(did not have access toModuleLinear.ptd)To run locally:
is_fbcodeguard intargets.bzland redirect test file paths to use a locally exportedModuleAdd.ptefile