KEMBAR78
[None][feat] Add gpt-oss GSM8K test. by Tracin · Pull Request #6732 · NVIDIA/TensorRT-LLM · GitHub
Skip to content

Conversation

@Tracin
Copy link
Collaborator

@Tracin Tracin commented Aug 8, 2025

Summary by CodeRabbit

  • New Features

    • Added an option to run few-shot evaluation as multi-turn dialogue and to filter/report specific evaluation metrics.
  • Bug Fixes

    • Added validation to ensure compatible flags when enabling multi-turn few-shot evaluation.
  • Tests

    • Expanded and parametrized integration tests across GPU/backends; updated test harness to enable the new mode.
  • Chores

    • Updated reference accuracy values for select models.

Description

Add GSM8K test case for GPT-OSS.
GSM8K support --fewshot_as_multiturn and return flexible extract scores.

Test Coverage

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.

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.

Signed-off-by: Tracin <10434017+Tracin@users.noreply.github.com>
@Tracin Tracin requested review from dongfengy, hlu1 and syuoni August 8, 2025 05:20
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

📝 Walkthrough

Walkthrough

Added a new boolean flag fewshot_as_multiturn to the evaluation interface and propagated it through the lm-eval evaluator, CLI, and test harness; added a scores_filter option for selective metric reporting; updated tests, accuracy references, and test lists to exercise the new options.

Changes

Cohort / File(s) Change Summary
Evaluator interface
tensorrt_llm/evaluate/interface.py
Added fewshot_as_multiturn: bool = False parameter to Evaluator.__init__ and stored as self.fewshot_as_multiturn.
lm-eval evaluator & CLI
tensorrt_llm/evaluate/lm_eval.py
Added fewshot_as_multiturn to LmEvalEvaluator.__init__ and passed to lm_eval.evaluate; added scores_filter arg to evaluate; imported lm_eval.tasks; added CLI flag and validation (GSM8K requires apply_chat_template if fewshot_as_multiturn is true).
Accuracy task changes
tests/integration/defs/accuracy/accuracy_core.py
AccuracyTask.evaluate now merges optional EVALUATE_KWARGS into evaluator call; GSM8K sets EVALUATE_KWARGS = dict(scores_filter=None).
Accuracy reference update
tests/integration/defs/accuracy/references/gsm8k.yaml
Updated reference accuracy values for GPT-OSS model variants from 88.5 to 90.3.
Test class & test logic
tests/integration/defs/accuracy/test_llm_api_pytorch.py
Replaced get_gpt_oss_root with class constant MODEL_PATH; added update_task_kwargs to set fewshot_as_multiturn, apply_chat_template, scores_filter, and MAX_OUTPUT_LEN; removed MMLU invocation; updated GSM8K usage.
Test lists (QA & DB)
tests/integration/test_lists/qa/llm_function_full.txt, .../l0_b200.yml, .../l0_dgx_h100.yml, .../l0_dgx_b200.yml
Appended multiple new TestGPTOSS test entries and conditional blocks covering 1- and 4-GPU variants across backends and parallelism strategies; no removals of existing entries.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner
    participant TestGPTOSS
    participant AccuracyTask
    participant LmEvalEvaluator
    participant lm_eval

    TestRunner->>TestGPTOSS: run test method (e.g., test_w4_1gpu)
    TestGPTOSS->>AccuracyTask: update_task_kwargs(task) (sets fewshot_as_multiturn, scores_filter, ...)
    TestGPTOSS->>AccuracyTask: task.evaluate(llm, **task_kwargs)
    AccuracyTask->>LmEvalEvaluator: evaluate(..., scores_filter=..., fewshot_as_multiturn=...)
    LmEvalEvaluator->>lm_eval: lm_eval.evaluate(..., fewshot_as_multiturn=...)
    lm_eval-->>LmEvalEvaluator: metrics
    LmEvalEvaluator-->>AccuracyTask: aggregated/filtered score
    AccuracyTask-->>TestGPTOSS: result/assertions
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • test: add accuracy reference #6479 — Modifies the same accuracy reference file tests/integration/defs/accuracy/references/gsm8k.yaml (related updates to reference accuracies).

Suggested labels

Community want to contribute, CI

