Skip to content

[TRTLLM-15264][test] Kimi K3 disagg review fixups: KDA test geometry, gate docs, example cleanup - #17483

Open
brnguyen2 wants to merge 6 commits into
NVIDIA:mainfrom
brnguyen2:k3/15264-review-bundle
Open

[TRTLLM-15264][test] Kimi K3 disagg review fixups: KDA test geometry, gate docs, example cleanup#17483
brnguyen2 wants to merge 6 commits into
NVIDIA:mainfrom
brnguyen2:k3/15264-review-bundle

Conversation

@brnguyen2

@brnguyen2 brnguyen2 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Follow-ups from review of the Kimi K3 disaggregated-serving work, bundled into one change:

  • KDA cache-manager test fixture now goes through production config extraction. _create_kda_managers in test_kda_mamba_transfer.py builds its Mamba cache params via extract_mamba_kv_cache_params with unscaled global head counts, letting the manager's own attention-DP gate do the sharding — matching how the model runtime head-shards KDA state across TP when attention-DP is off.
  • Heterogeneous ctx/gen TP is a positive test, not a rejection. Since KDA recurrent state is head-sharded (per-rank bytes x TP is invariant), validate_peer_compatible correctly accepts hetero-TP peers; test_kda_hetero_tp_rejected became test_kda_hetero_tp_sharded_accepted, asserting concrete per-rank slot sizes before acceptance. New transfer parametrizations cover matched TP2 (attention-DP on and off) and hetero 2->4 / 4->2 with bitwise comparison.
  • Stale "replicated KDA state" wording fixed in the peer.py docstring/error text, the K3 disagg example README, and ctx_config.yaml — the claim that hetero ctx/gen TP is rejected for K3 predated the head-sharded layout. Matched geometry remains the only configuration validated end-to-end.
  • Bounce-buffer gate documentation: notes at the min-bytes/min-blocks env gates in bounce/config.py explaining what each admission control covers.
  • Pool-sizing cross-references between transceiver.py _slice_num_bytes (sums all pool views) and bounce/impl.py block_bytes_per_group (pool 0 only), pointing at the TRTLLM-15194 sizing gap without changing behavior.
  • Removed an unused example payload yaml; its payload-size derivation is preserved in the K3 disagg README.

Test Coverage

On Blackwell hardware: tests/unittest/disaggregated/test_kda_mamba_transfer.py 18 passed; tests/unittest/disaggregated/test_bounce.py 75 passed. Product-code changes are comment/docstring/error-text only.

PR Checklist

  • PR title follows the [TRTLLM-15264][test] convention
  • pre-commit run on the touched files
  • Unit suites verified on representative hardware

Dev Engineer Review

  • The changes correctly align KDA test fixtures with production extract_mamba_kv_cache_params.
  • The tests now cover sharded and replicated KDA state, attention-DP modes, matched TP, and heterogeneous TP.
  • Documentation and error text now describe KDA state placement and bounce-buffer admission gates more accurately.
  • The deleted payload YAML is preserved through the README derivation.
  • No executable product behavior changes are expected. The changes are limited to tests, comments, docstrings, documentation, and error text.
  • The TRTLLM-15194 references document pool-sizing considerations without changing runtime behavior.
  • The configuration and documentation updates appear consistent with the supported validation scope.
  • The waiver entry requires confirmation that PR 17483 is the correct tracking reference and that the entry matches the repository waiver format.

QA Engineer Review

Modified test code:

  • tests/unittest/disaggregated/test_kda_mamba_transfer.py
    • Replaced test_kda_hetero_tp_rejected() with test_kda_hetero_tp_sharded_accepted().
    • Updated test_kda_transfer(ctx_tp, gen_tp) to accept enable_attention_dp.
    • Expanded loopback transfer coverage for matched and heterogeneous TP with attention-DP enabled and disabled.
    • Added validation for sharded and replicated state layouts and per-rank payload sizes.
  • tests/unittest/disaggregated/test_mamba_transfer.py
    • Extended _create_transceivers with enable_attention_dp.
    • Propagated the option to each Mapping.

These tests are not individually listed in tests/integration/test_lists/. The change adds one waiver entry in tests/integration/test_lists/waives.txt, but it does not provide CI or manual-QA entries for the modified test functions.

