[II] Define per-cache DCP block-table geometry - #418
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change makes ChangesMamba DCP sharding
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change corrects recurrent cache block-table sizing under DCP and includes targeted regression and end-to-end validation; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Define token-position DCP shard count on each cache specification and use max_num_blocks_per_req as the worker block-table width contract. Attention caches retain full, partial, or replicated DCP layouts; recurrent caches report one token-position shard and preserve their mode-specific table width. This removes the model runner's cache-type special case while retaining the 1,310-column Mamba align table required by a 1,000,000-token model length with 768-token blocks and seven speculative blocks. Assisted-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Martin Vit <martin@voipmonitor.org>
6b18a8a to
4f34748
Compare
Behavior
Each KV-cache specification defines the number of token-position shards it
stores under decode context parallelism and the block-table width required by
its runtime manager. The GPU model runner consumes those interfaces instead of
reimplementing cache-type rules.
Attention caches preserve the configured full, partial, or replicated DCP
layout. Recurrent caches such as
MambaSpecreport one token-position shard;tensor parallelism may still partition their feature dimensions.
Technical reason
Recurrent state is indexed by global sequence position but is not partitioned
by token position across DCP ranks. Applying the configured DCP size to its
block-table width underallocates addressable columns. With
max_model_len=1,000,000, recurrentblock_size=768, seven speculativeblocks, and DCP16, align mode requires 1,310 columns. A DCP-scaled table cannot
address the first recurrent-state checkpoint boundary after 63,744 tokens.
The cache-spec interface is also the single source of truth for replicated and
partially sharded attention groups supported by Infernal Invocation.
Compatibility
dcp_replicated=Truegroups retain DCP1 token-position geometry.dcp_kv_shard_countretains explicit partial-shard geometry.block-table storage per rank.
Validation
Ruff, formatting, mypy, SPDX, forbidden-import, and configuration checks.
attention, Mamba state, aggregate cache specs, and the 1,310-column
regression.
allocation steps; all non-null physical blocks have one owner and 17 of 499
pages remain free.
voipmonitor/vllm@sha256:acdfb8460672c730c4df470a81eb86ca83995390e7f74360615dacc1e5ca2fb3passes TP16/DCP16 full-model qualification with the official Kimi-K3 MXFP4
target. Target-only decode is 55.719 tok/s, DSpark target execution is 31.416
cycles/s, and DFlash target execution is 29.160 cycles/s. The corresponding
immutable-control differences are +0.05%, -0.005%, and -0.12%.
3,538 tok/s. A 500,224-token DFlash request returns HTTP 200 with all captured
log probabilities finite.
The complete source lock and machine-readable receipts are recorded in
the Kimi-K3 runtime specification.
Official vLLM relationship
Official vLLM already encodes the recurrent-state invariant through
MambaSpec.max_num_blocks_per_req. The broader official-vLLM implementationmust additionally carry per-group cache topology through allocation,
scheduling, block tables, slot mapping, and DFlash metadata because upstream
does not have Infernal Invocation's shared shard-count helper.
The prepared official-vLLM branch is
fix/dcp-cache-topology-contract-20260821.It differs from open vLLM PR vllm-project#48392 by fully replicating draft token positions
and running draft attention locally, rather than replicating KV heads while
retaining DCP-sharded positions and DCP attention collectives.