Suggested reviewers

  • litaotju
  • yilin-void
  • LarryXFly
  • StanleySun639
  • pamelap-nvidia

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1643c8 and 0d72dd8.

📒 Files selected for processing (1)
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
⏰ 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
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Tracin
Copy link
Collaborator Author

Tracin commented Aug 8, 2025

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

@tensorrt-cicd
Copy link
Collaborator

PR_Github #14563 [ run ] triggered by Bot

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: 1

🧹 Nitpick comments (1)
tests/integration/test_lists/test-db/l0_dgx_h100.yml (1)

123-144: Good addition but TRTLLM backend coverage is missing

Nice to see a dedicated gpt_oss auto-trigger block for 4-GPU H100 nodes.
However, unlike the B200 list, TRTLLM back-ends are not included for the tp4/ep4/dp4 cases. For consistency (and to catch TRTLLM-specific regressions) consider adding them:

+  - accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[tp4-TRTLLM]
+  - accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[ep4-TRTLLM]
+  - accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[dp4-TRTLLM]

If TRTLLM is intentionally excluded on H100, please document the rationale to avoid confusion later.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aee828d and eabdbf0.

📒 Files selected for processing (8)
  • tensorrt_llm/evaluate/interface.py (1 hunks)
  • tensorrt_llm/evaluate/lm_eval.py (7 hunks)
  • tests/integration/defs/accuracy/accuracy_core.py (2 hunks)
  • tests/integration/defs/accuracy/references/gsm8k.yaml (1 hunks)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py (7 hunks)
  • tests/integration/test_lists/qa/llm_function_full.txt (1 hunks)
  • tests/integration/test_lists/test-db/l0_b200.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code 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 filenames should use snake_case (e.g., some_file.py).
