Skip to content

fix(moe): don't mark trtllm-gen FP4 MoE backend supported on SM120/SM121 - #3670

Closed
waynehacking8 wants to merge 1 commit into
flashinfer-ai:mainfrom
waynehacking8:wayne/fix-moe-trtllmfp4-supported-sm120
Closed

waynehacking8 wants to merge 1 commit into
flashinfer-ai:mainfrom
waynehacking8:wayne/fix-moe-trtllmfp4-supported-sm120

Conversation

@waynehacking8

@waynehacking8 waynehacking8 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description

TrtllmFp4Config.supported() returned True for all arch >= 100, but the routed runner (TrtllmFp4RoutedRunner) delegates to the trtllm-gen sm100 module, whose cubins are SM100-family only (SM100/SM103/SM110). On SM120/SM121 (consumer/workstation Blackwell) there are no trtllm-gen MoE cubins, so MoELayer selected and built a TrtllmFp4RoutedRunner that then failed deep at dispatch (cubin-not-found) instead of raising the clean "no usable backend" error at construction.

The existing comment already reasoned about the lower bound (don't mark the backend available on SM90/H100 where it "fails at dispatch"). This PR extends the same reasoning to the upper bound: gate on 100 <= arch < 120. SM100/SM103/SM110 behavior is unchanged.

Related Issues

None — found while auditing SM120 MoE dispatch on an RTX PRO 6000.

Tests

Verified on an RTX PRO 6000 Blackwell (SM120, CUDA 13.0) with a minimal MoEConfig(QuantVariant.NVFP4):

supported(120) supported(100) / (110) MoELayer(NVFP4) on SM120
before True True selects TrtllmFp4RoutedRunner → SM100 cubins → dispatch cubin-miss
after False True (unchanged) clean RuntimeError: none of the configured backends are usable on sm120 at construction

pre-commit run --files passes (ruff check, ruff format, mypy, codespell).

Reviewer Notes

  • This is a clean-error fix: SM120 NVFP4 MoE is served today by the dedicated b12x_fused_moe path; the unified MoELayer MVP remains SM100-family for now. Full unified-API SM120 enablement (a CUTLASS/b12x NVFP4 runner mapped into _BACKEND_RUNNERS) is a larger change that overlaps the NVFP4-scale plumbing in fix: make the cutlass MoE gemm profiler MXFP8-aware (autotune crash on MXFP8xMXFP8) #3614.
  • The sibling trtllm-gen configs (TrtllmFp8Block/PerTensor/Bf16/MxInt4) share the identical arch >= 100 upper-bound gap but are unreachable in the NVFP4-only MVP; left for a focused follow-up.

AI-assisted: investigated and authored with Claude Code, validated on SM120 hardware.

Summary by CodeRabbit

  • Bug Fixes
    • Restricted Trtllm FP4 backend GPU support to SM100-family architectures only (SM100/SM103/SM110), improving detection of unsupported hardware during initialization and avoiding later dispatch-time failures.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

TrtllmFp4Config.supported(arch) in flashinfer/fused_moe/api.py narrows its hardware check from arch >= 100 to an explicit SM100-family whitelist (100, 103, 110), restricting the trtllm FP4 MoE backend to only those architectures and excluding SM90 and SM120/SM121. Updated comments explain why those architectures are excluded due to missing usable cubins.

Changes

TrtllmFp4Config SM100-family gating

Layer / File(s) Summary
Narrow TrtllmFp4Config.supported to SM100-family whitelist
flashinfer/fused_moe/api.py
Changes the arch predicate from arch >= 100 to an explicit check for arch in (100, 103, 110); adds comments stating that SM90 and SM120/SM121 lack usable trtllm-gen MoE cubins, and that a broader check would cause a dispatch-time cubin-not-found failure rather than a construction-time "no usable backend" error.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • flashinfer-ai/flashinfer#1998: Both tighten Hopper SM architecture handling for TRT-LLM MoE; this PR updates TrtllmFp4Config.supported to allow only SM100-family, while the retrieved PR adjusts test skipping logic for the same SM100/103 constraint.
  • flashinfer-ai/flashinfer#2060: Both target SM-architecture gating for trtllm-gen MoE support; this PR tightens TrtllmFp4Config.supported to specific SM100-family values, while the retrieved PR adds complementary test-time skips.
  • flashinfer-ai/flashinfer#2725: Directly opposing direction — this PR tightens TrtllmFp4Config.supported to only SM100-family (100/103/110), while the retrieved PR broadens fused-MoE kernel/JIT checks to include SM120 support.

Suggested reviewers

  • yzh119
  • yongwww
  • sricketts
  • aleozlx
  • bkryu

Poem

🐇 Hoppin' through the SM zoo,
Only 100, 103, 110 get the FP4 view!
SM90 and SM120 say their goodbyes,
No cubins to spare—a dispatch-time surprise,
The rabbit's whitelist keeps errors away! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: narrowing SM120/SM121 support for the trtllm-gen FP4 MoE backend, which directly matches the core fix in the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description includes the required description, related issues, tests, and reviewer notes sections, though the checklist section is omitted.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request restricts the supported architectures for TrtllmFp4Config to the SM100 family (specifically 100 <= arch < 120) to prevent dispatch failures on unsupported architectures. The reviewer suggests using an explicit set of supported architectures (100, 103, 110) instead of a range check for greater precision and consistency with other configurations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread flashinfer/fused_moe/api.py Outdated
# makes MoELayer build a runner that then fails at dispatch
# (cubin-not-found) instead of raising the clean "no usable backend"
# error at construction.
return 100 <= arch < 120

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.

medium

Since the trtllm-gen SM100 module cubins are specifically built for SM100, SM103, and SM110, using an explicit set of supported architectures is more precise and robust than a range check. This also aligns with the pattern used in CuteDslConfig.supported (which uses arch in (100, 103)).

Suggested change
return 100 <= arch < 120
return arch in (100, 103, 110)

TrtllmFp4Config.supported() returned True for all arch >= 100, but the routed
runner delegates to the trtllm-gen sm100 module whose cubins are SM100-family
only (SM100/SM103/SM110). On SM120/SM121 (consumer Blackwell) there are no
trtllm-gen MoE cubins, so MoELayer built a TrtllmFp4RoutedRunner that then
failed deep at dispatch (cubin-not-found) instead of raising the clean
"no usable backend" error at construction.

The existing comment already reasoned about the lower bound (don't mark the
backend available on SM90/H100 where it "fails at dispatch"). Apply the same
reasoning to the upper bound by gating on the explicit SM100-family set
`arch in (100, 103, 110)` (the trtllm-gen MoE cubin set; matches the idiom in
CuteDslConfig.supported). SM100/SM103/SM110 behavior is unchanged.

Verified on RTX PRO 6000 (SM120, CUDA 13.0):
  before: supported(120)=True; MoELayer(NVFP4) selects the trtllm runner ->
          SM100 cubins -> dispatch cubin-miss.
  after:  supported = {100:T, 103:T, 110:T, 120:F, 121:F}; MoELayer(NVFP4)
          raises a clean RuntimeError at construction on SM120.

Note: the sibling trtllm-gen configs (TrtllmFp8Block/PerTensor/Bf16/MxInt4)
share the same `arch >= 100` pattern and latent upper-bound gap, but are not
reachable in the NVFP4-only MVP; left for a follow-up to keep this focused.

AI-assisted: investigated and authored with Claude Code.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: WEI CHENG CHIU <waynehacking8@gmail.com>
@waynehacking8
waynehacking8 force-pushed the wayne/fix-moe-trtllmfp4-supported-sm120 branch from 448303f to 995afb7 Compare June 18, 2026 02:40
@waynehacking8

Copy link
Copy Markdown
Contributor Author

Thanks @gemini-code-assist — agreed, applied return arch in (100, 103, 110). It's more precise (the trtllm-gen MoE cubin set) and matches CuteDslConfig.supported's arch in (...) idiom. Verified on an RTX PRO 6000: supported(100/103/110)=True, supported(120/121)=False.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Thank you for the verification. Using an explicit whitelist for the arch check ensures the supported method correctly reflects the available cubin set, preventing runtime dispatch failures.

@waynehacking8

Copy link
Copy Markdown
Contributor Author

Closing as superseded by current main. TrtllmFp4Config.supported() now returns arch in (100, 103) and explicitly excludes SM120/121; the later #4122 revert also removed SM110 support, so porting this branch’s (100, 103, 110) whitelist would be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants