Skip to content

Comments

[TRTLLM-9381][test] add disag-serving kimi k2 thinking tests#10357

Merged
xinhe-nv merged 1 commit intoNVIDIA:mainfrom
xinhe-nv:add-kimi
Jan 5, 2026
Merged

[TRTLLM-9381][test] add disag-serving kimi k2 thinking tests#10357
xinhe-nv merged 1 commit intoNVIDIA:mainfrom
xinhe-nv:add-kimi

Conversation

@xinhe-nv
Copy link
Collaborator

@xinhe-nv xinhe-nv commented Dec 31, 2025

Summary by CodeRabbit

  • Tests
    • Added accuracy benchmarks for Kimi-K2-Thinking model with NVFP4 quantization (90.84 accuracy).
    • Expanded test coverage for Kimi-K2 model variants with NVFP4 quantization in disaggregated serving scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

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)

  • 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

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

📝 Walkthrough

Walkthrough

This pull request adds support for testing the Kimi-K2 model with NVFP4 quantization. Changes include a new accuracy reference entry in the GSM8K benchmark, a new test class with disaggregated serving configuration, and corresponding test list entries for CI/CD integration.

Changes

Cohort / File(s) Summary
Accuracy Reference Data
tests/integration/defs/accuracy/references/gsm8k.yaml
Added new accuracy record for moonshotai/Kimi-K2-Thinking with NVFP4 quantization (accuracy: 90.84) without KV cache quantization configuration
Test Implementation
tests/integration/defs/accuracy/test_disaggregated_serving.py
Introduced new TestKimiK2 class extending LlmapiAccuracyTestHarness with test_nvfp4 method; configures disaggregated serving with context and generation server settings for GSM8K evaluation on Kimi-K2-Instruct model
Test List Configuration
tests/integration/test_lists/qa/llm_function_core.txt
Added four new test entries: disaggregated serving test, two GPU variants (4 and 8 GPUs) of NVFP4 test, and FP8 blockscale latency test for KimiK2

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is entirely the template with no actual content filled in. Required sections like 'Description' and 'Test Coverage' are empty, and the PR checklist is not properly completed. Fill in the Description section explaining the issue and solution, complete the Test Coverage section with relevant test names, and ensure all PR checklist items are properly reviewed and documented.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title directly reflects the main changes: adding disaggregated-serving tests for the Kimi K2 model with NVFP4 quantization.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/integration/defs/accuracy/test_disaggregated_serving.py (1)

1337-1341: Verify class attributes and timeout value.

The class defines MODEL_NAME = "moonshotai/Kimi-K2-Instruct" and MODEL_PATH, but the test method uses different values: model_name = "moonshotai/Kimi-K2-Thinking" and model_path = f"{llm_models_root()}/Kimi-K2-Thinking-NVFP4". This suggests the class attributes are unused.

Additionally, the timeout is set to 10800 seconds (3 hours), which is significantly longer than the DEFAULT_TEST_TIMEOUT = 1200 used by other test classes in this file.

Please verify:

  1. Are the class attributes MODEL_NAME and MODEL_PATH intentionally unused, or should they be referenced in the test?
  2. Is the 3-hour timeout justified for this test? If so, consider adding a comment explaining why this test requires such an extended timeout.

Based on learnings, Kimi K2 model support uses the PyTorch backend path.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 910a633 and 75ce88d.

📒 Files selected for processing (3)
  • tests/integration/defs/accuracy/references/gsm8k.yaml
  • tests/integration/defs/accuracy/test_disaggregated_serving.py
  • tests/integration/test_lists/qa/llm_function_core.txt
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

