Repository navigation
[TRTLLM-17229][fix] Resolve the KV-head count of mixed-precision high layers in disaggregated transfer - #21597
Conversation
… layers in disaggregated transfer The per-view transfer layout resolves a KV-head count for every internal layer id. A mixed-precision high layer has an id beyond the manager's per-layer head list and no entry in the DeepSeek-V4 virtual layer mapping, so building the page table of a mixed-precision KV cache manager raised. The high layer now takes the head count of the layer it belongs to, read from the manager's mixed_precision_high_layers record. The extractor test models the high layers through that record and the manager's declared global layer ids instead of the earlier virtual-layer encoding. Signed-off-by: Tianrui 'Hudayday' Hu <32944717+Hudayday@users.noreply.github.com>
|
/bot run --disable-fail-fast |
|
PR_Github #82398 [ run ] triggered by Bot. Commit: |
|
No actionable comments were generated in the recent review. Walkthrough
ChangesKV Head Resolution
Context-First BF16 Eligibility
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk:
|
chuangz0
left a comment
There was a problem hiding this comment.
context_first_profile.py:116 still reads manager.low_precision_dtype, which #21021 renamed to mixed_precision_low_dtype. With TRTLLM_ENABLE_KV_TRANSFER_LIFECYCLE_ENFORCEMENT=1 and a BF16 KV cache, every rank now fails transceiver init with an AttributeError, and test_context_first_profile.py::test_context_first_profile_accepts_symmetric_tp (CPU) hits the same error on main.
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
… context-first profile NVIDIA#21021 renamed KVCacheManagerV2.low_precision_dtype to mixed_precision_low_dtype after NVIDIA#21272 added this read. Every BF16 V2 manager reaches it, so the context-first eligibility check raised AttributeError on main. Signed-off-by: tianruih <tianruih@nvidia.com>
…s own methods The extractor test installs the manager's global layer ids and view partition instead of a stub, keeps both high layers in one group as the manager appends them, and checks each one against the layer it belongs to. The head lookup states its three cases as if/elif/else. Signed-off-by: tianruih <tianruih@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #82443 [ run ] triggered by Bot. Commit: |
|
PR_Github #82398 [ run ] completed with state |
…tests that fail on main Both fail on main in B300's pre-merge stage: the disaggregated page table (NVIDIA#20709) cannot resolve the KV-head count of a mixed-precision high layer. Main waives the second on DGX_B200 only (nvbugs/7043616); Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com> NVIDIA#21597 fixes the extractor. Drop these lines when it lands.
|
PR_Github #82443 [ run ] completed with state
|
…tests that fail on main Both fail on main in B300's pre-merge stage: the disaggregated page table (NVIDIA#20709) cannot resolve the KV-head count of a mixed-precision high layer. Main waives the second on DGX_B200 only (nvbugs/7043616), and PR NVIDIA#21597 fixes the extractor. Drop these lines when it lands. Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com>
|
/bot run --disable-fail-fast |
|
PR_Github #82653 [ run ] triggered by Bot. Commit: |
…st that fails on main test_deepseek_v4_mixed_disagg_names_every_layer fails on main in B300's pre-merge stage: the disaggregated page table (NVIDIA#20709) cannot resolve the KV-head count of a mixed-precision high layer. Main waives it on DGX_B200 only, and waives the other test with this cause on B300 (nvbugs/7044232). PR NVIDIA#21597 fixes the extractor; drop this line when it lands. Signed-off-by: Kaiyu Xie <26294424+kaiyux@users.noreply.github.com>
|
PR_Github #82653 [ run ] completed with state
|
|
/bot run |
|
PR_Github #82827 [ run ] triggered by Bot. Commit: |
|
PR_Github #82827 [ run ] completed with state |
…gregated directory The CPU-Generic stages skip the whole `unittest/disaggregated` entry through waives.txt (https://nvbugs/7042835, a main break in test_context_first_profile.py and test_lifecycle_activation.py that NVIDIA#21597 fixes). This PR removed the A10 file-level entries for ten disaggregated files it marked cpu_only, so until the waive goes those files ran nowhere. Waives match the wrapper's nodeid exactly, so per-file entries are collected and run; the ten files passed on both x86 and aarch64 in the TRTLLM-15162 gate at the same base. Signed-off-by: Kanghwan Jang <861393+karljang@users.noreply.github.com>
Round-4 multi-GPU CI failed [DGX_H100-4_GPUs-PyTorch-Others-1] on 'KVCacheManagerV2' object has no attribute 'low_precision_dtype'. That regression window came from main (db98553 introduced it, 7d7b098 of NVIDIA#21597 fixed it) and hit every PR in the window; it has no overlap with this PR's files. Update the base instead of carrying an out-of-scope fix. Signed-off-by: Jonas Li <6110159+longlee0622@users.noreply.github.com>
Brings the branch up to date with main. main removed the waive of unittest/disaggregated (NVIDIA#21810) after NVIDIA#21597 fixed those tests, so the pre-merge CPU stage now runs the tests in tests/unittest/disaggregated, including the ones this branch adds. No conflicts. Signed-off-by: berryz <berryz@nvidia.com>
Description
#20709 (per-view KV head transfer) made the disaggregated page-table builder resolve a KV-head count for every internal cache layer, either as an index into the manager's per-layer head list or through the DeepSeek-V4 virtual layer mapping.
However, #21021 (mixed-precision KV cache for speculative decoding and the sparse MLA backends) merged after it and records its mixed-precision high layers in the manager's
mixed_precision_high_layersrecord instead of a virtual layer mapping, so building the page table of a mixed-precision KV cache manager raises (Cannot resolve KV-head count for internal layer ...). Each PR passed CI on its own; main failstest_disagg_exports_both_pools_and_pairs_sink_tailandtest_deepseek_v4_mixed_disagg_names_every_layersince #21021 merged.The builder now takes a mixed-precision high layer's head count from the layer it belongs to, read from that record. Other layers resolve as before; no manager change.
Test Coverage
tests/unittest/_torch/pyexecutor/kv_cache/test_mixed_precision_kv_cache.py::test_disagg_exports_both_pools_and_pairs_sink_tailand::test_deepseek_v4_mixed_disagg_names_every_layerpass again (B200).tests/unittest/disaggregated/test_extractor.py::test_v2_builder_resolves_mixed_precision_high_layer_heads(CPU) replaces the test that modelled the high layers through the earlier virtual-layer encoding; it builds the page table from a manager stand-in with themixed_precision_high_layersrecord, with and without a virtual layer mapping of the manager's own layers.Dev Engineer Review
_build_page_table_v2now resolves mixed-precision high-layer head counts from their associated local layers before using virtual-layer mapping. Other layer-resolution paths remain unchanged. The context-first BF16 check now usesmixed_precision_low_dtype, matching the renamed manager field. No public declarations change.QA Engineer Review
test_extractor.pyadds parameterized coverage for mixed-precision high-layer resolution with and without virtual-layer mapping. It checks layer IDs, pool views, and head counts. The file is listed in the A10 and H100 CI test lists. The context-first profile test updates the NVFP4 case to usemixed_precision_low_dtype; it was not found in the inspected test lists. Coverage verdict: sufficient for the reported resolution scenarios. The author reports two B200 tests pass, but those results were not independently verified.Per-File QA Perspective
tensorrt_llm/_torch/disaggregation/resource/kv_extractor.py: Verify that mixed-precision high layers use the head count of their associated local layer, including when virtual-layer metadata exists. Verify that other layers preserve their prior resolution behavior.tests/unittest/disaggregated/test_extractor.py: The parameterized test covers high-layer resolution with and without virtual-layer mapping. The file is listed in the A10 and H100 CI test lists.tensorrt_llm/_torch/disaggregation/native/context_first_profile.py: Verify that context-first BF16 eligibility readsmixed_precision_low_dtypeand preserves the other eligibility conditions.tests/unittest/disaggregated/test_context_first_profile.py: The NVFP4 rejection test now setsmixed_precision_low_dtype. It was not found in the inspected CI or manual-QA test lists.