Repository navigation
Gemma 4 on CUDA: prompts in the shared KV store with TF_KV_SHARE (part of #1657) - #1883
Merged
Merged
Conversation
Use the existing prompt_radix adapter behind TF_KV_SHARE for global cache pages and pool-owned sliding-ring snapshots. Preserve the original path when the switch is unset, keep the prompt grid, and bind MTP reads to the target page table after discarding captures of relocated cache addresses. Cover resumed and concurrent cache equality, MTP cache bindings, forced snapshot eviction, cancellation and allocation accounting with host regressions and planted faults. Checkpoint token fidelity remains a device gate. Image reuse, DFlash and shared cache owners are excluded in this mode. Refs #1657
ashhart
force-pushed
the
lead/gemma4-kv-share
branch
from
November 2, 2026 02:45
139cf15 to
5e11393
Compare
This was referenced Nov 2, 2026
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.
Part of #1657.
Gemma 4 on CUDA uses the off-by-default
TF_KV_SHAREadapter that Spark 2.5 uses (#1756): global layers' prompts are the KV pool's pages in the shared prompt store, sliding-window tails are kept per stream in order, and the MTP assistant's pages are bound to its cache, with graphs invalidated when they move. Unset, nothing changes.Host: 59 cache-oracle tests pass; three planted production-source controls fail as intended. On a GB10 with Gemma 4 31B (4-bit), against main: GREEN, 56 cells within +/-0.5%, prompt tokens identical, 64K recall the same. An independent review found the unset path identical and no page reused for the wrong stream or position.