**/*.py: Code developed for TensorRT-LLM should conform to Python 3.8+
Indent Python code with 4 spaces. Do not use tabs
Always maintain the namespace when importing in Python, even if only one class or function from a module is used
Python files should use snake_case naming: some_file.py
Python classes should use PascalCase naming: class SomeClass
Python functions and methods should use snake_case naming: def my_awesome_function():
Python local variables should use snake_case naming: my_variable = ...
Python variable names that start with a number should be prefixed with 'k': k_99th_percentile = ...
Python global variables should use upper snake_case with prefix 'G': G_MY_GLOBAL = ...
Python constants should use upper snake_case naming: MY_CONSTANT = ...
Avoid shadowing variables declared in an outer scope in Python
Initialize all externally visible members of a Python class in the constructor
For Python interfaces that may be used outside a file, prefer docstrings over comments
Python comments should be reserved for code within a function, or interfaces that are local to a file
Use Google style docstrings in Python for classes and functions, which can be parsed by Sphinx
Python attributes and variables can be documented inline with type and description
Avoid using reflection in Python when functionality can be easily achieved without reflection
When using try-except blocks in Python, limit the except to the smallest set of errors possible
When using try-except blocks in Python to handle multiple possible variable types (duck-typing), keep the body of the try as small as possible, using the else block for logic

Files:

  • tests/integration/defs/accuracy/test_disaggregated_serving.py
**/*.{cpp,h,cu,cuh,py}

📄 CodeRabbit inference engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the year of its latest meaningful modification

Files:

  • tests/integration/defs/accuracy/test_disaggregated_serving.py
🧠 Learnings (6)
📓 Common learnings
Learnt from: pengbowang-nv
Repo: NVIDIA/TensorRT-LLM PR: 7120
File: tensorrt_llm/llmapi/llm.py:530-532
Timestamp: 2025-09-18T05:41:54.073Z
Learning: For Kimi k2 model support, the team is initially focusing on the PyTorch backend path where the model directory structure remains consistent, assuming built model directories contain relevant HF config files.
📚 Learning: 2025-09-18T05:41:54.073Z
Learnt from: pengbowang-nv
Repo: NVIDIA/TensorRT-LLM PR: 7120
File: tensorrt_llm/llmapi/llm.py:530-532
Timestamp: 2025-09-18T05:41:54.073Z
Learning: For Kimi k2 model support, the team is initially focusing on the PyTorch backend path where the model directory structure remains consistent, assuming built model directories contain relevant HF config files.

Applied to files:

  • tests/integration/defs/accuracy/test_disaggregated_serving.py
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
Repo: NVIDIA/TensorRT-LLM PR: 6303
File: tests/integration/test_lists/qa/examples_test_list.txt:494-494
Timestamp: 2025-07-28T17:06:08.621Z
Learning: In TensorRT-LLM testing, it's common to have both CLI flow tests (test_cli_flow.py) and PyTorch API tests (test_llm_api_pytorch.py) for the same model. These serve different purposes: CLI flow tests validate the traditional command-line workflow, while PyTorch API tests validate the newer LLM API backend. Both are legitimate and should coexist.

Applied to files:

  • tests/integration/defs/accuracy/test_disaggregated_serving.py
  • tests/integration/test_lists/qa/llm_function_core.txt
📚 Learning: 2025-09-09T09:40:45.658Z
Learnt from: fredricz-20070104
Repo: NVIDIA/TensorRT-LLM PR: 7645
File: tests/integration/test_lists/qa/llm_function_core.txt:648-648
Timestamp: 2025-09-09T09:40:45.658Z
Learning: In TensorRT-LLM test lists, it's common and intentional for the same test to appear in multiple test list files when they serve different purposes (e.g., llm_function_core.txt for comprehensive core functionality testing and llm_function_core_sanity.txt for quick sanity checks). This duplication allows tests to be run in different testing contexts.

Applied to files:

  • tests/integration/test_lists/qa/llm_function_core.txt
📚 Learning: 2025-08-06T13:58:07.506Z
Learnt from: galagam
Repo: NVIDIA/TensorRT-LLM PR: 6487
File: tests/unittest/_torch/auto_deploy/unit/singlegpu/test_ad_trtllm_bench.py:1-12
Timestamp: 2025-08-06T13:58:07.506Z
Learning: In TensorRT-LLM, test files (files under tests/ directories) do not require NVIDIA copyright headers, unlike production source code files. Test files typically start directly with imports, docstrings, or code.

