Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24569
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated Failure, 1 Unclassified FailureAs of commit 1a30de6 with merge base 765e973 ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
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. |
This PR needs a
|
winskuo-quic
left a comment
There was a problem hiding this comment.
Hi @psiddh,
Thanks for the PR.
My understanding of this PR is that it is designed for shared buffer(zero-copy) where KV cache is IO instead of mutable buffer, so can I assume the mutable buffer KV Cache won't be supported in this case?
Another question is:
If I want to fallback last index_copy node to cpu, which is the node that updates new_kv_cache to past_kv_cache, will the current flow be able to handle this situation?
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.
df791aa to
1a30de6
Compare
|
Thanks. The version you reviewed was out of date. This PR is now just
|
QNN: construct partitioners from options and allocate LLM I/O in rpcmem
QnnPartitioner.from_options()routes an exporter's option dictionary to the partitioner or compiler-spec builder and rejects unknown names. The rpcmem allocator registers through the generic hook from PR 3, keeping LLM runner code independent of QNN. It forwards alignment, allocation, binding and free; a null allocation permits heap fallback.Review option routing,
llm/io_buffer_allocator.cpp, build/llama link wiring, then tests. Delegate output ordering remains separate in PR 5 for Qualcomm review.Files
Test Plan
Commit
cc176faabd2541fa8aa4a86aa05ce9c56b102b0don892e50425f5a3e90ff8d3c8802fdfb31f8599518. Validated locally with Python 3.12, pinned Torch/TorchAO, the local transformers exporter branch and QAIRT SDK 2.48.Real QNN backend builds; 2 allocator host tests passed; 0 skips/failures.
No device/physical rpcmem, two-target FCB, real-model export or full QNN device-suite result is claimed. Buck could not start because the local launcher requires a missing
.buck2. The base already contains #23563 and #23183; neither is a separate prerequisite commit here.Related PRs (review in order)
Each PR includes the commits of the ones above it; review only its own top commit.