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.
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.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24572
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 0ef7a34 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.
LLM runner: validate and drive hf_static float-cache programs
The runner's logical position could reset while HF cache counters stayed stale, corrupting the next generation. This IOManager writes every counter from
start_posbefore a step, validates the version-1 metadata and all method buffer shapes / dtypes, and drives the fixedprefill/decodemethods through shared float-cache buffers.Window masks identify real rows and exclude padding. A prompt tail that fits the context but not a padded prefill call is routed through decode before any execution. Logits are read at
3 * n_layers; the mutation prefix is opaque. Real HF programs can also return ordered state again after logits. Each unplanned suffix output is bound to its existing cache / counter buffer, preventing the null-output crash without allocating another cache.Review order: the version-1 contract documented in the following docs PR,
hf_static_io_manager.h/.cppvalidation and state handling, each IOManager's own registration, build wiring, then the tiny float32 / float16 / HF-style repeated-state fixtures and C++ regressions. This is PR 7 of the Stack 2 series. Its local parent isstack2/pr06-hf-static-export; its GitHub base ismain, with earlier stack commits included. Quantized caches,shaand full-length sliding mode are excluded.Test Plan
The isolated runtime implementation passes:
The assembled final top was rebuilt from source and rerun with the same225/223/2 counts; no stale executable is counted.
Forty-two float-only v1 fixtures generated with
run_reinplace_pass=True, without #23563, pass 77 / 77 HfStatic gtests with no skips. Original runtime against the new fixture corpus gives 41 expected failures, including stale counters, generate-reset-generate, metadata mismatches, equal-byte different shapes / dtypes, malformed mask / positions and context-tail handling. Additional output-boundary probes capture the before-fix repeated-state rejection / unbound-counter segfault and after-fix generation, reset and existing-buffer alias checks.No #23563 memory-planning cherry-pick is carried; it is listed as related dependency work, with clean-base fixture evidence above. No device lease or sliding-window device latency run was done. CPU correctness is not a claim of device support beyond context 512.
Stack (review in order)
Each PR includes the commits of the ones above it; review only its own top commits.