-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[TRTLLM-6642][feat] add gptoss 20g tests #7361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds a 2-GPU GPT-OSS test to the PyTorch LLM accuracy suite, adjusts an existing 1-GPU test model path, lowers a memory skip threshold, and updates multiple test lists (QA, sanity, NIM, DGX B200 test-db, waives) to expand and selectively skip GPT-OSS variants across backends and parallelism modes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant T as TestGPTOSS (pytest)
participant L as LLM.init (PyTorch)
participant B as Backend (CUTLASS/TRTLLM/TRITON)
participant E as Evaluator (GSM8K)
participant D as Dataset (GSM8K)
Note over T: test_w4_1gpu / test_w4_2gpus
T->>L: Construct LLM(model_path=gpt-oss-20b,<br/>gpus=1 or 2, max_seq_len=8192,<br/>MoeConfig(backend))
L->>B: Initialize kernels / runtime<br/>(triton check if needed)
T->>E: Run evaluation(extra_evaluator_kwargs)
E->>D: Load samples
E->>L: Generate answers
L->>B: Execute inference (tp/ep/dp as configured)
E-->>T: Return metrics
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
b44d830
to
3f48a46
Compare
3ff58ed
to
61783c7
Compare
/bot run |
PR_Github #17501 [ run ] triggered by Bot |
/bot run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (4)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (4)
2857-2857
: Avoid shadowing class attribute MODEL_PATH.Using a local MODEL_PATH for the 20B path shadows the class-level 120B path and can confuse readers. Rename the local to model_path_20b.
Apply:
- MODEL_PATH = f"{llm_models_root()}/gpt_oss/gpt-oss-20b" + model_path_20b = f"{llm_models_root()}/gpt_oss/gpt-oss-20b"
2868-2875
: Use the renamed variable for clarity.Apply:
- llm = LLM(MODEL_PATH, + llm = LLM(model_path_20b, tensor_parallel_size=1, pipeline_parallel_size=1, moe_expert_parallel_size=1, kv_cache_config=self.kv_cache_config, **pytorch_config, moe_config=MoeConfig(backend=moe_backend))
2971-2975
: Minor: duplicate 20B path string.The 20B path is now defined in two tests. Consider a class-level MODEL_PATH_20B or a small helper to DRY.
If desired, add near line 2846:
MODEL_PATH_20B = f"{llm_models_root()}/gpt_oss/gpt-oss-20b"Then use MODEL_PATH_20B in both tests.
2980-2989
: Max seq len only set for 2-GPU.Not wrong, but it diverges from 1-GPU/4-GPU configs. If this was added to avoid warmup OOM, consider a brief comment to document the rationale.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
tests/integration/defs/accuracy/test_llm_api_pytorch.py
(4 hunks)tests/integration/test_lists/qa/llm_function_full.txt
(1 hunks)tests/integration/test_lists/qa/llm_function_nim.txt
(1 hunks)tests/integration/test_lists/qa/llm_function_sanity.txt
(1 hunks)tests/integration/test_lists/test-db/l0_dgx_b200.yml
(1 hunks)tests/integration/test_lists/waives.txt
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Filenames compiled into a target must be case-insensitively unique
Files:
tests/integration/test_lists/qa/llm_function_nim.txt
tests/integration/test_lists/qa/llm_function_sanity.txt
tests/integration/test_lists/waives.txt
tests/integration/defs/accuracy/test_llm_api_pytorch.py
tests/integration/test_lists/test-db/l0_dgx_b200.yml
tests/integration/test_lists/qa/llm_function_full.txt
**/*.{h,hpp,hh,hxx,cc,cpp,cxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Use spaces, not tabs; indent 4 spaces
Files:
tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py
: Code must target Python 3.8+
Indent with 4 spaces; do not use tabs (Python)
Maintain module namespace on import: prefer from package.subpackage import foo; use foo.Symbol()
Python filenames use snake_case
Python class names use PascalCase
Python functions and methods use snake_case
Python local variables use snake_case; if starting with a number concept, prefix with k (e.g., k_99th_percentile)
Python global variables use G_ prefix with UPPER_SNAKE_CASE
Python constants use UPPER_SNAKE_CASE
Avoid shadowing variables from outer scopes
Initialize all externally visible class members in init
For public interfaces, prefer docstrings over comments; comments should be for in-function or file-local interfaces
Use Google-style docstrings for classes and functions (Sphinx-parsable)
Document attributes and variables inline with docstrings immediately after assignment
Avoid reflection when a non-reflective approach suffices
Limit except clauses to specific exceptions where possible
When using try/except for duck-typing, keep try body minimal and move logic to else
Files:
tests/integration/defs/accuracy/test_llm_api_pytorch.py
**/*.{cpp,cc,cxx,h,hpp,hh,hxx,cu,cuh,py}
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
Prepend NVIDIA copyright header (current year) to all source files
Files:
tests/integration/defs/accuracy/test_llm_api_pytorch.py
🧠 Learnings (4)
📓 Common learnings
Learnt from: pengbowang-nv
PR: NVIDIA/TensorRT-LLM#7192
File: tests/integration/test_lists/test-db/l0_dgx_b200.yml:56-72
Timestamp: 2025-08-26T09:49:04.956Z
Learning: In TensorRT-LLM test configuration files, the test scheduling system handles wildcard matching with special rules that prevent duplicate test execution even when the same tests appear in multiple yaml files with overlapping GPU wildcards (e.g., "*b200*" and "*gb200*").
📚 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/qa/llm_function_nim.txt
tests/integration/test_lists/qa/llm_function_sanity.txt
tests/integration/defs/accuracy/test_llm_api_pytorch.py
tests/integration/test_lists/test-db/l0_dgx_b200.yml
tests/integration/test_lists/qa/llm_function_full.txt
📚 Learning: 2025-08-26T09:49:04.956Z
Learnt from: pengbowang-nv
PR: NVIDIA/TensorRT-LLM#7192
File: tests/integration/test_lists/test-db/l0_dgx_b200.yml:56-72
Timestamp: 2025-08-26T09:49:04.956Z
Learning: In TensorRT-LLM test configuration files, the test scheduling system handles wildcard matching with special rules that prevent duplicate test execution even when the same tests appear in multiple yaml files with overlapping GPU wildcards (e.g., "*b200*" and "*gb200*").
Applied to files:
tests/integration/test_lists/qa/llm_function_sanity.txt
tests/integration/test_lists/waives.txt
tests/integration/test_lists/test-db/l0_dgx_b200.yml
tests/integration/test_lists/qa/llm_function_full.txt
📚 Learning: 2025-08-29T14:07:45.863Z
Learnt from: EmmaQiaoCh
PR: NVIDIA/TensorRT-LLM#7370
File: tests/unittest/trt/model_api/test_model_quantization.py:24-27
Timestamp: 2025-08-29T14:07:45.863Z
Learning: In TensorRT-LLM's CI infrastructure, pytest skip markers (pytest.mark.skip) are properly honored even when test files have __main__ blocks that call test functions directly. The testing system correctly skips tests without requiring modifications to the __main__ block execution pattern.
Applied to files:
tests/integration/test_lists/waives.txt
🧬 Code graph analysis (1)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (4)
tests/integration/defs/conftest.py (1)
llm_models_root
(77-83)tensorrt_llm/llmapi/llm.py (1)
LLM
(1013-1029)tensorrt_llm/llmapi/llm_args.py (2)
CudaGraphConfig
(108-165)MoeConfig
(168-196)tests/integration/defs/accuracy/accuracy_core.py (3)
GSM8K
(293-308)evaluate
(147-206)evaluate
(707-717)
⏰ 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 (6)
tests/integration/defs/accuracy/test_llm_api_pytorch.py (2)
2838-2839
: Lowered memory gate: please verify 120B 4-GPU still safe on 80 GB devices.Dropping skip_less_device_memory from 100000 to 80000 widens coverage but may risk OOM for the 120B 4-GPU cases on 80 GB SKUs if fragmentation spikes. Consider per-test gating (80 GB for 20B 1/2-GPU; higher for 120B 4-GPU) if we see flakes.
2956-2969
: Nice addition: 2-GPU coverage across tp/ep/dp and backends.Param matrix and TRITON availability guard look good.
tests/integration/test_lists/test-db/l0_dgx_b200.yml (1)
121-121
: Good addition: add dp4-cutlass to post-merge 4×B200.Matches existing matrix (dp4-trtllm/triton present). Ordering and id format align with test parametrization; scheduling’s wildcard rules will avoid dupes across files.
tests/integration/test_lists/qa/llm_function_nim.txt (1)
13-34
: NIM list expansion looks consistent with param ids.
- 1-GPU ids:
(cuda_graph, overlap_scheduler, backend)
→True-True-<backend>
- 2/4-GPU ids:
(tp/ep/dp)-(backend)
, matching source decorators- Consider sorting blocks by backend or world-size for readability if this grows
To sanity-check collection names locally run:
#!/bin/bash pytest -q --collect-only tests/integration/defs/accuracy/test_llm_api_pytorch.py::TestGPTOSS \ | rg -n -C0 "test_w4_(1gpu|2gpus|4gpus)"tests/integration/test_lists/qa/llm_function_sanity.txt (1)
51-59
: Param IDs align with test definition; no action required.tests/integration/test_lists/qa/llm_function_full.txt (1)
553-571
: GPTOSS GPU-grid model-paths are correct
1/2-GPU cases explicitly override MODEL_PATH to gpt-oss-20b; 4-GPU cases inherit the class-level MODEL_PATH (gpt-oss-120b) as intended.
Nit: group the new 1G/2G/4G test blocks under comment headers to prevent future drift.
PR_Github #17505 [ run ] triggered by Bot |
PR_Github #17501 [ run ] completed with state |
/bot run |
PR_Github #17508 [ run ] triggered by Bot |
PR_Github #17505 [ run ] completed with state |
61783c7
to
3fc14ac
Compare
PR_Github #17508 [ run ] completed with state |
d2e57ba
to
05bf970
Compare
Signed-off-by: Xin He (SW-GPU) <[email protected]>
05bf970
to
9b87837
Compare
/bot reuse-pipeline |
PR_Github #17752 [ reuse-pipeline ] triggered by Bot |
PR_Github #17752 [ reuse-pipeline ] completed with state |
Signed-off-by: Xin He (SW-GPU) <[email protected]>
Summary by CodeRabbit
Description
add gpt-oss 20g test cases,
gpt-oss 20g -> 1/2 gpu
gpt-oss 120g -> 4gpus
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
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.
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 thestage-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.