Skip to content

[TRTLLM-11585][feat] Add CUTEDSL moe backend for nemotron-h#12884

Merged
Wanli-Jiang merged 7 commits into
NVIDIA:mainfrom
Wanli-Jiang:user/williamj/nemotron-h-cutedsl-moe
May 10, 2026
Merged

[TRTLLM-11585][feat] Add CUTEDSL moe backend for nemotron-h#12884
Wanli-Jiang merged 7 commits into
NVIDIA:mainfrom
Wanli-Jiang:user/williamj/nemotron-h-cutedsl-moe

Conversation

@Wanli-Jiang

@Wanli-Jiang Wanli-Jiang commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Generalized activation fusion support for Mixture of Experts (MoE) operations, enabling both gated (SwiGLU) and non-gated (ReLU2) activation modes.
    • Extended activation type configuration in CuteDslFusedMoE backend for improved flexibility.
  • Bug Fixes

    • Fixed missing activation type parameter propagation in CuteDslFusedMoE initialization.
  • Tests

    • Expanded MoE backend test coverage to include CUTEDSL backend.

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

To see a list of available CI bot commands, please comment /bot help.

@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-h-cutedsl-moe branch 2 times, most recently from 015cca8 to a573d2d Compare April 17, 2026 05:11
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #43962 [ run ] triggered by Bot. Commit: a573d2d Link to invocation

@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-h-cutedsl-moe branch 2 times, most recently from ee5b337 to da25caa Compare April 17, 2026 05:48
@Wanli-Jiang
Wanli-Jiang marked this pull request as ready for review April 17, 2026 05:48
@Wanli-Jiang
Wanli-Jiang requested review from a team as code owners April 17, 2026 05:48
@Wanli-Jiang
Wanli-Jiang requested review from hyukn and mikeiovine April 17, 2026 05:48
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #43973 [ run ] triggered by Bot. Commit: da25caa Link to invocation

@coderabbitai

coderabbitai Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR generalizes a SwiGLU-specific gather-grouped GEMM kernel to support both gated (SwiGLU) and non-gated (ReLU²) activation modes. Custom ops are renamed from swiglu to act_fusion, an is_gated parameter is threaded through the kernel and runner implementations, weight/scale transformations are made conditional on activation type, and test coverage is expanded for the new backend variant.

Changes

Cohort / File(s) Summary
Kernel and Custom Op Generalization
tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py, tensorrt_llm/_torch/cute_dsl_kernels/blackwell/blockscaled_contiguous_gather_grouped_gemm_act_fusion.py
Renamed custom ops from *_swiglu_blackwell* to *_act_fusion_blackwell*. Added is_gated: bool parameter to both runner and kernel. Updated kernel epilogue processing to conditionally iterate/compute based on gating: interleaved pair loading and up * silu(gate) for gated mode, single subtile loading and relu(alpha * acc)^2 for non-gated mode. Adjusted tiling and validity checks accordingly.
MoE Backend Integration
tensorrt_llm/_torch/modules/fused_moe/create_moe.py, tensorrt_llm/_torch/modules/fused_moe/fused_moe_cute_dsl.py
Extended CuteDslFusedMoE to accept activation_type parameter and forward it through the backend. Updated custom op invocations to use *_act_fusion_blackwell* variants with is_gated argument. Updated compatibility checks for grouped-gather runner from SwiGLU to ActFusion variant.
Weight and Scale Quantization
tensorrt_llm/_torch/modules/fused_moe/quantization.py
Conditionally skip weight/scale interleaving, unswizzle, and re-copy transformations when is_gated_activation is false, avoiding unnecessary layout transformations for non-gated modes.
Test Script Updates
tests/scripts/cute_dsl_kernels/moe_as_dense_gemm/run_moe_as_dense_gemm_fc1.py, tests/scripts/cute_dsl_kernels/run_blockscaled_contiguous_gather_grouped_gemm_act_fusion.py
Updated kernel module references from blockscaled_contiguous_gather_grouped_gemm_swiglu_fusion to blockscaled_contiguous_gather_grouped_gemm_act_fusion in test script invocations and comments.
Integration and Unit Tests
tests/integration/defs/accuracy/test_llm_api_pytorch.py, tests/integration/test_lists/test-db/l0_dgx_b200.yml, tests/unittest/_torch/thop/parallel/test_cute_dsl_moe.py
Added CUTEDSL backend variant to NVF4 MoE parameterized tests. Updated custom op calls in unit tests from *_swiglu_blackwell_multi_b to *_act_fusion_blackwell_multi_b. Added integration test entry for new backend variant.

