PR1: per-layer KV storage (mixed-precision layer tables) - #1
Open
Astrangemaninhere wants to merge 8 commits into
Open
PR1: per-layer KV storage (mixed-precision layer tables)#1Astrangemaninhere wants to merge 8 commits into
Astrangemaninhere wants to merge 8 commits into
Conversation
added 8 commits
August 30, 2026 19:10
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.
PR1: per-layer KV storage (mixed-precision layer tables)
Background
The KV cache previously used a single global storage format for every layer. Attention layers differ sharply in how much quantization error they tolerate, so a uniform format either wastes memory on robust layers (all-INT8) or degrades quality on sensitive ones (all-NVFP4). This PR makes the storage format a per-layer decision.
Changes
--kv-layer-storageor the variant default table.quant_groupis resolved into layer views.layer_kv_dtypesis copied into the sequence candidate so the table actually reaches the cache (previously never applied).Files
src/targets/qwen3_6/impl/state/decoder_state.cpp(plane geometry, per-layer views)src/targets/qwen3_6/impl/runtime/layouts_impl.h(candidate propagation)src/core/paged_kv_cache.h(layer views carry dtype/group/plane base)Dependency
Foundation for PR2 (cold pool), PR5 (YaRN), and PR6 (NVFP4 tier). Merge first.