Repository navigation
Conversation
Run each partitioner’s edge transforms after caller-supplied passes so backends can use the standard lowering entry point. QNN contributes its existing transforms through the new hook.
Reserve names for constant tensors already present in the exported program before lifting new constants, so methods with folded tables retain distinct constants.
Choose the registered IOManager and its logits, method names and step sizes, rejecting unknown contracts and invalid metadata. Load and reset the selected methods; route prompt tails to decode with a side-effect-free capacity check. Preserve module and I/O-buffer lifetimes and expose a backend-neutral allocator hook.
Route backend options through QnnPartitioner.from_options and register an allocator that supplies QNN shared-memory buffers through the generic IOManager hook. The LLM runner remains backend-neutral.
Encode graph output positions and restore their order at both runtime tensor-allocation entry points. Preserve context-binary order and legacy mutable outputs, and ignore malformed or overflowing position labels without throwing. This runtime change needs Qualcomm review.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24570
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 109bacd with merge base 5f72739 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Nov 3, 2026
This PR needs a
|
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.
QNN: bind delegate outputs in exported-program order
QNN preprocessing can build the operations that produce outputs in a different order from the exported graph. Equal-shaped K/V outputs can then bind to the wrong values without a shape error. Encode each ordinary graph output position in its tensor name and restore that order in both runtime allocation paths.
Mutable-buffer / legacy names retain their relative order. Context binaries imported from outside ExecuTorch keep their original order. Malformed and oversized output IDs are treated as legacy names rather than throwing from integer parsing.
Review order: output numbering in
builders/utils.pyandnode_visitor.py, the shared runtime comparator and its two allocation call sites, then Python naming and host-linked runtime tests. This delegate-wide change is deliberately a separate PR for Qualcomm review. It is PR 5 of the Stack 2 series. Its local parent isstack2/pr04-qnn-options-allocator; its GitHub base ismain, with earlier stack commits included.Test Plan
On this PR's source tree:
Eight Python cases exercise actual output names / wrappers; five C++ cases link the rebuilt real QnnManager and check distinct values in same-shaped buffers, numerical ordering, equal-ID stability, legacy / mutable names, context-binary bypass and malformed IDs. The other tests cover the preceding PR's option routing / allocator.
Before the original numbering change, seven of eight new Python cases fail. Against the original runtime, four of five new C++ cases fail: equal-shaped values are reversed, the DLC allocation path does not sort, and oversized IDs throw. All cases pass after this fix. A full host
backends/qualcomm/scripts/build.sh --skip_linux_android --job_number 8 --no_cleanbuild also rebuilt QnnManager, the adaptor / backend, examples and llama_main.Not run: full QNN device suite or actual context-retrieval execution. Qualcomm hardware review is still needed before merge. Buck parity is blocked by a missing worktree
.buck2; local host tests are not a Buck-green or device-support claim.Stack (review in order)
Each PR includes the commits of the ones above it; review only its own top commits.