Sequence Diagram(s)

sequenceDiagram
    participant MoE as MoE Backend<br/>(FusedMoE)
    participant QT as Quantization<br/>Transform
    participant COP as Custom Op<br/>(act_fusion)
    participant KER as Kernel<br/>(Epilogue)

    MoE->>QT: Forward activation_type
    alt is_gated_activation = True
        QT->>QT: Interleave FC1/gate weights & scales
        QT->>COP: Pass weights/scales
    else is_gated_activation = False
        QT->>COP: Pass weights/scales (unmodified)
    end
    
    MoE->>COP: Call with is_gated=activation_type
    COP->>KER: Invoke kernel with is_gated
    
    alt is_gated = True
        KER->>KER: Load paired subtiles (up, gate)
        KER->>KER: Compute: up * silu(gate)
    else is_gated = False
        KER->>KER: Load single subtile
        KER->>KER: Compute: relu(alpha * acc)²
    end
    
    KER-->>COP: Output tensor
    COP-->>MoE: Result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is a template with empty placeholder sections and no meaningful implementation details, test coverage information, or explanation of changes provided by the author. Fill in the Description section with a summary of changes, and the Test Coverage section with relevant test details to ensure sufficient validation of the implementation.
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and specifically summarizes the main objective of the changeset: adding a CUTEDSL MoE backend for nemotron-h with proper JIRA reference and feature type designation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
tests/scripts/cute_dsl_kernels/run_blockscaled_contiguous_gather_grouped_gemm_act_fusion.py (1)

32-49: ⚠️ Potential issue | 🟠 Major

The renamed runner still only validates the gated/SwiGLU path and provides no way to test the newly added non-gated (Relu2) path.

The kernel class was generalized to support both gated (SwiGLU) and non-gated (Relu2) activations via the is_gated parameter, but this runner script still hardcodes SwiGLU semantics throughout: the output dimension is hardcoded as n // 2, the reference verification implements only the interleaved up/gate extraction and SwiGLU computation, and there is no is_gated parameter or activation selector exposed to exercise the non-gated path. This leaves the main new functionality introduced by this PR unvalidated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@tests/scripts/cute_dsl_kernels/run_blockscaled_contiguous_gather_grouped_gemm_act_fusion.py`
around lines 32 - 49, The runner currently assumes gated (SwiGLU) semantics
(e.g., using n // 2 for output dim and the interleaved up/gate reference
computation) and thus never exercises the new non-gated (Relu2) path; add a
command-line flag (e.g., --is_gated or --activation with values
"swi_glu"|"relu2") to the script, change the output-dimension logic to branch on
is_gated instead of hardcoding n // 2, and update the reference verification
routine to compute either the interleaved up/gate SwiGLU path (when is_gated
true) or the single-path Relu2 activation (when is_gated false) so both kernel
paths (the class parameter is_gated) are testable from the runner.
tensorrt_llm/_torch/modules/fused_moe/fused_moe_cute_dsl.py (1)

753-773: ⚠️ Potential issue | 🟠 Major

Pass is_gated through the DWDP FC1 path as well.

Line 753 switches the DWDP path to the generalized act-fusion op, but this call still relies on the custom op’s default is_gated=True. That means activation_type=Relu2 will still execute the gated kernel on DWDP, producing the wrong epilogue and FC1 output width.

