KEMBAR78
[None][feat] GPT-OSS Sm120/Sm121 Support by farazkh80 · Pull Request #7937 · NVIDIA/TensorRT-LLM · GitHub
Skip to content

Conversation

@farazkh80
Copy link
Collaborator

@farazkh80 farazkh80 commented Sep 23, 2025

Description

Adding gpt-oss support for sm120 and SM121. The main changes include

  • Attention sink support in fmha for SM120/121 by @PerkzZheng
  • Custom cublass GEMM algo optimized for spark by @ttyio
  • Mixed FP8×FP4 CUTLASS Group GEMM by @farazkh80 @djns99 for SM120.

Test Coverage

E2E functionality tests

Added

test_e2e.py::test_ptp_quickstart_advanced[GPT-OSS-20B-gpt_oss/gpt-oss-20b]
test_e2e.py::test_ptp_quickstart_advanced[GPT-OSS-120B-gpt_oss/gpt-oss-120b]

to tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml

Accuracy tests

Added

accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_1gpu[True-True-cutlass-auto]

to tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml

Using trtllm-serve openai/gpt-oss-20b and ns eval

nemo-run_1/0 ----------------------------------------- mmlu ----------------------------------------
nemo-run_1/0 evaluation_mode | num_entries | avg_tokens | gen_seconds | symbolic_correct | no_answer
nemo-run_1/0 pass@1          | 14042       | 132        | 252         | 81.14%           | 0.25%

Using trtllm-serve openai/gpt-oss-120b and ns eval

nemo-run_1/0 ----------------------------------------- mmlu ----------------------------------------
nemo-run_1/0 evaluation_mode | num_entries | avg_tokens | gen_seconds | symbolic_correct | no_answer
nemo-run_1/0 pass@1          | 14042       | 107        | 338         | 85.70%           | 0.13%

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 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.

@farazkh80 farazkh80 force-pushed the faraz_tot_spark_gpt_oss_new branch from 7b01eef to d4dd185 Compare September 24, 2025 01:22
Copy link
Collaborator

@PerkzZheng PerkzZheng left a comment

Choose a reason for hiding this comment

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

@farazkh80 have those tests been added automatically to sm120 machines ? the changes in fmha_v2 LGTM.

@farazkh80 farazkh80 changed the title GPT-OSS Spark Support [None][feat]GPT-OSS Spark Support Sep 24, 2025
@farazkh80 farazkh80 changed the title [None][feat]GPT-OSS Spark Support [None][feat]GPT-OSS Sm120/Sm121 Support Sep 29, 2025
@farazkh80 farazkh80 force-pushed the faraz_tot_spark_gpt_oss_new branch from 4632598 to 1e2bae7 Compare September 29, 2025 22:49
@farazkh80 farazkh80 changed the title [None][feat]GPT-OSS Sm120/Sm121 Support [None][feat] GPT-OSS Sm120/Sm121 Support Sep 29, 2025
@farazkh80 farazkh80 force-pushed the faraz_tot_spark_gpt_oss_new branch from 1e2bae7 to 9be265c Compare September 29, 2025 22:50
@farazkh80 farazkh80 requested a review from ttyio October 2, 2025 02:17
PerkzZheng and others added 16 commits October 1, 2025 22:19
…emove assert

This commit consolidates improvements from three changes:
- Added support for attention sinks in Ampere-style kernels
- Fixed FP8 FMHA kernels
- Removed unnecessary assert

Signed-off-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
1. support bias epilog for cublaslt backend
2. replace torch native mm with trtllm mm for sm121 gpt-oss
3. add lookup table for the gpt-oss gemm for sm121

Signed-off-by: Vincent Huang <vincenth@nvidia.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
@farazkh80 farazkh80 removed request for ttyio and yuxianq October 2, 2025 22:06
@tensorrt-cicd
Copy link
Collaborator

PR_Github #20529 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15487 completed with status: 'SUCCESS'

@farazkh80
Copy link
Collaborator Author

/bot run --stage-list "RTXPro6000-PyTorch-Post-Merge-1"

@NVIDIA NVIDIA deleted a comment from tensorrt-cicd Oct 3, 2025
@NVIDIA NVIDIA deleted a comment from tensorrt-cicd Oct 3, 2025
@farazkh80 farazkh80 requested a review from dongfengy October 3, 2025 12:50
@tensorrt-cicd
Copy link
Collaborator

PR_Github #20582 [ run ] triggered by Bot

@farazkh80
Copy link
Collaborator Author

hey @dongfengy could I kindly get your review on this please? seems like all tests look good.

@rnik12
Copy link

rnik12 commented Oct 3, 2025

Will this PR work for tp=2 RTX 5060 TI ?

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20582 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #15536 (Partly Tested) completed with status: 'SUCCESS'

