Skip to content

[TRTLLM-15264][fix] Reject non-Python transceiver routes for Kimi K3 disaggregated serving - #17480

Open
brnguyen2 wants to merge 7 commits into
NVIDIA:mainfrom
brnguyen2:k3/15264-transceiver-runtime-guard
Open

[TRTLLM-15264][fix] Reject non-Python transceiver routes for Kimi K3 disaggregated serving#17480
brnguyen2 wants to merge 7 commits into
NVIDIA:mainfrom
brnguyen2:k3/15264-transceiver-runtime-guard

Conversation

@brnguyen2

@brnguyen2 brnguyen2 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Description

Follow-up to review feedback on #17334 (#17334 (comment)).

A Kimi K3 disaggregated deployment that left cache_transceiver_config.transceiver_runtime at its default (auto) silently resolved to the C++ transceiver: the hybrid manager routing returned CppMambaHybridCacheManager with no error, even though only the Python NIXL transceiver (KvCacheTransceiverV2) can move the KDA recurrent state. The C++ path is unvalidated for K3 and would serve wrong results rather than fail. (The shipped K3 example configs all pin transceiver_runtime: PYTHON, so this affects hand-rolled configs only.)

Two layers of fix:

  • KimiLinearForCausalLM now overrides get_preferred_transceiver_runtime to "PYTHON" (the Qwen3-Next pattern), so model loading resolves auto to the Python transceiver when the effective backend is NIXL.
  • get_kv_cache_manager_cls rejects any K3 disagg route that is not PYTHON+NIXL with an actionable error, covering explicit non-Python runtimes and paths that skip model-default resolution (e.g. AutoDeploy, where auto falls back to the C++ runtime).

Test Coverage

New cases in tests/unittest/_torch/executor/test_mamba_cache_manager.py:

  • test_kimi_preferred_transceiver_runtime
  • test_kimi_disagg_rejects_non_python_transceiver_route (no config / unresolved auto / explicit CPP / UCX+CPP)
  • test_kimi_disagg_python_nixl_routes_to_mixed_manager

Full file run on Blackwell hardware: 125 passed, 4 xfailed.

PR Checklist

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

Dev Engineer Review

  • Kimi K3 serving prefers the PYTHON transceiver.
  • Disaggregated Kimi K3 routes require the PYTHON transceiver with the NIXL backend.
  • Validation rejects unresolved auto, C++ runtime, and UCX routes.
  • The valid Python NIXL route remains supported.
  • The waiver entry uses the expected format and records the related tracking bug.
  • No configuration files changed.

QA Engineer Review

Added:

  • test_kimi_preferred_transceiver_runtime
  • test_kimi_disagg_rejects_non_python_transceiver_route
  • test_kimi_disagg_python_nixl_routes_to_mixed_manager

These are test-code changes outside tests/integration/test_lists/. No test-db/ or qa/ coverage entries are reported. The full test file passed 125 tests, with 4 expected Blackwell hardware failures.

Verdict: needs follow-up

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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Aug 10, 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 now declares Python as its preferred transceiver runtime. Disaggregated serving validates the Python NIXL route and rejects unsupported configurations. Tests cover preference resolution, invalid routes, valid cache-manager selection, and an integration test waiver.

Changes

Kimi K3 transceiver routing

Layer / File(s) Summary
Define the Kimi transceiver preference
tensorrt_llm/_torch/models/modeling_kimi_linear.py, tests/unittest/_torch/executor/test_mamba_cache_manager.py
KimiLinearForCausalLM.get_preferred_transceiver_runtime returns "PYTHON". Tests verify the preference.
Validate and route disaggregated serving
tensorrt_llm/_torch/pyexecutor/_util.py, tests/unittest/_torch/executor/test_mamba_cache_manager.py, tests/integration/test_lists/waives.txt
Disaggregated Kimi K3 serving requires the Python NIXL route, raises ValueError for other routes, and selects MixedMambaHybridCacheManager for the valid route. The integration waiver records the tracked Qwen3 test skip.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant KimiLinearForCausalLM
  participant DisaggregatedServing
  participant MixedMambaHybridCacheManager
  KimiLinearForCausalLM->>DisaggregatedServing: provide preferred runtime "PYTHON"
  DisaggregatedServing->>DisaggregatedServing: validate runtime "PYTHON" and backend "NIXL"
  DisaggregatedServing->>MixedMambaHybridCacheManager: select valid route