Suggested fix
         x, x_sf = torch.ops.trtllm.cute_dsl_nvfp4_gather_grouped_gemm_act_fusion_blackwell_multi_b(
             input=x.view(torch.float4_e2m1fn_x2),
             weight=[
                 w.view(torch.float4_e2m1fn_x2) for w in weight_view.w3_w1_weight
             ],
             input_scale=x_sf.view(torch.uint8),
             weight_scale=[
                 ws.view(torch.uint8) for ws in weight_view.fc1_weight_scale
             ],
             alpha=weight_view.fc1_global_scale,
             tile_idx_to_group_idx=tile_idx_to_expert_idx,
             tile_idx_to_mn_limit=tile_idx_to_mn_limit,
             permuted_idx_to_expanded_idx=permuted_idx_to_expanded_idx,
             num_non_exiting_tiles=num_non_exiting_tiles,
             global_sf=self.fc2_input_scale,
             num_experts=self.num_slots,
             top_k=effective_top_k,
             num_local_experts=esp,
             local_expert_offset=slot_start,
             tile_size=tile_size,
+            is_gated=self.is_gated_activation,
         )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tensorrt_llm/_torch/modules/fused_moe/fused_moe_cute_dsl.py` around lines 753
- 773, The DWDP FC1 call to
torch.ops.trtllm.cute_dsl_nvfp4_gather_grouped_gemm_act_fusion_blackwell_multi_b
in fused_moe_cute_dsl.py currently omits the is_gated argument and therefore
uses the op's default (True); update that call to pass the correct gating flag
(is_gated) used elsewhere in this module/path so the DWDP FC1 path uses the same
gating decision as the non-DWDP path (add is_gated=is_gated or the appropriate
flag variable from the surrounding scope to the call to
cute_dsl_nvfp4_gather_grouped_gemm_act_fusion_blackwell_multi_b).
🧹 Nitpick comments (1)
tensorrt_llm/_torch/cute_dsl_kernels/blackwell/blockscaled_contiguous_gather_grouped_gemm_act_fusion.py (1)

1-1: Update copyright year to 2026.

Per coding guidelines, modified files should have the copyright year updated. Since this file is being modified and the current year is 2026, the copyright header should reflect this.

-# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

As per coding guidelines: "Add NVIDIA copyright header on ALL new files and update year on modified files"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@tensorrt_llm/_torch/cute_dsl_kernels/blackwell/blockscaled_contiguous_gather_grouped_gemm_act_fusion.py`
at line 1, Update the file header copyright year from 2025 to 2026: locate the
top-of-file copyright comment (the existing "Copyright (c) 2025 NVIDIA
CORPORATION & AFFILIATES. All rights reserved.") and change the year to 2026 so
the header reads "Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights
reserved.".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@tensorrt_llm/_torch/cute_dsl_kernels/blackwell/blockscaled_contiguous_gather_grouped_gemm_act_fusion.py`:
- Around line 3800-3808: The wrapper's local parameter is_gated can diverge from
the kernel instance flag self.is_gated causing interm_size and the output tensor
shape (c) to mismatch the kernel tiling set in __init__/_setup_attributes;
remove the is_gated parameter from wrapper and always use self.is_gated (or
alternatively add an explicit runtime assertion that is_gated == self.is_gated
at the start of wrapper) so interm_size computation and any c shape creation use
the instance's self.is_gated consistently; update references in wrapper that
compute interm_size and c shape to reference self.is_gated and adjust callers to
stop passing is_gated if you choose the remove option.

In `@tests/integration/defs/accuracy/test_llm_api_pytorch.py`:
- Around line 6362-6363: test_nvfp4_8gpus was extended to accept "CUTEDSL" via
the moe_backend param but lacks the SM gating applied to other NVFP4 backends;
update the test to skip or restrict "CUTEDSL" to SMs 100 and 103 like the other
NVFP4 tests. Locate the test_nvfp4_8gpus function and add the same SM
check/pytest.skip logic used elsewhere in this file (or wrap the test with the
same requires-SM decorator) to ensure when moe_backend == "CUTEDSL" the test
only runs on SM 100 or 103.

---

Outside diff comments:
In `@tensorrt_llm/_torch/modules/fused_moe/fused_moe_cute_dsl.py`:
- Around line 753-773: The DWDP FC1 call to
torch.ops.trtllm.cute_dsl_nvfp4_gather_grouped_gemm_act_fusion_blackwell_multi_b
in fused_moe_cute_dsl.py currently omits the is_gated argument and therefore
uses the op's default (True); update that call to pass the correct gating flag
(is_gated) used elsewhere in this module/path so the DWDP FC1 path uses the same
gating decision as the non-DWDP path (add is_gated=is_gated or the appropriate
flag variable from the surrounding scope to the call to
cute_dsl_nvfp4_gather_grouped_gemm_act_fusion_blackwell_multi_b).

In
`@tests/scripts/cute_dsl_kernels/run_blockscaled_contiguous_gather_grouped_gemm_act_fusion.py`:
- Around line 32-49: The runner currently assumes gated (SwiGLU) semantics
(e.g., using n // 2 for output dim and the interleaved up/gate reference
computation) and thus never exercises the new non-gated (Relu2) path; add a
command-line flag (e.g., --is_gated or --activation with values
"swi_glu"|"relu2") to the script, change the output-dimension logic to branch on
is_gated instead of hardcoding n // 2, and update the reference verification
routine to compute either the interleaved up/gate SwiGLU path (when is_gated
true) or the single-path Relu2 activation (when is_gated false) so both kernel
paths (the class parameter is_gated) are testable from the runner.

---

Nitpick comments:
In
`@tensorrt_llm/_torch/cute_dsl_kernels/blackwell/blockscaled_contiguous_gather_grouped_gemm_act_fusion.py`:
- Line 1: Update the file header copyright year from 2025 to 2026: locate the
top-of-file copyright comment (the existing "Copyright (c) 2025 NVIDIA
CORPORATION & AFFILIATES. All rights reserved.") and change the year to 2026 so
the header reads "Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights
reserved.".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 09626fd7-be01-4541-ace7-2c1eb4adb660

📥 Commits

Reviewing files that changed from the base of the PR and between 5ea4a9a and da25caa.

📒 Files selected for processing (10)
  • tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py
  • tensorrt_llm/_torch/cute_dsl_kernels/blackwell/blockscaled_contiguous_gather_grouped_gemm_act_fusion.py
  • tensorrt_llm/_torch/modules/fused_moe/create_moe.py
  • tensorrt_llm/_torch/modules/fused_moe/fused_moe_cute_dsl.py
  • tensorrt_llm/_torch/modules/fused_moe/quantization.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch.py
  • tests/integration/test_lists/test-db/l0_dgx_b200.yml
  • tests/scripts/cute_dsl_kernels/moe_as_dense_gemm/run_moe_as_dense_gemm_fc1.py
  • tests/scripts/cute_dsl_kernels/run_blockscaled_contiguous_gather_grouped_gemm_act_fusion.py
  • tests/unittest/_torch/thop/parallel/test_cute_dsl_moe.py

Comment thread tests/integration/defs/accuracy/test_llm_api_pytorch.py
@Wanli-Jiang
Wanli-Jiang requested a review from zongfeijing April 17, 2026 06:24
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #44091 [ run ] triggered by Bot. Commit: da25caa Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

Link to invocation

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

Agree with @syuoni that is_gated can be improved with a more general ActivationType enum arg.
Overall LGTM.

@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-h-cutedsl-moe branch 2 times, most recently from e320dea to 90f2504 Compare April 22, 2026 06:39
@Wanli-Jiang
Wanli-Jiang requested a review from a team as a code owner April 22, 2026 06:39
@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-h-cutedsl-moe branch from 90f2504 to 203a7e7 Compare April 22, 2026 06:48
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

Link to invocation

@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-h-cutedsl-moe branch 3 times, most recently from 8e49a58 to 1db1271 Compare May 9, 2026 06:25
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
The gather grouped-GEMM kernel now supports both SwiGLU (is_gated=True)
and Relu2 (is_gated=False), so the "swiglu" naming is inaccurate. Rename
the kernel file, Runner class, and torch ops to use "act_fusion", and
generalize the top-level/class/forward docstrings to describe both
activations. SwiGLU-specific code comments inside the is_gated=True
branch are kept verbatim.

No behavioral change: the non-gather and dense-FC1 SwiGLU kernels (which
do not have an is_gated path) are untouched.

Renames:
- blockscaled_contiguous_gather_grouped_gemm_swiglu_fusion.py
    -> blockscaled_contiguous_gather_grouped_gemm_act_fusion.py
- Sm100BlockScaledContiguousGatherGroupedGemmSwigluFusionRunner
    -> Sm100BlockScaledContiguousGatherGroupedGemmActFusionRunner
- trtllm::cute_dsl_nvfp4_gather_grouped_gemm_swiglu_blackwell[_multi_b]
    -> trtllm::cute_dsl_nvfp4_gather_grouped_gemm_act_fusion_blackwell[_multi_b]

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
…moe.

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
@Wanli-Jiang
Wanli-Jiang force-pushed the user/williamj/nemotron-h-cutedsl-moe branch from 1db1271 to ac6d56a Compare May 9, 2026 06:26
@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot help

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

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) --high-priority]

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. Supports wildcard * for pattern matching (e.g., "*PerfSanity*" matches all stages containing PerfSanity). Examples: "A10-PyTorch-1, xxx", "PerfSanity". 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. Supports wildcard * for pattern matching. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx", --extra-stage "Post-Merge".

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

