[KV Cache] Zero compressed attention storage pages - #373
Merged
yangzhuxinyzx merged 1 commit intoAug 28, 2026
Merged
yangzhuxinyzx merged 1 commit into
yangzhuxinyzx merged 1 commit into
Conversation
Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
yangzhuxinyzx
marked this pull request as ready for review
August 28, 2026 03:44
Contributor
|
审计通过:压缩注意力零页逻辑按物理 storage_block_size 解析,普通页行为保持不变;锁定提交在最新 main 的隔离 worktree 上通过 13 项定向测试(含 V100 CUDA 实页清零),完整 pre-commit 与 DCO 通过。按锁定 SHA 合并。 |
This was referenced Aug 28, 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.
Summary
storage_block_sizeProblem
Compressed attention exposes a logical scheduler block that is larger than its
physical cache page. For example, Qwen3.8 Flash Next uses a logical block size
of 784 and a compression ratio of 8, so its compressed QSA cache stores 98 rows
per physical page.
KVBlockZeroerpreviously formed its virtual-page ratio from the logical blocksize and the group's kernel block size. For a compressed cache this multiplied
the physical span by the compression ratio again, so a reused block could clear
the wrong physical range instead of exactly one compressed storage page.
Fix
Resolve the physical kernel block size and virtual-page ratio from the cache
spec before deriving segment spans:
storage_block_sizeas one physical page with ratio 1Validation
3 passed, 1 skippedfor the focused controller test selection (CUDA test skipped there)(16, 49)(98, 1)4 GiB/GPU KV-cache initialization, PIECEWISE+FULL CUDA Graph capture, and
1K/4K generation with the equivalent patch before rebasing onto current main