Skip to content

[None][feat] Default Kimi K2.5 to KV cache manager V2 - #17125

Open
liji-nv wants to merge 1 commit into
NVIDIA:mainfrom
liji-nv:feat/kimi-k25-manager-v2
Open

[None][feat] Default Kimi K2.5 to KV cache manager V2#17125
liji-nv wants to merge 1 commit into
NVIDIA:mainfrom
liji-nv:feat/kimi-k25-manager-v2

Conversation

@liji-nv

@liji-nv liji-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Use the C++ KV cache manager V2 as the model-specific default for Kimi K2.5. This keeps the default scoped to Kimi K2.5 without changing other Kimi implementations or the global LLM arguments.

The existing auto resolution remains responsible for transport compatibility: NIXL with the Python transceiver keeps ManagerV2, while non-NIXL or C++ transceiver routes fall back to the legacy manager unless the user explicitly requests V2.

Add a focused model registration test for the new default.

Validation:

  • pre-commit run --files tensorrt_llm/_torch/models/modeling_kimi_k25.py tests/unittest/_torch/modeling/test_modeling_kimi_k25.py

  • git diff --check

  • B200 clean sqsh build (Slurm 1569850)

Dev Engineer Review

  • Added KimiK25ForConditionalGeneration.get_model_defaults to select the C++ KV cache manager V2 for Kimi K2.5.
  • The change is model-specific and does not alter other Kimi implementations or global LLM arguments.
  • Existing automatic resolution preserves transport compatibility:
    • NIXL with the Python transceiver uses ManagerV2.
    • Non-NIXL or C++ transceiver configurations use the legacy manager unless V2 is explicitly requested.
  • The implementation is small and consistent with the model-defaults API.
  • Validation included pre-commit checks, git diff --check, and a clean B200 build.

QA Engineer Review

  • Added a structural test that calls get_model_defaults(None) and verifies the Kimi K2.5 default.
  • The test covers the new model registration behavior.
  • No tests/integration/test_lists/, test-db/, or qa/ entries changed.
  • Verdict: sufficient.

Description

Test Coverage

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-compatible or api-breaking. For api-breaking, include BREAKING in 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.

@liji-nv
liji-nv requested a review from a team as a code owner July 31, 2026 12:24
@liji-nv
liji-nv requested a review from 2ez4bz July 31, 2026 12:24
@liji-nv liji-nv changed the title [Kimi K2.5][feat] Default to KV cache manager V2 [None][feat] Default to KV cache manager V2 Jul 31, 2026
@liji-nv liji-nv changed the title [None][feat] Default to KV cache manager V2 [None][feat] Default Kimi K2.5 to KV cache manager V2 Jul 31, 2026
@liji-nv

liji-nv commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --add-multi-gpu-test

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7a392137-1a72-4418-8f7f-550cec252207

📥 Commits

Reviewing files that changed from the base of the PR and between f1f773f and 81aa6b6.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/models/modeling_kimi_k25.py
  • tests/unittest/_torch/modeling/test_modeling_kimi_k25.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/unittest/_torch/modeling/test_modeling_kimi_k25.py
  • tensorrt_llm/_torch/models/modeling_kimi_k25.py

Walkthrough

Kimi K2.5 now returns defaults that enable the C++ KV cache manager V2. A structural test verifies the returned configuration.

Changes

Kimi K2.5 KV cache defaults

Layer / File(s) Summary
Configure and validate KV cache defaults
tensorrt_llm/_torch/models/modeling_kimi_k25.py, tests/unittest/_torch/modeling/test_modeling_kimi_k25.py
get_model_defaults enables KV cache manager V2. The test verifies this default.

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

Possibly related PRs

Suggested reviewers: 2ez4bz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required format and clearly states the Kimi K2.5 KV cache manager V2 default change.
Description check ✅ Passed The description explains the change, scope, compatibility behavior, focused test, validation steps, and completed checklist.
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.
✨ Finishing Touches
🧪 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 (1)
tensorrt_llm/_torch/models/modeling_kimi_k25.py (1)