Applied to files:

  • tests/integration/test_lists/qa/llm_function_core.txt
📚 Learning: 2025-09-17T02:48:52.732Z
Learnt from: tongyuantongyu
Repo: NVIDIA/TensorRT-LLM PR: 7781
File: tests/integration/test_lists/waives.txt:313-313
Timestamp: 2025-09-17T02:48:52.732Z
Learning: In TensorRT-LLM, `tests/integration/test_lists/waives.txt` is specifically for waiving/skipping tests, while other test list files like those in `test-db/` and `qa/` directories are for different test execution contexts (pre-merge, post-merge, QA tests). The same test appearing in both waives.txt and execution list files is intentional - the test is part of test suites but will be skipped due to the waiver.

Applied to files:

  • tests/integration/test_lists/qa/llm_function_core.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (3)
tests/integration/test_lists/qa/llm_function_core.txt (1)

640-640: LGTM!

The test entry is correctly formatted and properly references the new disaggregated serving test for Kimi-K2.

Based on learnings, it's common and intentional for the same model to appear in multiple test files (e.g., test_disaggregated_serving.py and test_llm_api_pytorch.py) as they serve different testing purposes.

tests/integration/defs/accuracy/test_disaggregated_serving.py (1)

1345-1391: The model variant difference between class attributes and test_nvfp4 is intentional.

The test_nvfp4 method uses moonshotai/Kimi-K2-Thinking while class attributes define Kimi-K2-Instruct. This is not an inconsistency but rather intentional design: the reference benchmarks (gsm8k.yaml, mmlu.yaml) define separate entries for each variant with their respective quantization algorithms. The Thinking variant uses NVFP4 quantization, which is exactly what test_nvfp4 evaluates. The Instruct variant uses different quantization (FP8_BLOCK_SCALES). The same pattern appears in test_llm_api_pytorch.py, confirming this is consistent across test harnesses. No action needed.

tests/integration/defs/accuracy/references/gsm8k.yaml (1)

153-154: The two NVFP4 entries for moonshotai/Kimi-K2-Thinking are intentional and represent different configurations. The first entry (lines 150-152) specifies kv_cache_quant_algo: FP8, while the second entry (lines 153-154) omits this parameter. The accuracy reference matching logic correctly distinguishes between these configurations by comparing all quantization parameters. These are valid reference entries for testing NVFP4 with and without explicit KV cache quantization.

@xinhe-nv
Copy link
Collaborator Author

xinhe-nv commented Jan 5, 2026

/bot run --skip-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30546 [ run ] triggered by Bot. Commit: 30a06df

@xinhe-nv xinhe-nv force-pushed the add-kimi branch 3 times, most recently from b62eda2 to 11cb36f Compare January 5, 2026 08:33
Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com>
@tensorrt-cicd
Copy link
Collaborator

PR_Github #30546 [ run ] completed with state SUCCESS. Commit: 30a06df
/LLM/main/L0_MergeRequest_PR pipeline #23559 (Partly Tested) completed with status: 'SUCCESS'

@xinhe-nv
Copy link
Collaborator Author

xinhe-nv commented Jan 5, 2026

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30586 [ reuse-pipeline ] triggered by Bot. Commit: c0ce51f

@tensorrt-cicd
Copy link
Collaborator

PR_Github #30586 [ reuse-pipeline ] completed with state SUCCESS. Commit: c0ce51f
Reusing PR_Github #30546 (Partly Tested) for commit c0ce51f

@xinhe-nv xinhe-nv merged commit b1733d5 into NVIDIA:main Jan 5, 2026
5 checks passed
@xinhe-nv xinhe-nv deleted the add-kimi branch January 6, 2026 01:09
videodanchik pushed a commit to videodanchik/TensorRT-LLM that referenced this pull request Jan 14, 2026
…10357)

Signed-off-by: Xin He (SW-GPU) <200704525+xinhe-nv@users.noreply.github.com>
Signed-off-by: Daniil Kulko <kulkodaniil@gmail.com>
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