@farazkh80
Copy link
Collaborator Author

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20659 [ reuse-pipeline ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #20659 [ reuse-pipeline ] completed with state SUCCESS
Reusing PR_Github #20582 (Partly Tested) for commit 15e86da

Copy link
Collaborator

@mikeiovine mikeiovine left a comment

Choose a reason for hiding this comment

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

Stamping to unblock, @dongfengy's review should be sufficient for this one

@farazkh80 farazkh80 merged commit 27a5091 into NVIDIA:main Oct 6, 2025
7 checks passed
@voipmonitor
Copy link

@farazkh80 hello, I have build fresh docker with this merged PR so I can test it on RTX 6000 PRO but I'm getting this error:

GPUassert: invalid argument /src/tensorrt_llm/cpp/tensorrt_llm/kernels/tinygemm2/tinygemm2_cuda.cu 64

How is it supposed to run please? I'm running it with:

trtllm-serve /mnt/gpt-oss-120b --host 0.0.0.0 --port 4997

@farazkh80
Copy link
Collaborator Author

hi @voipmonitor could you please create an issue and post your reproduction steps? thanks!

@voipmonitor
Copy link

farazkh80

sure, #8179

farazkh80 added a commit to farazkh80/TensorRT-LLM that referenced this pull request Oct 21, 2025
Signed-off-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: Vincent Huang <vincenth@nvidia.com>
Co-authored-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Co-authored-by: Vincent Huang <vincenth@nvidia.com>
farazkh80 added a commit to farazkh80/TensorRT-LLM that referenced this pull request Oct 21, 2025
Signed-off-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: Vincent Huang <vincenth@nvidia.com>
Co-authored-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Co-authored-by: Vincent Huang <vincenth@nvidia.com>
farazkh80 added a commit to farazkh80/TensorRT-LLM that referenced this pull request Oct 24, 2025
Signed-off-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: Vincent Huang <vincenth@nvidia.com>
Co-authored-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Co-authored-by: Vincent Huang <vincenth@nvidia.com>
farazkh80 added a commit to farazkh80/TensorRT-LLM that referenced this pull request Oct 24, 2025
Signed-off-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
Signed-off-by: Vincent Huang <vincenth@nvidia.com>
Co-authored-by: Perkz Zheng <67892460+PerkzZheng@users.noreply.github.com>
Co-authored-by: Vincent Huang <vincenth@nvidia.com>
Signed-off-by: list <58580514+farazkh80@users.noreply.github.com>
@zmarty
Copy link

zmarty commented Oct 24, 2025

Model: gpt-oss-120b
GPU: RTX Pro 6000 Workstation

vllm v0.11.0 decoding: about 180 tokens/sec

Model Name,Time To First Token,Prompt Tok/s,Response Tok/s,Num Response Tokens,Avg Tokens per Chunk,Avg Time Between Chunks
/models/original/gpt-oss-120b,0.11,732.97,185.09,2420,3.69,0.01
/models/original/gpt-oss-120b,0.01,6838.68,184.43,2446,3.80,0.01
/models/original/gpt-oss-120b,0.01,7526.01,187.88,2684,3.84,0.01
/models/original/gpt-oss-120b,0.01,7633.30,189.10,2958,3.93,0.01
/models/original/gpt-oss-120b,0.01,7669.99,177.66,2003,4.05,0.01
/models/original/gpt-oss-120b,0.01,7674.31,183.69,2396,4.04,0.01
/models/original/gpt-oss-120b,0.01,7617.48,189.71,2283,3.93,0.01
/models/original/gpt-oss-120b,0.01,7668.19,186.96,2451,4.01,0.01
/models/original/gpt-oss-120b,0.01,7646.50,177.60,2536,3.68,0.01
/models/original/gpt-oss-120b,0.01,7729.24,187.71,3094,3.88,0.01

TensorRT-LLM v1.2.0rc1 Docker image decoding: about 164 tokens/sec

Model Name,Time To First Token,Prompt Tok/s,Response Tok/s,Num Response Tokens,Avg Tokens per Chunk,Avg Time Between Chunks
/models/original/gpt-oss-120b,0.22,350.91,165.39,1864,3.96,0.01
/models/original/gpt-oss-120b,0.11,734.37,163.09,1820,4.03,0.01
/models/original/gpt-oss-120b,0.12,661.71,164.44,2308,4.05,0.01
/models/original/gpt-oss-120b,0.12,628.89,163.62,1895,4.12,0.01
/models/original/gpt-oss-120b,0.11,740.38,164.80,2182,4.00,0.01
/models/original/gpt-oss-120b,0.11,699.97,165.71,1829,4.15,0.01
/models/original/gpt-oss-120b,0.11,699.36,163.47,1824,4.12,0.01
/models/original/gpt-oss-120b,0.12,661.93,165.74,2059,4.07,0.01
/models/original/gpt-oss-120b,0.11,698.77,164.15,2006,3.96,0.01
/models/original/gpt-oss-120b,0.11,740.38,165.23,2247,3.96,0.01

Any ideas why? @PerkzZheng

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.