--high-priority (OPTIONAL) : Run the pipeline with high priority. This option is restricted to authorized users only and will route the job to a high-priority queue.

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.

@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "GB200-4_GPUs-PyTorch-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47484 [ run ] triggered by Bot. Commit: ac6d56a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47484 [ run ] completed with state SUCCESS. Commit: ac6d56a
/LLM/main/L0_MergeRequest_PR pipeline #37404 (Partly Tested) 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

@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "GB200-4_GPUs-PyTorch-1" --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47540 [ run ] triggered by Bot. Commit: ac6d56a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47540 [ run ] completed with state SUCCESS. Commit: ac6d56a
/LLM/main/L0_MergeRequest_PR pipeline #37457 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@Wanli-Jiang

Copy link
Copy Markdown
Collaborator Author

/bot skip --comment "CI tests were passed with two runs"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47561 [ skip ] triggered by Bot. Commit: ac6d56a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #47561 [ skip ] completed with state SUCCESS. Commit: ac6d56a
Skipping testing for commit ac6d56a

Link to invocation

@Wanli-Jiang
Wanli-Jiang merged commit 7ce209b into NVIDIA:main May 10, 2026
6 checks passed
yufeiwu-nv pushed a commit to yufeiwu-nv/TensorRT-LLM that referenced this pull request May 19, 2026
…2884)

Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
tianyuz-nv added a commit to tianyuz-nv/TensorRT-LLM that referenced this pull request May 25, 2026
Phase 1 of removing the DWDP IPC-era multi-B kernel infrastructure
that the VA-based DWDP path no longer needs. Three follow-up phases
will clean the runner-class plumbing and the kernel-side multi-B
branches.