Python classes should use PascalCase (e.g., class SomeClass).
Python functions and methods should use snake_case (e.g., def my_awesome_function():).
Python local variables should use snake_case. Prefix k for variable names that start with a number (e.g., k_99th_percentile).
Python global variables should use upper snake_case and prefix G (e.g., G_MY_GLOBAL).
Python constants should use upper snake_case (e.g., 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 interfaces that may be used outside a Python file, prefer docstrings over comments.
Comments in Python should be reserved for code within a function, or interfaces that are local to a file.
Use Google style docstrings for Python classes and functions, which can be parsed by Sphinx.
Attributes and variables in Python can be documented inline; attribute docstrings will be rendered under the class docstring.
Avoid using reflection in Python when functionality can be easily achieved without it.
When using try-except blocks in Python, limit the except to the smallest set of errors possible.
When using try-except blocks to handle multiple possible variable types in Python, keep the body of the try as small as possible, using the else block to implement the logic.

Files:

  • tensorrt_llm/evaluate/interface.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/evaluate/lm_eval.py
  • tests/integration/defs/accuracy/accuracy_core.py
**/*.{cpp,h,hpp,cc,cxx,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • tensorrt_llm/evaluate/interface.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/evaluate/lm_eval.py
  • tests/integration/defs/accuracy/accuracy_core.py
🧠 Learnings (4)
📓 Common learnings
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#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.
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#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/test_lists/test-db/l0_b200.yml
  • tests/integration/test_lists/qa/llm_function_full.txt
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tensorrt_llm/evaluate/lm_eval.py
📚 Learning: 2025-08-06T13:58:07.506Z
Learnt from: galagam
PR: NVIDIA/TensorRT-LLM#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/test-db/l0_b200.yml
  • tests/integration/test_lists/qa/llm_function_full.txt
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
📚 Learning: 2025-07-17T09:01:27.402Z
Learnt from: amitz-nv
PR: NVIDIA/TensorRT-LLM#5616
File: tensorrt_llm/executor/worker.py:375-384
Timestamp: 2025-07-17T09:01:27.402Z
Learning: In tensorrt_llm/executor/worker.py, the LoRA adapter cache optimization logic that checks `is_adapter_in_cpu_cache()` and conditionally passes None for weights/config has a known race condition issue that cannot be solved with simple error handling or verification checks. This is a known limitation that requires a more comprehensive solution.

Applied to files:

  • tests/integration/test_lists/test-db/l0_b200.yml
🧬 Code Graph Analysis (1)
tensorrt_llm/evaluate/interface.py (1)
tensorrt_llm/evaluate/lm_eval.py (1)
  • apply_chat_template (54-64)
🔇 Additional comments (22)
tensorrt_llm/evaluate/interface.py (1)

36-42: LGTM! Clean implementation of the new evaluation mode parameter.

The addition of fewshot_as_multiturn parameter follows Python conventions with proper type annotation, reasonable default value, and correct instance attribute assignment.

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

162-168: LGTM! Accuracy improvements with new evaluation mode.

The consistent improvement from 88.5 to 90.3 across GPT-OSS model variants reflects the benefits of the new fewshot_as_multiturn evaluation approach for GSM8K tasks.

tests/integration/test_lists/qa/llm_function_full.txt (1)

522-534: LGTM! Comprehensive test coverage for GPT-OSS GSM8K evaluation.

The new test entries provide thorough coverage across different GPU configurations (1 and 4 GPUs), parallelism strategies (tp4, ep4, dp4), backends (CUTLASS, TRTLLM, TRITON), and quantization schemes (w4, w4a16). This aligns well with the PR objective to add GSM8K tests for the GPT-OSS model.

tests/integration/defs/accuracy/accuracy_core.py (2)

195-199: LGTM! Clean implementation of scores filtering support.

The conditional assignment of scores_filter and its integration into the evaluator call is well-implemented, supporting the new selective metric reporting capability.


301-301: LGTM! Proper class attribute definition for scores filtering.

The explicit definition of SCORES_FILTER = None establishes clear default behavior for GSM8K tasks and follows the established class attribute naming conventions.

tests/integration/defs/accuracy/test_llm_api_pytorch.py (8)

2464-2464: LGTM: Clean refactor to class constant

The MODEL_PATH constant is a good improvement over the previous method call approach, making the model path more accessible and efficient.


2466-2471: LGTM: Correct implementation of new evaluation features

This method properly implements the core PR objective by enabling the fewshot_as_multiturn flag and related evaluation parameters. The configuration is appropriate for GSM8K mathematical reasoning tasks with flexible score extraction.


2486-2486: LGTM: Consistent usage of MODEL_PATH constant

The usage of self.MODEL_PATH is correct and consistent with the refactoring approach.


2497-2497: LGTM: Proper application of task configuration

The call to self.update_task_kwargs(task) correctly applies the new evaluation parameters before running the GSM8K evaluation.


2535-2535: LGTM: Consistent task configuration

Proper application of the update_task_kwargs method to configure the GSM8K task with the new evaluation parameters.


2565-2565: LGTM: Complete test coverage

The task configuration is properly applied in the w4a16 test method, ensuring all test variants use the new fewshot_as_multiturn functionality.


2523-2523: LGTM: Consistent MODEL_PATH usage

Proper usage of the MODEL_PATH constant in the multi-GPU test method.


2554-2554: LGTM: Complete refactoring

The MODEL_PATH constant is correctly used in the w4a16 test method, completing the refactoring.

tensorrt_llm/evaluate/lm_eval.py (9)

135-135: LGTM! Parameter addition follows the existing pattern.

The fewshot_as_multiturn parameter is correctly added with a default value of False, maintaining backward compatibility while enabling the new functionality.


147-147: LGTM! Parameter properly propagated to superclass.

The fewshot_as_multiturn parameter is correctly passed to the parent Evaluator class constructor, maintaining the inheritance chain properly.


195-196: LGTM! Method signature enhancement with proper defaults.

The addition of streaming and scores_filter parameters to the evaluate method follows good practices:

  • Both parameters have sensible defaults (False and None)
  • The scores_filter parameter enables selective metric reporting as described in the AI summary

198-204: LGTM! Proper integration with lm_eval library.

The lm_eval.evaluate call is updated correctly:

  • All new parameters are properly passed through
  • The fewshot_as_multiturn parameter enables the new evaluation mode
  • Parameter names match the lm_eval API expectations

213-223: LGTM! Flexible scoring logic with proper fallback.

The conditional logic for score filtering is well-implemented:

  • When scores_filter is provided, it returns the specific filtered metric
  • Falls back to the original average accuracy calculation when no filter is specified
  • Both paths include appropriate logging for transparency

233-234: LGTM! CLI parameter handling follows the established pattern.

The fewshot_as_multiturn parameter is correctly extracted from kwargs with the appropriate default value, consistent with other CLI parameters in the method.


268-271: LGTM! CLI option definition follows Click conventions.

The CLI option for fewshot_as_multiturn is properly defined:

  • Uses is_flag=True for boolean behavior
  • Has appropriate default value (False)
  • Includes descriptive help text

287-290: LGTM! Important validation logic for parameter dependencies.

The assertion correctly enforces the business rule that apply_chat_template must be True when fewshot_as_multiturn is True. This prevents invalid configurations and provides clear error messaging.


144-144: No change needed: the explicit import lm_eval.tasks is required

The submodule lm_eval.tasks must be explicitly imported to populate lm_eval.tasks in sys.modules; otherwise, lm_eval.tasks.TaskManager and lm_eval.tasks.get_task_dict would raise an AttributeError.

  • tensorrt_llm/evaluate/lm_eval.py line 144: keep import lm_eval.tasks as is.

Likely an incorrect or invalid review comment.

Signed-off-by: Tracin <10434017+Tracin@users.noreply.github.com>
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/test_lists/test-db/l0_dgx_b200.yml (1)

73-81: Optional: add a pipeline-parallel variant if supported (pp4 or tp2pp2).

Other tests in this file exercise pp4/tp2pp2 on 4 GPUs. If TestGPTOSS supports it, consider adding one to catch PP-specific regressions.

Example additions (only if supported by TestGPTOSS):

+  - accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[pp4-TRTLLM]
+  - accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[tp2pp2-TRTLLM]
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eabdbf0 and 53148fb.

📒 Files selected for processing (4)
  • tests/integration/defs/accuracy/accuracy_core.py (2 hunks)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py (7 hunks)
  • tests/integration/test_lists/test-db/l0_b200.yml (1 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/integration/test_lists/test-db/l0_b200.yml
  • tests/integration/defs/accuracy/accuracy_core.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#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/test_lists/test-db/l0_dgx_b200.yml
📚 Learning: 2025-08-06T13:58:07.506Z
Learnt from: galagam
PR: NVIDIA/TensorRT-LLM#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/test-db/l0_dgx_b200.yml
⏰ 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 (4)
tests/integration/test_lists/test-db/l0_dgx_b200.yml (4)

73-81: Solid coverage expansion for GPT-OSS on 4xB200.

The tp/ep/dp × CUTLASS/TRTLLM/TRITON matrix looks consistent with the suite’s 4-GPU constraint and post-merge scope. Good placement and naming.


82-82: Confirmed: test_w4a16 only supports “dp4”
The TestGPTOSS::test_w4a16 function is parametrized with a single (4,1,4,True,True,True) entry and the ids=["dp4"] marker, so listing only the dp4 variant in the YAML is intentional and correct.


73-81: TRITON MOE backend gating is already in place
The “TRITON” option here refers to the fused-MOE Triton-kernels backend (not Triton Inference Server), and each test skips appropriately when it’s unavailable or the SM version is too old:

• tests/integration/defs/accuracy/test_llm_api_pytorch.py
– test_w4a8_mxfp4 (≈ lines 2231–2236): skips if IS_TRITON_KERNELS_AVAILABLE is false or SM < 90
– test_w4_1gpu (≈ lines 2479–2481): skips if IS_TRITON_KERNELS_AVAILABLE is false
– test_w4_4gpus (≈ lines 2511–2516): skips if IS_TRITON_KERNELS_AVAILABLE is false or tp_size != ep_size

No Triton Inference Server setup or additional skip markers are needed here.


73-81: Test W4_4gpus parameter IDs are defined correctly

Verified in tests/integration/defs/accuracy/test_llm_api_pytorch.py that TestGPTOSS::test_w4_4gpus is decorated with:

  • @pytest.mark.parametrize("moe_backend", ["CUTLASS","TRTLLM","TRITON"])
  • @pytest.mark.parametrize("tp_size,pp_size,ep_size,attention_dp,cuda_graph,overlap_scheduler", …, ids=["tp4","ep4","dp4"])

This produces exactly the nine permutations [tp4-CUTLASS], [tp4-TRTLLM], [tp4-TRITON], [ep4-CUTLASS], …, [dp4-TRITON] referenced in the YAML. No changes required.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #14563 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #11003 completed with status: 'FAILURE'

@Tracin
Copy link
Collaborator Author

Tracin commented Aug 9, 2025

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

@tensorrt-cicd
Copy link
Collaborator

PR_Github #14675 [ run ] triggered by Bot

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: 1

🔭 Outside diff range comments (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (1)

2556-2563: Bug: LLM kwarg should be moe_config, not moe_backend

LLM does not accept a moe_backend kwarg elsewhere in this file; all other usages pass moe_config=MoeConfig(...). This will likely raise a TypeError.

-        llm = LLM(self.MODEL_PATH,
+        llm = LLM(self.MODEL_PATH,
                   tensor_parallel_size=tp_size,
                   pipeline_parallel_size=pp_size,
                   moe_expert_parallel_size=ep_size,
                   kv_cache_config=self.kv_cache_config,
                   **pytorch_config,
                   enable_attention_dp=attention_dp,
-                  moe_backend="TRITON")
+                  moe_config=MoeConfig(backend="TRITON"))
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53148fb and e1643c8.

📒 Files selected for processing (3)
  • tensorrt_llm/evaluate/lm_eval.py (7 hunks)
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py (7 hunks)
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • tensorrt_llm/evaluate/lm_eval.py
  • tests/integration/test_lists/test-db/l0_dgx_h100.yml
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

**/*.py: Python code 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 filenames should use snake_case (e.g., some_file.py).
Python classes should use PascalCase (e.g., class SomeClass).
Python functions and methods should use snake_case (e.g., def my_awesome_function():).
Python local variables should use snake_case. Prefix k for variable names that start with a number (e.g., k_99th_percentile).
Python global variables should use upper snake_case and prefix G (e.g., G_MY_GLOBAL).
Python constants should use upper snake_case (e.g., 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 interfaces that may be used outside a Python file, prefer docstrings over comments.
Comments in Python should be reserved for code within a function, or interfaces that are local to a file.
Use Google style docstrings for Python classes and functions, which can be parsed by Sphinx.
Attributes and variables in Python can be documented inline; attribute docstrings will be rendered under the class docstring.
Avoid using reflection in Python when functionality can be easily achieved without it.
When using try-except blocks in Python, limit the except to the smallest set of errors possible.
When using try-except blocks to handle multiple possible variable types in Python, keep the body of the try as small as possible, using the else block to implement the logic.

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.{cpp,h,hpp,cc,cxx,cu,py}

📄 CodeRabbit Inference Engine (CODING_GUIDELINES.md)

All TensorRT-LLM Open Source Software code should contain an NVIDIA copyright header that includes the current year. This includes .cpp, .h, .cu, .py, and any other source files which are compiled or interpreted.

Files:

  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧠 Learnings (2)
📚 Learning: 2025-07-28T17:06:08.621Z
Learnt from: moraxu
PR: NVIDIA/TensorRT-LLM#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_llm_api_pytorch.py
📚 Learning: 2025-08-06T13:58:07.506Z
Learnt from: galagam
PR: NVIDIA/TensorRT-LLM#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/defs/accuracy/test_llm_api_pytorch.py
⏰ 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 (2)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (2)

2488-2494: LLM init path refactor looks good

Switching to the class-level MODEL_PATH is clean and consistent with other tests.


2525-2533: 4-GPU LLM init matches surrounding patterns

Consistent with other tests and uses MoeConfig correctly.

@tensorrt-cicd
Copy link
Collaborator

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

@Tracin Tracin enabled auto-merge (squash) August 11, 2025 02:05
Tracin added 2 commits August 11, 2025 10:06
Signed-off-by: Tracin <10434017+Tracin@users.noreply.github.com>
Signed-off-by: Tracin <10434017+Tracin@users.noreply.github.com>
@Tracin Tracin changed the title Add gpt-oss GSM8K test. [None][feat] Add gpt-oss GSM8K test. Aug 11, 2025
@Tracin
Copy link
Collaborator Author

Tracin commented Aug 11, 2025

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #14726 [ reuse-pipeline ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #14726 [ reuse-pipeline ] completed with state SUCCESS
Reusing PR_Github #14675 for commit 0d72dd8

@Tracin Tracin merged commit 49bcaa4 into NVIDIA:main Aug 11, 2025
4 of 6 checks passed
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.

3 participants