[TRTLLM-12242][feat] Add Marlin NVFP4 backend for MoE and Linear on Hopper - #13476
Conversation
|
/bot help |
GitHub Bot Help
Provide a user friendly way for developers to interact with a Jenkins server. Run See details below for each supported subcommand. Details
Launch build/test pipelines. All previously running jobs will be killed.
kill
Kill all running builds associated with pull request. skip
Skip testing for latest commit on pull request. 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. |
|
/bot run |
|
PR_Github #51022 [ run ] triggered by Bot. Commit: |
|
PR_Github #51022 [ run ] completed with state
|
|
/bot run |
|
PR_Github #51039 [ run ] triggered by Bot. Commit: |
|
PR_Github #51039 [ run ] completed with state
|
|
/bot run |
|
PR_Github #51157 [ run ] triggered by Bot. Commit: |
|
PR_Github #51157 [ run ] completed with state
|
|
/bot run |
|
PR_Github #51181 [ run ] triggered by Bot. Commit: |
|
PR_Github #51181 [ run ] completed with state
|
|
/bot run |
|
PR_Github #51238 [ run ] triggered by Bot. Commit: |
|
PR_Github #51238 [ run ] completed with state
|
|
/bot run |
|
PR_Github #51244 [ run ] triggered by Bot. Commit: |
|
PR_Github #51244 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #51281 [ run ] triggered by Bot. Commit: |
|
PR_Github #51281 [ run ] completed with state
|
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
|
/bot run --disable-fail-fast |
1 similar comment
|
/bot run --disable-fail-fast |
|
PR_Github #55410 [ run ] triggered by Bot. Commit: |
|
PR_Github #55410 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #55518 [ run ] triggered by Bot. Commit: |
|
PR_Github #55518 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #55629 [ run ] triggered by Bot. Commit: |
|
PR_Github #55629 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #55694 [ run ] triggered by Bot. Commit: |
|
PR_Github #55694 [ run ] completed with state |
…opper (NVIDIA#13476) Signed-off-by: Xuanteng Huang <xuantengh@nvidia.com>
This PR adds support for running Nemotron 120B on Hopper with NVFP4 format, with the multi-GPU support.
Introduce a Hopper-only (SM 9.x) W4A16 NVFP4 execution path backed by the Marlin kernel family. The new backend is strictly opt-in: users select it via
moe_config.backend: MARLINfor MoE layers andnvfp4_gemm_config.allowed_backends: [marlin]for dense / Mamba Linear layers. Default paths on Blackwell (CUTLASS / cuBLASLt / CUDA-core / CuteDSL) and the TRT backend are unchanged.Kernels (cpp/):
trtllm::marlin_nvfp4_gemm,trtllm::marlin_nvfp4_moe_gemm, andtrtllm::gptq_marlin_repack.Python backend wiring:
MarlinNVFP4Runnerplugs intoNVFP4GemmUnifiedRunneralongside the existing CUTLASS / cuBLASLt / CUDA-core / CuteDSL runners; only contributes tactics when SM is 90-99. Weight repack is done eagerly inget_valid_tacticsso thatforward()is CUDA-graph safe.MarlinNVFP4LinearMethodhandles the dense Linear path, gated bynvfp4_allowed_backends == ["marlin"].MarlinFusedMoE(NVFP4 only) is registered increate_moe,ConfigurableMoE, andMoeConfig.backendliteral.is_marlin_onlygate that disables CUTLASS-specific fused quantized paths which cannot feed a Marlin Linear.Production correctness:
fused_add_rms_norm_quantis preserved; Marlin only further gates it when marlin-only is selected.MLP._use_fused_relu2_quantnow requires SM >= 100 (matches the kernel's__CUDA_ARCH__ >= 1000guard in fusedActivationQuant.cu) and is also disabled for marlin-only mode.d_statein {64, 128, 256} so Nemotron-Super-class models fall back to the native path instead of silently running an unsupported config.Tests:
tests/unittest/trt/functional/test_fp4_gemm.py: standalone NVFP4 Marlin GEMM test (Hopper-only).tests/unittest/_torch/thop/parallel/test_fp4_linear.py: Linearnvfp4_allowed_backends=['marlin']path test.tests/unittest/_torch/modules/moe/test_moe_backend.py: fused Marlin MoE GEMM test plusMoeBackendType.MARLINwiring in backend/quantize utilities.tests/integration/defs/accuracy/test_llm_api_pytorch.py:TestNemotronHNvFP4Marlin.test_nvfp4_marlinMMLU accuracy task.examples/configs/curated/nemotron-super-marlin.yamlprovides a ready reference serving config.Summary by CodeRabbit
Summary by CodeRabbit
New Features
Tests
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.