Multi-B (multiple B tensors passed as a list to a single fused MoE
NVFP4 gather kernel) was introduced in PR NVIDIA#12136 to let the original
CUDA-IPC DWDP path GEMM N peer expert shards in one kernel call.  In
the VA-based pipeline (commit "Switch DWDP integration layer from IPC
to VA") the composite VA region exposes peer experts as one contiguous
[num_experts, ...] tensor via cuMemMap, so single-B handles every
case.  After that commit the only callers of the multi-B custom op
were:

  * The single-B custom op itself, which had been rewired to wrap
    single tensors into single-element lists and forward to multi-B
    (see PR NVIDIA#12136 commits "make multi_b the inner op, original op
    as wrapper" and "unify single-B and multi-B kernel wrapper into
    single entry point").
  * test_cute_dsl_moe.py, which exercised both paths.

This commit:

  * Removes the trtllm::cute_dsl_nvfp4_gather_grouped_gemm_act_fusion
    _blackwell_multi_b custom op and its register_fake registration.
  * Rewires the single-B trtllm::cute_dsl_nvfp4_gather_grouped_gemm
    _act_fusion_blackwell to call
    Sm100BlockScaledContiguousGatherGroupedGemmActFusionRunner
    directly, restoring it as the primary entry point.  The runner /
    helper still expect list-form for weight, weight_scale, alpha;
    a one-line wrap-in-single-element-list keeps Phase 1 minimal.
    Phase 2 will convert the runner back to bare-tensor inputs.
  * Updates test_cute_dsl_moe.py to call the single-B op directly
    and drops the multi-B (num_local_experts > 1) test branch.

Verified that nemotron-h, the only model that consumes the new
``activation_type=Relu2`` path added by PR NVIDIA#12884, calls the single-B
op (fused_moe_cute_dsl.py:631), not multi-B — so multi-B has no
remaining production callers.

Both renames + ``activation_type`` parameter introduced by PR NVIDIA#12884
(rename swiglu_fusion → act_fusion, add Relu2 support) are preserved.

Signed-off-by: tianyuz-nv <tianyuz@nvidia.com>
tianyuz-nv added a commit to tianyuz-nv/TensorRT-LLM that referenced this pull request May 25, 2026
…r classes

Phase 2 of removing the DWDP IPC-era multi-B kernel infrastructure that
the VA-based DWDP path no longer needs.  Phase 1 dropped the public
multi-B custom op; this phase reverts the wrapper-level plumbing back
to bare-tensor inputs (matching the pre-PR-NVIDIA#12136 shape) while
preserving every unrelated upstream evolution — notably the
swiglu_fusion -> act_fusion rename and ``activation_type`` parameter
introduced by PR NVIDIA#12884 (CUTEDSL MoE backend for nemotron-h, the only
production consumer of ``activation_type=Relu2``).

Changes in tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py:

  * GatherGroupedGemmInputsHelper.inputs_pre_hook: unpack inputs as bare
    tensors (``a, b, a_sf, b_sf, alpha, ...``) instead of list form
    (``a, b_list, a_sf, b_sf_list, alpha_list, ...``); update class
    docstring accordingly.
  * Sm100BlockScaledContiguousGroupedGemmFinalizeFusionRunner: drop the
    ``b_tensor_l_sizes`` parameter from __init__, ``unique_id`` and the
    kernel cache key; rewrite ``get_valid_tactics`` / ``forward`` to
    take bare ``b`` / ``b_sf`` / ``alpha`` tensors and pass single
    pointers (not tuples) to the kernel.
  * Sm100BlockScaledContiguousGatherGroupedGemmActFusionRunner: same
    revert; in addition, remove the ``MAX_B_TENSORS = 4`` class
    constant.  ``activation_type`` and the gated/non-gated branches
    added by PR NVIDIA#12884 are preserved.
  * cute_dsl_nvfp4_grouped_gemm_finalize_inplace_blackwell and
    cute_dsl_nvfp4_grouped_gemm_finalize_blackwell custom ops: drop the
    ``weight: List[torch.Tensor]`` / ``weight_scale: List[...]`` /
    ``alpha: List[...]`` type annotations in favour of bare
    ``torch.Tensor``; drop the runtime ``b_tensor_l_sizes`` derivation
    in finalize_inplace; both fake registrations follow.
  * cute_dsl_nvfp4_gather_grouped_gemm_act_fusion_blackwell: drop the
    Phase 1 single-element-list wrapping that was carrying the runner
    through; the call site now passes bare tensors.

Changes in tensorrt_llm/_torch/modules/fused_moe/fused_moe_cute_dsl.py:

  * NvFp4WeightView: six ``List[torch.Tensor]`` fields become
    ``torch.Tensor`` since the VA composite-VA tensor swap leaves a
    single full ``[num_experts, ...]`` tensor in every field.
    ``_build_local_weight_view`` constructs accordingly; six call sites
    drop their ``[0]`` indexing.
  * cute_dsl_nvfp4_grouped_gemm_finalize_inplace_blackwell call site
    drops single-element list wrapping for weight / weight_scale /
    alpha.

Changes in tests/unittest/_torch/thop/parallel/test_cute_dsl_moe.py:

  * Update finalize-blackwell test (around line 563) to call the bare-
    tensor signature.
  * Drop the ``num_local_experts > 1`` multi-B branch of the finalize
    test (the API is gone).

Signed-off-by: tianyuz-nv <tianyuz@nvidia.com>
tianyuz-nv added a commit to tianyuz-nv/TensorRT-LLM that referenced this pull request May 25, 2026
…nels

Phase 3 of removing the DWDP IPC-era multi-B kernel infrastructure
that the VA-based DWDP path no longer needs.  Phase 1 dropped the
public multi-B custom op; Phase 2 reverted the wrapper-level plumbing
to bare-tensor inputs.  This phase reverts the cute.jit ``wrapper`` /
``__init__`` of the two affected kernels to a single-B-only shape and
drops the runner-side single-element-tuple bridging that Phase 2 had
left in place.

Affected kernels:

  * ``blockscaled_contiguous_gather_grouped_gemm_act_fusion`` (the
    nemotron-h activation-fusion gather GEMM)
  * ``blockscaled_contiguous_grouped_gemm_finalize_fusion``

Changes per kernel (mirrors the diff in PR NVIDIA#12136-era commit
``b3cfd89065``, adapted onto the post-PR-NVIDIA#12884 ``act_fusion`` rename
and ``activation_type`` parameter):

  * ``__init__``: drop the ``b_tensor_l_sizes`` parameter, the
    ``MAX_B_TENSORS = 4`` class constant, and the if/else block that
    populated ``self.b_tensor_l_sizes`` / ``self.b_tensor_l_offsets``.
    Set ``self.num_b_tensors = 1`` unconditionally so existing
    downstream ``cutlass.const_expr(self.num_b_tensors >= 2/3/4)``
    branches in ``__call__`` statically fold away at cute.jit compile
    time.
  * ``wrapper``: switch from ``b_ptr_tuple`` / ``b_sf_ptr_tuple`` /
    ``alpha_ptr_tuple`` to bare ``b_ptr`` / ``b_sf_ptr`` / ``alpha_ptr``
    pointers and accept ``l: cutlass.Int64`` directly (instead of
    reading ``self.b_tensor_l_sizes[0]``).  Drop the up-to-four-element
    unroll that built ``b_tuple`` / ``b_sf_tuple`` / ``alpha_tuple``;
    the wrapper now constructs single ``b`` / ``b_sf`` / ``alpha``
    tensors and forwards them to ``__call__``.  ``__call__`` retains
    its ``isinstance(b, tuple)`` defensive wrap that promotes a bare
    tensor to a single-element tuple, so its multi-B-shaped internals
    are untouched.

Corresponding changes in
``tensorrt_llm/_torch/custom_ops/cute_dsl_custom_ops.py``:

  * Both ``forward`` methods (Sm100BlockScaledContiguousGroupedGemm
    FinalizeFusionRunner, Sm100BlockScaledContiguousGatherGroupedGemm
    ActFusionRunner) drop the Phase 2 single-element-tuple wrapping for
    b_ptr / b_sf_ptr / alpha_ptr.
  * Both kernel constructors no longer receive ``b_tensor_l_sizes=(l,)``.
  * Both ``compile_args`` / ``exec_args`` lists pass ``l`` to the
    wrapper as an explicit argument (since the kernel no longer caches
    it inside ``self``).

Multi-B kernel code (Sm100BlockScaledContiguous*GroupedGemm runners
and the cute.jit kernels) was authored entirely by Zongfei Jing
inside PR NVIDIA#12136; with the IPC path gone there is no remaining
caller, so the cleanup is safe.  Verified the only consumer of the
``activation_type`` extension introduced by PR NVIDIA#12884 (CUTEDSL MoE for
nemotron-h) takes the single-B code path
(fused_moe_cute_dsl.py:631), not the multi-B one.

Signed-off-by: tianyuz-nv <tianyuz@nvidia.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.

7 participants