1520-1523: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align the override with the base type contract.

Line 1521 uses Any, and the return annotation is an unparameterized dict. Use the same TorchLlmArgs input annotation as tensorrt_llm/_torch/models/modeling_utils.py. Parameterize the return type for this nested configuration. If Line 616 intentionally passes None, confirm that None is part of the runtime contract or update the test to use a valid argument.

Suggested type alignment
-    def get_model_defaults(cls, llm_args: Any) -> dict:
+    def get_model_defaults(
+        cls, llm_args: "TorchLlmArgs"
+    ) -> dict[str, dict[str, bool]]:
🤖 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 `@tensorrt_llm/_torch/models/modeling_kimi_k25.py` around lines 1520 - 1523,
Update KimiForCausalLM.get_model_defaults to accept TorchLlmArgs instead of Any
and annotate its nested configuration return with the appropriate parameterized
mapping type, matching the base contract in modeling_utils.py. Check the call at
line 616 and preserve None only if it is supported by the runtime contract;
otherwise update that test or caller to provide a valid TorchLlmArgs instance.

Source: Coding guidelines

🤖 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/modeling/test_modeling_kimi_k25.py`:
- Around line 614-617: Register test_modeling_kimi_k25.py in the appropriate CI
or QA test list so
TestKimiK25AutoModelRegistration.test_defaults_to_kv_cache_manager_v2 is
included in automated coverage.

---

Nitpick comments:
In `@tensorrt_llm/_torch/models/modeling_kimi_k25.py`:
- Around line 1520-1523: Update KimiForCausalLM.get_model_defaults to accept
TorchLlmArgs instead of Any and annotate its nested configuration return with
the appropriate parameterized mapping type, matching the base contract in
modeling_utils.py. Check the call at line 616 and preserve None only if it is
supported by the runtime contract; otherwise update that test or caller to
provide a valid TorchLlmArgs instance.
🪄 Autofix (Beta)

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: 685036d2-737c-48dc-8acc-b83be74235f3

📥 Commits

Reviewing files that changed from the base of the PR and between d924d9f and c0b198e.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/models/modeling_kimi_k25.py
  • tests/unittest/_torch/modeling/test_modeling_kimi_k25.py

Comment thread tests/unittest/_torch/modeling/test_modeling_kimi_k25.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63037 [ run ] triggered by Bot. Commit: c0b198e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63037 [ run ] completed with state FAILURE. Commit: c0b198e
/LLM/main/L0_MergeRequest_PR pipeline #51141 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

@liji-nv

liji-nv commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

Depends on #16072 to resolve the perf issue.

Use the C++ KV cache manager V2 as the model-specific default for Kimi K2.5. This keeps the default scoped to Kimi K2.5 without changing other Kimi implementations or the global LLM arguments.

The existing auto resolution remains responsible for transport compatibility: NIXL with the Python transceiver keeps ManagerV2, while non-NIXL or C++ transceiver routes fall back to the legacy manager unless the user explicitly requests V2.

Add a focused model registration test for the new default.

Validation:

- pre-commit run --files tensorrt_llm/_torch/models/modeling_kimi_k25.py tests/unittest/_torch/modeling/test_modeling_kimi_k25.py

- git diff --check

- B200 clean sqsh build (Slurm 1569850)

Signed-off-by: Jin Li <59594262+liji-nv@users.noreply.github.com>
@liji-nv
liji-nv force-pushed the feat/kimi-k25-manager-v2 branch from c0b198e to 81aa6b6 Compare August 5, 2026 10:01
@coderabbitai

coderabbitai Bot commented Aug 5, 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.

@liji-nv

liji-nv commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --add-multi-gpu-test

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64025 [ run ] triggered by Bot. Commit: 81aa6b6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64025 [ run ] completed with state SUCCESS. Commit: 81aa6b6
/LLM/main/L0_MergeRequest_PR pipeline #51956 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.

2 participants