Skip to content

[#13816][feat] AutoDeploy: Optimize gpt-oss-120b perf - #14202

Merged
taylor-yb-lee merged 73 commits into
NVIDIA:mainfrom
nv-auto-deploy:taylor/gpt-oss-0511_rebase_0511
Jun 9, 2026
Merged

[#13816][feat] AutoDeploy: Optimize gpt-oss-120b perf#14202
taylor-yb-lee merged 73 commits into
NVIDIA:mainfrom
nv-auto-deploy:taylor/gpt-oss-0511_rebase_0511

Conversation

@taylor-yb-lee

@taylor-yb-lee taylor-yb-lee commented May 16, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Added MXFP4 quantization support for mixture-of-experts models enabling more efficient inference
    • Introduced enhanced GEMM fusion with bias support for improved model optimization
    • Added hardware-accelerated operations for modern GPU architectures (SM 100+)
  • Improvements

    • Updated GPT-OSS model configurations with BFloat16 precision and advanced optimization techniques
    • Enhanced model inference pipeline with fused kernels and improved sharding support
    • Improved accuracy benchmarks for large language model inference
  • Tests

    • Added comprehensive validation tests for MXFP4 quantization and fusion optimization

Review Change Stack

Description

Applied following changes and optimizations to improve AutoDeploy gpt-oss-120b performance.

  • Support trtllm-gen mxfp4 MoE kernel
  • Support W4A8 (mxfp4 + mxfp8) activation for trtllm-gen MoE
  • Fuse routing inside trtllm-gen MoE kernel
  • Fuse RoPE into trtllm attention kernel
  • TP sharding for trtllm-gen for stacked mxfp4 weights
  • Fuse QKV gemms w/ bias into one fused gemm

Test Coverage

  • GSM8K accuracy test passes for TP1/TP2/EP2
  • trtllmgen moe MXFP4 weight swizzling: singlegpu/custom_ops/moe/test_prepare_trtllm_gen_moe_mxfp4_weights.py
  • QKV gemms w/ bias : singlegpu/transformations/library/test_gemm_fusion.py

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.

@taylor-yb-lee
taylor-yb-lee force-pushed the taylor/gpt-oss-0511_rebase_0511 branch 2 times, most recently from 7498d08 to 6777892 Compare May 18, 2026 05:24
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49164 [ run ] triggered by Bot. Commit: e55b87e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49164 [ run ] completed with state SUCCESS. Commit: e55b87e
/LLM/main/L0_MergeRequest_PR pipeline #38843 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

@taylor-yb-lee
taylor-yb-lee force-pushed the taylor/gpt-oss-0511_rebase_0511 branch from e55b87e to b30701f Compare May 19, 2026 22:38
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #49270 [ run ] triggered by Bot. Commit: b30701f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@taylor-yb-lee
taylor-yb-lee force-pushed the taylor/gpt-oss-0511_rebase_0511 branch 2 times, most recently from 344e373 to ccf84bf Compare May 20, 2026 05:51

@galagam galagam left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Added some small comments, please ping me for another review when it's out of draft state 🙏

Comment thread examples/auto_deploy/model_registry/configs/gpt_oss_120b.yaml Outdated
Comment thread examples/auto_deploy/model_registry/configs/gpt_oss_120b.yaml
Comment thread examples/auto_deploy/model_registry/configs/gpt_oss_20b.yaml Outdated
Comment thread tensorrt_llm/_torch/auto_deploy/models/custom/modeling_gpt_oss.py
@taylor-yb-lee
taylor-yb-lee force-pushed the taylor/gpt-oss-0511_rebase_0511 branch 12 times, most recently from ae39981 to 5701a1d Compare May 20, 2026 09:41
@taylor-yb-lee
taylor-yb-lee marked this pull request as ready for review May 20, 2026 09:42
@taylor-yb-lee
taylor-yb-lee requested review from a team as code owners May 20, 2026 09:42
@taylor-yb-lee
taylor-yb-lee requested a review from hyukn May 20, 2026 09:42
- Uncomment gpt-oss-{20b,120b} in models.yaml; registry-driven accuracy
  tests raised ValueError ("not found in model registry") without them.
- gpt-oss world sizes: 20b=1, 120b=2; test_mxfp4_gsm8k now requires 2+ Blackwell GPUs.
- gpt_oss.yaml: vocab-parallel lm_head (shard_layers+=lm_head) + AUTO allreduce for TP.
- Gotcha: re-exposes these models to the external AutoDeploy dashboard.

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
@taylor-yb-lee
taylor-yb-lee force-pushed the taylor/gpt-oss-0511_rebase_0511 branch from d9f7f0f to 9210625 Compare June 8, 2026 18:35
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52841 [ run ] triggered by Bot. Commit: 9210625 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52841 [ run ] completed with state SUCCESS. Commit: 9210625
/LLM/main/L0_MergeRequest_PR pipeline #42094 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

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

…-uniform-window models"

This reverts commit 4c55168.

Signed-off-by: Taylor Yeonbok Lee <249374542+taylor-yb-lee@users.noreply.github.com>
@taylor-yb-lee
taylor-yb-lee force-pushed the taylor/gpt-oss-0511_rebase_0511 branch from bc54741 to a5c75d0 Compare June 8, 2026 22:21
@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52866 [ run ] triggered by Bot. Commit: a5c75d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52867 [ run ] triggered by Bot. Commit: a5c75d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52867 [ run ] completed with state SUCCESS. Commit: a5c75d0
/LLM/main/L0_MergeRequest_PR pipeline #42119 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

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #52866 [ run ] completed with state SUCCESS. Commit: a5c75d0
/LLM/main/L0_MergeRequest_PR pipeline #42118 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

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53002 [ run ] triggered by Bot. Commit: a5c75d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53002 [ run ] completed with state SUCCESS. Commit: a5c75d0
/LLM/main/L0_MergeRequest_PR pipeline #42229 completed with status: 'SUCCESS'

CI Report

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --extra-stage "DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1"

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot kill

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53099 [ run ] triggered by Bot. Commit: a5c75d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53100 [ kill ] triggered by Bot. Commit: a5c75d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53099 [ run ] completed with state ABORTED. Commit: a5c75d0

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53100 [ kill ] completed with state SUCCESS. Commit: a5c75d0
Successfully killed previous jobs for commit a5c75d0

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast --stage-list "DGX_B200-8_GPUs-AutoDeploy-Post-Merge-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53112 [ run ] triggered by Bot. Commit: a5c75d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53112 [ run ] completed with state SUCCESS. Commit: a5c75d0
/LLM/main/L0_MergeRequest_PR pipeline #42319 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@taylor-yb-lee

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53153 [ run ] triggered by Bot. Commit: a5c75d0 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #53153 [ run ] completed with state SUCCESS. Commit: a5c75d0
/LLM/main/L0_MergeRequest_PR pipeline #42357 completed with status: 'SUCCESS'

CI Report

Link to invocation

@taylor-yb-lee
taylor-yb-lee merged commit ffcd8e6 into NVIDIA:main Jun 9, 2026
7 checks passed
greg-kwasniewski1 added a commit to nv-auto-deploy/TensorRT-LLM that referenced this pull request Jun 10, 2026
Conflict resolution summary:

* examples/auto_deploy/model_registry/models.yaml: took upstream/main
  (added ``enable_sharder_ir.yaml`` to several model registries +
  commented out OOM-prone configs).
* tensorrt_llm/_torch/auto_deploy/config/default.yaml: took upstream/main
  (adds the ``apply_sharding_hints`` registration block with
  ``enabled: false`` default).
* tests/.../conftest.py: kept HEAD (test renamed to
  ``test_sharding_num_correctness`` + dual-path IR/legacy docstring +
  Eagle-draft fixture).
* tests/.../test_sharding_num_correctness.py: kept HEAD (renamed file +
  dedup using production ``is_shardingIR_enabled`` + dropped erroneous
  pytest.skip-in-spawn-worker + granite skip-list).
* .claude/skills/ad-sharding-ir-port/SKILL.md: kept HEAD (Step 9 wording
  + Step 9 legacy-override paragraph; upstream had older equivalents).
* tensorrt_llm/_torch/auto_deploy/models/custom/modeling_gpt_oss.py:
  took upstream/main's IR-port skeleton (from PR NVIDIA#14202) and re-applied
  HEAD's ``enable_sharding=True, layer_type="mha"`` on the
  ``torch_attention(...)`` call. The upstream port is structurally
  complete (Q/K/V/O linears, head views, all_reduce) but doesn't slice
  ``sinks`` -- the per-head learnable param flowing directly into
  ``torch_attention``. ``WeightedParamShardableNode`` (now registered
  for ``torch_attention`` in HEAD's ``sharding_ir.py``) needs
  ``enable_sharding=True`` to fire and slice ``sinks`` along dim 0
  per rank, matching the post-shard head count from Q/K/V's colwise.
  Without this kwarg the IR path crashes at
  ``sinks.expand(b, n_heads/TP, ...)`` because ``sinks.numel() = num_heads_full``.

  This gap existed but never surfaced in CI: the dispatcher bug fixed
  in HEAD (``is_shardingIR_enabled`` using ``OpOverloadPacket`` instead
  of ``.default`` overload) had been silently misrouting every IR-marked
  modeling file through the legacy heuristic-sharding path, which
  doesn't attempt to slice ``sinks``. So upstream's IR port never ran
  through the IR pipeline end-to-end.

Signed-off-by: greg-kwasniewski1 <213329731+greg-kwasniewski1@users.noreply.github.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.

[Feature]: [AutoDeploy] GPT-OSS-120b perf analsys and opt (tp=1)

8 participants