Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23366
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Pending, 4 Unclassified FailuresAs of commit d0b6945 with merge base c16dd0a ( 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
|
This was referenced Oct 2, 2026
This branch was successfully 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.
Stack from ghstack (oldest at bottom):
Adds a second layout to LowerOffGraphKVPass for batching many sequences over
one forward, the CUDA counterpart of MLX's batched-cell cache.
A manifest with
"layout": "cell"(andmax_cells) lowers everykvcache::update_and_attend to:
max_cellsrows. A window onlyselects which mask the layer reads.
cells([max_write]int64),read_len([1]) and onemask_w{window}([1, 1, max_write, max_cells]bool) per distinct windoware runtime-bound constants, declared once per program at a fixed shape. The
runtime cache writes them before each forward, so a captured CUDA graph keeps
their addresses and serves any mix of sequences without recapture. Unlike
the pools they are small, so they carry zero bytes at compile time (Inductor
reads small constants while compiling); like the pools they are never
serialized.
explicit, and
read_lenbounds the sweep so stale columns past it are neverread.
The sequence layout is unchanged and stays the default.
Compiling these buffers needs two Inductor options while a cell-layout method
compiles:
joint_graph_constant_foldingoff: the buffers are constants the graph onlyreads, so Inductor would fold slices of them at compile time, reading storage
that does not exist yet and baking the result in.
always_keep_tensor_constantson:read_lenis small enough that Inductorwould otherwise inline it as a literal.
The batching executor sends one-token steps to a static
decodemethod andwider ones to a
prefillmethod dynamic from two tokens. A spike confirmedAOTI compiles triton::sdpa with a symbolic query length starting at 2 (the
2..4 small-query split-K branch included) and matches eager SDPA for T=2..64,
so no sdpa change is needed.
Differential Revision: D123051478