Loading

Possibly related PRs

Suggested reviewers: qijune, yizhang-nv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 identifies the fix for unsupported non-Python transceiver routes in Kimi K3 disaggregated serving.
Description check ✅ Passed The description explains the issue, solution, affected routes, test coverage, and checklist status; only the tracking bug remains pending.
✨ 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: 1

🧹 Nitpick comments (2)
tests/unittest/_torch/executor/test_mamba_cache_manager.py (2)

796-798: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Annotate cache_transceiver_config.

Use CacheTransceiverConfig | None for the parameter type.

Proposed type annotation
 def test_kimi_disagg_rejects_non_python_transceiver_route(
-    monkeypatch: pytest.MonkeyPatch, cache_transceiver_config
+    monkeypatch: pytest.MonkeyPatch,
+    cache_transceiver_config: CacheTransceiverConfig | None,
 ) -> None:

As per coding guidelines, “Annotate every function.”

🤖 Prompt for 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.

In `@tests/unittest/_torch/executor/test_mamba_cache_manager.py` around lines 796
- 798, Update the test_kimi_disagg_rejects_non_python_transceiver_route function
signature to annotate cache_transceiver_config as CacheTransceiverConfig | None,
using the existing CacheTransceiverConfig symbol and preserving the current test
behavior.

Source: Coding guidelines


778-832: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Annotate cache_transceiver_config.

test_kimi_disagg_rejects_non_python_transceiver_route leaves this parameter untyped. Use CacheTransceiverConfig | None.

Test coverage summary: sufficient. Added tests cover Kimi defaults, runtime preference, rejected routes, and the Python NIXL route. The test file is included through unittest/_torch/executor entries in the test-db lists. No tests were modified or removed.

🤖 Prompt for 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.

In `@tests/unittest/_torch/executor/test_mamba_cache_manager.py` around lines 778
- 832, Annotate the cache_transceiver_config parameter in
test_kimi_disagg_rejects_non_python_transceiver_route with the union type
CacheTransceiverConfig | None, preserving the existing parametrized values and
test behavior.

Source: Path instructions