Verdict: needs follow-up. Confirm CBTS coverage and add or verify the required CI and manual-QA test-list coverage.

  • File a tracking bug for the CI-waived test(s) and record it with pr-babysitter waive set-bug NVIDIA/TensorRT-LLM#17483 <bug-url> — the waives entry carries a placeholder until then

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Kimi K3 KDA disaggregated-serving documentation now describes sharded and replicated layouts. Transfer tests derive production cache parameters and cover matched or heterogeneous TP with attention-DP enabled or disabled.

Changes

KDA transfer validation

Layer / File(s) Summary
Configuration and payload sizing
examples/kimi_k3/disagg/README.md, examples/kimi_k3/disagg/ctx_config.yaml, tensorrt_llm/_torch/disaggregation/native/bounce/config.py, tensorrt_llm/_torch/disaggregation/transceiver.py
Documentation describes parallelism constraints, the fixed KDA payload, byte-based admission, and multi-pool sizing accounting.
Peer layout validation
tensorrt_llm/_torch/disaggregation/native/mixers/ssm/peer.py
Peer validation documentation distinguishes TP-sharded KDA state from attention-DP-replicated state and updates the validation message.
Manager parameter derivation and validation
tests/unittest/disaggregated/test_kda_mamba_transfer.py
Tests derive cache parameters from a synthetic kimi_linear configuration and validate sharded, replicated, mixed, and heterogeneous peer layouts.
Loopback and NIXL transfer coverage
tests/unittest/disaggregated/test_kda_mamba_transfer.py, tests/integration/test_lists/waives.txt
Transfer tests shard convolution and SSM state, select participating ranks, verify payload sizes and contents, and cover matched and heterogeneous TP with attention-DP enabled or disabled.
Attention-DP transceiver wiring
tests/unittest/disaggregated/test_mamba_transfer.py
The shared Mamba transfer test enables attention-DP through rank mappings while preserving UCX_NET_DEVICES.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: bowenfu, nv-xtf

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the Kimi K3 disaggregated-serving test, documentation, and example cleanup changes.
Description check ✅ Passed The description includes the required sections and clearly explains the changes, test coverage, checklist status, and remaining waiver-bug action.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/unittest/disaggregated/test_kda_mamba_transfer.py`:
- Around line 691-716: Add unittest/disaggregated/test_kda_mamba_transfer.py to
the repository’s integration test registration list so test_kda_transfer and the
other module tests are executed by CI and QA; update the existing test-list
configuration rather than changing the test implementation.
- Around line 527-544: Unset UCX_NET_DEVICES during setup of the KDA loopback
transfer tests, before creating any NIXL transceivers, while preserving the
existing UCX_TLS and TRTLLM_NIXL_NUM_THREADS configuration. Apply this to the
shared setup covering test_kda_hetero_tp_sharded_accepted and test_kda_transfer
so CI-provided device selection cannot affect either test.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1a1dfd1b-a513-412a-b4d7-7402c910563f

📥 Commits

Reviewing files that changed from the base of the PR and between 5f905ea and 1da35af.

📒 Files selected for processing (8)
  • examples/disaggregated/slurm/cache_transceiver_test/configs/kda_payload_kimi_k3.yaml
  • examples/kimi_k3/disagg/README.md
  • examples/kimi_k3/disagg/ctx_config.yaml
  • tensorrt_llm/_torch/disaggregation/native/bounce/config.py
  • tensorrt_llm/_torch/disaggregation/native/bounce/impl.py
  • tensorrt_llm/_torch/disaggregation/native/mixers/ssm/peer.py
  • tensorrt_llm/_torch/disaggregation/transceiver.py
  • tests/unittest/disaggregated/test_kda_mamba_transfer.py
💤 Files with no reviewable changes (1)
  • examples/disaggregated/slurm/cache_transceiver_test/configs/kda_payload_kimi_k3.yaml

Comment thread tests/unittest/disaggregated/test_kda_mamba_transfer.py
Comment thread tests/unittest/disaggregated/test_kda_mamba_transfer.py
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65160 [ run ] triggered by Bot. Commit: 1da35af Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65160 [ run ] completed with state FAILURE. Commit: 1da35af
/LLM/main/L0_MergeRequest_PR pipeline #52954 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65196 [ run ] triggered by Bot. Commit: 1da35af Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65196 [ run ] completed with state FAILURE. Commit: 1da35af
/LLM/main/L0_MergeRequest_PR pipeline #52984 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65220 [ run ] triggered by Bot. Commit: 1da35af Link to invocation

@chuangz0 chuangz0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need merge #17484 into this PR , so the modified test can be verfied in CI.

Comment thread tests/unittest/disaggregated/test_kda_mamba_transfer.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65220 [ run ] completed with state FAILURE. Commit: 1da35af
/LLM/main/L0_MergeRequest_PR pipeline #53005 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65280 [ run ] triggered by Bot. Commit: 1da35af Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65280 [ run ] completed with state SUCCESS. Commit: 1da35af
/LLM/main/L0_MergeRequest_PR pipeline #53057 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@brnguyen2
brnguyen2 force-pushed the k3/15264-review-bundle branch from 1da35af to f6098c7 Compare August 11, 2026 15:49
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65322 [ run ] triggered by Bot. Commit: f6098c7 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65322 [ run ] completed with state SUCCESS. Commit: f6098c7
/LLM/main/L0_MergeRequest_PR pipeline #53096 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

3 similar comments
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@brnguyen2
brnguyen2 force-pushed the k3/15264-review-bundle branch from 10c2c7f to 3d7619f Compare August 13, 2026 19:42
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66035 [ run ] triggered by Bot. Commit: 3d7619f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66035 [ run ] completed with state FAILURE. Commit: 3d7619f
/LLM/main/L0_MergeRequest_PR pipeline #53718 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66041 [ run ] triggered by Bot. Commit: 3d7619f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66041 [ run ] completed with state FAILURE. Commit: 3d7619f
/LLM/main/L0_MergeRequest_PR pipeline #53724 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

… gate docs, example cleanup

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Review follow-ups:
- _create_transceivers now takes enable_attention_dp and sets it on the
  transceiver Mapping, so the ADP-on KDA cases exercise the production
  attention-DP control flow (_dp_rank, sync policy, _kv_size_rank_factor)
  instead of the non-ADP path. The transfer-byte assertion uses rank
  factor 1 under ADP, matching _kv_size_rank_factor.
- Note why UCX_NET_DEVICES must be left untouched: clearing the
  cluster-provided pin makes UCX open every interface and fail worker
  creation on unbindable ones.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
…test_gpt_oss_two_model_eagle3_falls_back_to_v1 (pre-existing failure, tracking bug pending)

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@brnguyen2
brnguyen2 force-pushed the k3/15264-review-bundle branch from 3d7619f to 8981a76 Compare August 14, 2026 00:20
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66098 [ run ] triggered by Bot. Commit: 8981a76 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66098 [ run ] completed with state FAILURE. Commit: 8981a76
/LLM/main/L0_MergeRequest_PR pipeline #53777 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

…r exists)

The waive entry pointed at
unittest/_torch/modeling/test_modeling_gpt_oss.py::test_gpt_oss_two_model_eagle3_falls_back_to_v1,
which was removed from main as obsolete in NVIDIA#17597 (commit 8398196).
The 2-model Eagle3 fallback scenario it asserted was invalidated when
NVIDIA#17366 forced 2-model spec-dec to fall back to 1-model, so the test was
deleted rather than fixed. Waiving a nonexistent test fails the AST-based
validate-test-lists pre-commit hook (check_test_list.py --validate) and
gates the whole pipeline. NVBug 6606544 is moot now that the test is gone.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66275 [ run ] triggered by Bot. Commit: afccc52 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66275 [ run ] completed with state SUCCESS. Commit: afccc52
/LLM/main/L0_MergeRequest_PR pipeline #53935 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66292 [ run ] triggered by Bot. Commit: afccc52 Link to invocation

…DIA#17584)

test_kda_verify_matches_sequential_decode[2-1] was waived under
nvbugs/6599150, but that bug is closed-fixed: PR NVIDIA#17584 (merged) fixed
the test by initializing dt_bias in the parity test and removed the need
for the waive. Main carries no such waive. Drop the re-added line so the
now-passing test runs.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66292 [ run ] completed with state ABORTED. Commit: afccc52

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66481 [ run ] triggered by Bot. Commit: 8289853 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66481 [ run ] completed with state SUCCESS. Commit: 8289853
/LLM/main/L0_MergeRequest_PR pipeline #54121 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants