Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24573
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated Failure, 2 Unclassified FailuresAs of commit d24a6af with merge base 765e973 ( NEW FAILURE - The following job has failed:
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:
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
|
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.
Move backend-neutral static-cache rewriting into the LLM extension and keep QNN partitioning and tuning in the backend. Detect sliding layers from model configuration, keep cache writes in place with standard reinplace, and register a versioned runner that handles fixed chunks, padding, counters and reset. Quantized caches, sha attention and full-length sliding mode are excluded.
Use authoritative positions, float-cache version and dtype checks, exact buffer geometry and selected methods. Bind optional HF state outputs to existing buffers, preserve input aliases and register each concrete IOManager from its own implementation. Float-only fixtures cover reset, padding, malformed metadata and near-context tails.
Define fixed methods, cache metadata, padding, absolute counters and state-output bindings, and link the contract from the Qualcomm guide. State float-cache support and CPU-tested sliding correctness without claiming unmeasured device performance or a zero-copy Python host API.
6a85ef6 to
d24a6af
Compare
Document the version-1 hf_static I/O contract
Document HF's per-step tensor interface separately from the fixed-shape adaptation: token IDs, masks, positions and full K/V caches in; logits and those caches updated in place out. Fixed prefill/decode methods and the padding/counter protocol replace variable-length forward because HTP needs static shapes.
The contract covers metadata, absolute counters, optional returned state and runner responsibilities. The Qualcomm guide describes only hf_static and uses its dedicated CLI, with no contract selector. It preserves float-cache, guarded local-transformers-hook and CPU-only sliding-evidence boundaries. No zero-copy Python host API or measured device performance is claimed.
Review the contract, Qualcomm guide and toctree. Documentation-only. Quantized caches, sha and full-length sliding mode are excluded; inspection, adopt/fork/evict hooks remain follow-ups.
Files
Test Plan
Commit
bee5bb8fbcc1d03999046db7854d5a60af826086on892e50425f5a3e90ff8d3c8802fdfb31f8599518. Validated locally with Python 3.12, pinned Torch/TorchAO, the local transformers exporter branch and QAIRT SDK 2.48.223 runner + 7 QNN host tests passed; 2 existing runner skips; 0 failures.
cmake --build /data/users/sidart/qnnflow/gh_prs/build-split-native-top-final -j4 --target test_runner ctest --test-dir /data/users/sidart/qnnflow/gh_prs/build-split-native-top-final -R "^test_runner$" --output-on-failure -VThe two existing runner skips are
TextDecoderRunnerTest.LoadUsesMethodNameandStepWithAllModels.Pinned lint: 25 Python files clean under ufmt/flake8; 19 C++ files clean under clang-format 18.1.3; whitespace checks pass. Focused Sphinx/MyST HTML build with -W: 2 pages, no warnings. All series-owned final files and added lines have an empty forbidden-pattern grep. Independent source review found no blocking issues.
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.