🤖 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/_torch/executor/test_mamba_cache_manager.py`:
- Around line 786-795: Add a parameterized case in the existing
cache_transceiver_config matrix for backend="UCX" with
transceiver_runtime="PYTHON", and assign it a distinct id. Ensure the test
exercises the rejection path in the relevant executor configuration validation
while retaining the existing NIXL and C++ cases.

---

Nitpick comments:
In `@tests/unittest/_torch/executor/test_mamba_cache_manager.py`:
- Around line 796-798: Update the
test_kimi_disagg_rejects_non_python_transceiver_route function signature to
annotate cache_transceiver_config as CacheTransceiverConfig | None, using the
existing CacheTransceiverConfig symbol and preserving the current test behavior.
- Around line 778-832: Annotate the cache_transceiver_config parameter in
test_kimi_disagg_rejects_non_python_transceiver_route with the union type
CacheTransceiverConfig | None, preserving the existing parametrized values and
test behavior.
🪄 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: dab9c8ab-cbe8-4e4b-b824-26e4423c54e2

📥 Commits

Reviewing files that changed from the base of the PR and between c67879c and 21d1124.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/models/modeling_kimi_linear.py
  • tensorrt_llm/_torch/pyexecutor/_util.py
  • tests/unittest/_torch/executor/test_mamba_cache_manager.py

Comment thread tests/unittest/_torch/executor/test_mamba_cache_manager.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65138 [ run ] triggered by Bot. Commit: 21d1124 Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@brnguyen2
brnguyen2 force-pushed the k3/15264-transceiver-runtime-guard branch from 21d1124 to 4ef04d0 Compare August 10, 2026 23:22
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65148 [ run ] triggered by Bot. Commit: 4ef04d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65138 [ run ] completed with state ABORTED. Commit: 21d1124

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65148 [ run ] completed with state FAILURE. Commit: 4ef04d0
/LLM/main/L0_MergeRequest_PR pipeline #52944 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 #65290 [ run ] triggered by Bot. Commit: 748edcd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65290 [ run ] completed with state SUCCESS. Commit: 748edcd
/LLM/main/L0_MergeRequest_PR pipeline #53065 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 #65353 [ run ] triggered by Bot. Commit: 748edcd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65353 [ run ] completed with state SUCCESS. Commit: 748edcd
/LLM/main/L0_MergeRequest_PR pipeline #53120 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 requested review from a team as code owners August 11, 2026 20:05
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65613 [ run ] completed with state ABORTED. Commit: 6c91ae8

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65997 [ run ] triggered by Bot. Commit: 6c91ae8 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #65997 [ run ] completed with state FAILURE. Commit: 6c91ae8
/LLM/main/L0_MergeRequest_PR pipeline #53684 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 #66042 [ run ] triggered by Bot. Commit: 5f2ff40 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66042 [ run ] completed with state SUCCESS. Commit: 5f2ff40
/LLM/main/L0_MergeRequest_PR pipeline #53725 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-transceiver-runtime-guard branch from 5f2ff40 to 7f57f00 Compare August 13, 2026 23:16
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66080 [ run ] triggered by Bot. Commit: 7f57f00 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66080 [ run ] completed with state SUCCESS. Commit: 7f57f00
/LLM/main/L0_MergeRequest_PR pipeline #53759 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 #66123 [ run ] triggered by Bot. Commit: 7f57f00 Link to invocation

…disaggregated serving

A K3 disaggregated deployment that left transceiver_runtime at its
default ('auto') silently resolved to the C++ transceiver: the hybrid
manager routing returned CppMambaHybridCacheManager with no error, even
though only the Python NIXL transceiver (KvCacheTransceiverV2) can move
the KDA recurrent state. The C++ path is unvalidated for K3 and would
serve wrong results rather than fail.

Two layers of fix:

- KimiLinearForCausalLM now overrides get_preferred_transceiver_runtime
  to 'PYTHON' (the Qwen3-Next pattern), so model loading resolves
  'auto' to the Python transceiver when the backend is NIXL.
- get_kv_cache_manager_cls rejects any K3 disagg route that is not
  PYTHON+NIXL with an actionable error, covering explicit non-Python
  runtimes and paths that skip model-default resolution (e.g.
  AutoDeploy, where 'auto' falls back to the C++ runtime).

Adds routing unit tests: the preference override, rejection of
no-config / unresolved-auto / explicit-CPP / UCX routes, and the
positive PYTHON+NIXL route to MixedMambaHybridCacheManager.

Addresses review feedback on NVIDIA#17334.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
…er-route test

Review follow-up: backend=UCX with transceiver_runtime=PYTHON passes the
runtime check and is rejected only by the NIXL-backend check; without this
case the matrix cannot detect removal of that check.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
…_Instruct_2507::test_skip_softmax_attention[target_sparsity_0.9-fp8kv=True] (pre-existing failure, tracking bug pending)

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
…r does not truncate it

The test-list parser treats everything after a # as a comment, so a #
inside a waive reason truncates the line and leaves unbalanced
parentheses, breaking collection. Drop the # from the PR reference.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
…ention waive

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

Copy link
Copy Markdown
Collaborator Author

/bot run

@brnguyen2
brnguyen2 force-pushed the k3/15264-transceiver-runtime-guard branch from 7f57f00 to 6d2d615 Compare August 14, 2026 06:10
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66201 [ run ] triggered by Bot. Commit: 6d2d615 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66123 [ run ] completed with state ABORTED. Commit: 7f57f00

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #66201 [ run ] completed with state FAILURE. Commit: 6d2d615
/LLM/main/L0_MergeRequest_PR pipeline #53867 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 #66239 [ run ] triggered by Bot. Commit: 6d2d615 Link to invocation

…_nvfp4[adp4_cutedsl] waive

The waive cited nvbugs/6535767, which tracks a different, already-fixed
(V2C) test (TestQwen3NextInstruct::test_nvfp4). The correct open tracking
bug for the TestQwen3_5_397B_A17B::test_nvfp4 family is nvbugs/6535779
(Open - To fix), under which its sibling params (adp4_trtllm, tep4_trtllm)
are already waived on main. Transposed digit (767 -> 779).

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

Copy link
Copy Markdown
Collaborator

PR_Github #66239 [ run ] completed with state SUCCESS. Commit: 6d2d615
/LLM/main/L0_MergeRequest_PR pipeline #53907 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

CI Report

Link to invocation

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants