Repository navigation
Conversation
The ggml engine's off-graph cache held one sequence, so a batching runtime could not put several sessions in one forward, clone a prefix, or share a pool between sessions. GgmlCellCache is the neutral CellCache over a GgmlKvPool whose rows are its cells, registered for kind::kBatched and kind::kBatchedCell; it offers BatchControl to the control plane. A context accepts either cache. With a cell cache, the executor places the forward's tokens at their positions before building the graph (the control plane declared their sequences), grows storage to the step's read extent, and fills each window's cache rows and mask from the cache's step: rows are the step's cells, and the mask keeps each query to its own sequence's earlier cells within its window. A windowed layer keeps every cell, so a rewind or clone never needs history the cache dropped. A forward that fails after placement leaves its cells claimed, as a failed MLX forward does.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25007
Note: Links to docs will display an error until the docs builds have been completed. ❌ 136 New Failures, 7 Unrelated Failures, 10 Unclassified FailuresAs of commit 3fbeb45 with merge base c7f7931 ( NEW FAILURES - The following jobs have 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:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Nov 13, 2026
This was referenced Nov 13, 2026
This branch had an error being 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
Off-graph KV cache for the native ggml engine, through serving Muse Glimmer on it. Review bottom-up; each PR builds and passes its tests on its own.
Summary
The ggml engine's off-graph cache held one sequence, so a batching runtime couldn't put several sessions in one forward, clone a prefix, or share a pool between sessions.
GgmlCellCacheis the neutralCellCacheover aGgmlKvPoolwhose rows are its cells, registered forkind::kBatchedandkind::kBatchedCell. It offersBatchControlto the control plane.llm_cache_registry_key. With a cell cache, the executor:Test plan
New engine tests against a multi-sequence reference (naive attention per sequence):
All pass on CPU, and on Metal through a temporary local change. Making the executor ignore the cache's mask fails three of the four.
Authored with Claude Code.