Repository navigation
Conversation
Backend passes keep a reference to the ExportedProgram they were built from (XNNPACKPass.exported_program, for one), while ExportedProgramPassManager runs them on a shallow copy of it and rebuilds the signature of that copy afterwards. delete_constant_placeholder replaced the original program's signature object, so the copy kept the old one and its verifier failed with Parameter <name> is not in the state dict. create_constant_placeholder already inserts into the shared input_specs list in place; do the same for deletion. Tests cover a deletion made inside a pass run through the manager for every constant placeholder kind. Authored with Claude Code.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24111
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 Unclassified FailuresAs of commit 6789b71 with merge base 422cc39 ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
borys3kk
marked this pull request as ready for review
October 26, 2026 14:22
This branch has not been deployed
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
Backend passes keep a reference to the
ExportedProgramthey were built from (XNNPACKPass.exported_program, for one), whileExportedProgramPassManagerruns them on a shallow copy of it and rebuilds that copy's signature afterwards.delete_constant_placeholderreplaced the original program's signature object, so the copy kept the old one, still listing the deleted placeholder, and its verifier failed with:create_constant_placeholderalready inserts into the sharedinput_specslist in place; deletion now removes from that list in place too.Test plan
New tests in
backends/transforms/test/test_create_delete_constant_placeholder.pydelete a placeholder from inside a pass run throughExportedProgramPassManager, one per kind: parameter, persistent buffer, non-persistent buffer and lifted constant tensor.Without the fix, the 4 new tests fail (
SpecViolationErrorfor parameter, buffer and constant tensor,KeyErrorfor the non-persistent buffer) and the 6 existing ones pass. With the fix, all 10 pass.325 passed, 50 skipped, 1 xfailed; and 5 passed. I could not run the Arm pass tests that call
delete_constant_placeholderbecause they needtosa_serializer.cc @GregoryComer @digantdesai @cbilgin @JakeStevens @cccclai @nil-is-all @rascani @msluszniak