Repository navigation
[TRTLLM-16722][feat] Dflash Unified KVCache - #20486
Conversation
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Separate NVFP4 data and block scales from other equal-size buffers while keeping shared lifecycle slot allocation. Preserve matching role order and require matching scale roles. Add one regression test for mixed NVFP4 and BF16 storage, checking scale addresses at slot 1 and the final slot. Signed-off-by: Allison Lim <[email protected]>
Read the data-only view of three-dimensional pointer tables for non-FP4 layers while preserving NVFP4 scale handling and legacy two-dimensional tables. Add one native-binding regression covering mixed BF16/NVFP4 pointer tables and legacy BF16 tables. Signed-off-by: Allison Lim <[email protected]>
Signed-off-by: Allison Lim <[email protected]>
Preserve explicit and legacy layer configuration while applying upstream pool rebalancing settings to both paths. Signed-off-by: Allison Lim <[email protected]>
|
/bot run --disable-fail-fast |
|
PR_Github #82037 [ run ] triggered by Bot. Commit: |
|
PR_Github #82039 [ run ] triggered by Bot. Commit: |
|
PR_Github #82037 [ run ] completed with state |
|
PR_Github #82039 [ run ] completed with state
|
|
/bot run --reuse-test 67676 --disable-fail-fast |
|
PR_Github #82085 [ run ] triggered by Bot. Commit: |
|
PR_Github #82085 [ run ] completed with state
|
|
/bot run --reuse-test 67722 --disable-fail-fast |
|
PR_Github #82194 [ run ] triggered by Bot. Commit: |
|
PR_Github #82194 [ run ] completed with state |
Signed-off-by: Allison Lim <[email protected]>
|
/bot run --disable-fail-fast |
|
PR_Github #82238 [ run ] triggered by Bot. Commit: |
|
PR_Github #82238 [ run ] completed with state
|
|
/bot run --reuse-test 67868 --disable-fail-fast |
|
PR_Github #82321 [ run ] triggered by Bot. Commit: |
|
PR_Github #82321 [ run ] completed with state |
No tree change: the update only merges main up to 1f08014, already in via NVIDIA#21400. Signed-off-by: Zhenhuan Chen <[email protected]>
Resolve the conflict with NVIDIA#20486 (Dflash Unified KVCache), NVIDIA#21281 and NVIDIA#21367. The unified and paged pools address a reused prefix themselves, so the tracker stays off there; the VANILLA dense arena still starts a prefix hit from the uncached tail. Adapt to the new _assign_slot(..., bases) and _write_ctx_len(updates, bases) API. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Juice <[email protected]>
Merge origin/main ecf1fef (124 commits over 745c1ce). NVIDIA#21399, NVIDIA#21400, NVIDIA#20486 and NVIDIA#20664 are now in main: their files take main's reviewed version with this branch's later commits re-applied (fused FC12 reserved_sms + die_major, DFlash slot base pages + helix shard, DSpark shift_label, prequantized MXFP8 over the whole low-M GEMM range). NVIDIA#21067 and NVIDIA#20535 stay as [DEPS] merges. Schemas and the llm_args golden manifest are merged by hand. Signed-off-by: Zhenhuan Chen <[email protected]>
Signed-off-by: Zhenhuan Chen <[email protected]>
…A#20486 Signed-off-by: Zhenhuan Chen <[email protected]>
No tree change: the update only merges main up to 1f08014, already in via NVIDIA#21400. Signed-off-by: Zhenhuan Chen <[email protected]>
Merge origin/main ecf1fef (124 commits over 745c1ce). NVIDIA#21399, NVIDIA#21400, NVIDIA#20486 and NVIDIA#20664 are now in main: their files take main's reviewed version with this branch's later commits re-applied (fused FC12 reserved_sms + die_major, DFlash slot base pages + helix shard, DSpark shift_label, prequantized MXFP8 over the whole low-M GEMM range). NVIDIA#21067 and NVIDIA#20535 stay as [DEPS] merges. Schemas and the llm_args golden manifest are merged by hand. Signed-off-by: Zhenhuan Chen <[email protected]>
Resolve the conflict with NVIDIA#20486 (Dflash Unified KVCache), NVIDIA#21281 and NVIDIA#21367. The unified and paged pools address a reused prefix themselves, so the tracker stays off there; the VANILLA dense arena still starts a prefix hit from the uncached tail. Adapt to the new _assign_slot(..., bases) and _write_ctx_len(updates, bases) API. Signed-off-by: Juice <[email protected]>
Dev Engineer Review
KvCacheCreatorcan place eligible DFlash target and draft layers in one V2 KV cache manager. The launcher enables this path only when context and generation configurations meet compatibility gates. Check the gates against layer ownership, dtype, and page geometry.QA Engineer Review
New and modified tests cover unified-cache eligibility and launcher configuration, cache-manager layer-spec forwarding, mixed-format block-table indexing, peer compatibility,
RankInfoserialization, and block-table offset decoding. The disaggregated DFlash accuracy test is listed intests/integration/test_lists/test-db/l0_dgx_b200.yml; no matching manual-QA entry was identified. Coverage verdict: needs follow-up. The supplied CI reports do not identify specific failures or confirm successful execution across the changed paths.Per-File QA Perspective
tensorrt_llm/_torch/disaggregation/native/peer.py— Verify that mismatchednum_draft_layersvalues reject registration and matching values allow registration.tensorrt_llm/_torch/disaggregation/native/rank_info.py— Verify draft-layer counts for unified and legacy layouts, including serialization and the default for older payloads.tensorrt_llm/_torch/pyexecutor/_util.py— Verify unified-layout eligibility, target and draft storage specifications, cache-cost estimation, and fallback to separate draft-cache creation.tensorrt_llm/_torch/pyexecutor/scheduler/scheduler_v2.py— The change updates a comment only. Confirm that its description of disaggregated KV transfer matches runtime behavior.tensorrt_llm/_torch/speculative/dflash.py— Verify unified and separate manager binding, slot initialization, block offsets, and errors for unsupported unified layouts.tensorrt_llm/_torch/speculative/interface.py— Verify draft metadata handling when the target manager also provides the draft-cache view.tensorrt_llm/_torch/speculative/utils.py— Verify that the target manager is not returned as a separate draft manager.tensorrt_llm/_torch/speculative/spec_tail_kernels.py— Verify thatblock_offsetis applied before counting and decoding draft block-table entries.tensorrt_llm/commands/serve.py— Verify that shared draft KV is enabled only when context and generation configurations satisfy the compatibility gates.tests/integration/defs/accuracy/references/acceptance_length.yaml— Adds the reference and minimum threshold for the unified DFlash accuracy test. The integration test is listed in the B200 CI test list.tests/integration/defs/accuracy/test_disaggregated_serving.py— AddsTestQwen3_8BDFlash::test_gsm8k_1p1d_unified_draft_kvfor accuracy and acceptance length. The test is listed in the B200 CI test list; no matching manual-QA entry was identified.tests/integration/test_lists/test-db/l0_dgx_b200.yml— Adds the unified DFlash accuracy test to the B200 CI list.tests/unittest/_torch/executor/kv_cache/test_dflash_unified_kv_gate.py— Covers unified-layout eligibility and launcher decisions across configuration cases. No integration test-list entry applies.tests/unittest/_torch/executor/kv_cache/test_kv_cache_estimation.py— Covers forwarding per-layer storage specifications to cache-manager construction. No integration test-list entry applies.tests/unittest/_torch/executor/kv_cache/test_kvcm2_integration.py— Covers DFlash context block-table indices with FP8 target storage and BF16 draft storage. No integration test-list entry applies.tests/unittest/disaggregated/test_peer.py— Covers peer registration with matching and mismatched draft-layer counts. No integration test-list entry applies.tests/unittest/disaggregated/test_rank_info.py— Covers manager-derived and serializedRankInfodraft-layer counts, including older payloads. No integration test-list entry applies.tests/unittest/_torch/speculative/test_spec_tail_kernels.py— Covers block-table decoding with zero and nonzero offsets. No integration test-list entry applies.tests/unittest/_torch/executor/kv_cache/test_kv_cache_budget_split.py— Sets the DFlash mode mock explicitly in the target-cost test. No integration test-list entry applies.tests/unittest/_torch/speculative/hw_agnostic/test_dflash_copy_skip.py— Updates the slot-assignment stub and comment used by copy tests. No integration test-list entry applies.Description
Follow-up to #20178. Integrate DFlash with the unified key-value cache manager so target and draft layers share one manager while retaining their respective cache data types.
Test Coverage
The following 24 comparisons cover tensor parallel configurations, CUDA graphs, overlap scheduling, attention data parallelism, and mixed cache precision.
All result columns report AL. Measurements come from the generation server’s
/metrics, except the attention data parallelism comparisons, which use per-request statistics from a concurrent client. Both configuration columns show tensor parallel sizes; the disaggregated configuration lists prefill → decode.The mixed cache precision runs use the following configuration. Here, bfloat16 denotes the 16-bit brain floating-point format.
Only the target cache uses 8-bit floating point; target weights and activations remain bfloat16. Runtime logs confirm the intended target and draft cache types on every rank, with the drafter using the shared bfloat16 pool and no fallback to its private cache. Transfer unit coverage verifies that draft pages use two-byte elements even when the servers advertise the target cache’s one-byte element size.
Results:
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.