Repository navigation
[Feat] moe: Allow SiTU on the CuTe DSL NVFP4 MoE (Kimi-K3 W4A16) - #44148
Merged
ByronHsu merged 9 commits intoNov 3, 2026
Merged
Conversation
Kimi-K3's routed experts use SiTU. FlashInfer's CuteDslMoEWrapper applies SiTU in the GEMM1 epilogue (situ_beta / situ_linear_beta), but SGLang's CuTe DSL runner and the ModelOpt NVFP4 activation guard only allowed silu/relu2, so K3 could not run on the NVFP4 W4A16 kernel (SGLANG_FLASHINFER_CUTEDSL_NVFP4_W4A16=1). - modelopt_quant: allow 'situ' on the CuTe DSL v2 NVFP4 path. - flashinfer_cutedsl: accept 'situ' (FlashInfer's gated Swiglu path) and pass gemm1_alpha / gemm1_clamp_limit as situ_beta / situ_linear_beta. - GPU test: CuTe DSL W4A16 SiTU vs a dequantized torch reference; the SiLU reference must differ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ByronHsu
requested review from
Alisehen,
AniZpZ,
BBuf,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
OrangeRedeng,
Ying1123,
b8zhong,
ch-wan,
ispobock,
merrymercy and
mmangkad
as code owners
October 14, 2026 00:00
Collaborator
Author
|
/tag-and-rerun-ci |
Collaborator
Author
|
/rerun-failed-ci |
Collaborator
Author
|
/rerun-failed-ci |
Resolve the SiTU backend allow-list in modelopt_quant.py: keep upstream's FlashInfer MegaMoE (sgl-project#44036) and this PR's CuTe DSL v2 standard path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
/rerun-failed-ci |
1 similar comment
Collaborator
Author
|
/rerun-failed-ci |
Collaborator
Author
|
/rerun-failed-ci |
2 of 5 tasks
Pick up main's fix for test_basic_sanity_dspark.py, which was broken on the Oct 22 main this PR last tested against. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pick up sgl-project#47837, which fixes test_linear_parallel_groups.py on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yuxingwang-intel
pushed a commit
to Yuxingwang-intel/sglang
that referenced
this pull request
Nov 6, 2026
…-project#44148) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
silu/relu2: the CuTe DSL MoE runner and the ModelOpt NVFP4 activation guard. That blocked K3 from FlashInfer's NVFP4 W4A16 CuTe DSL kernel (NVFP4 weights, BF16 activations).situ_beta/situ_linear_beta).What?
modelopt_quant.py: allowsituon the CuTe DSL v2 NVFP4 path, as already done for TRT-LLM.flashinfer_cutedsl.py:situ(FlashInfer selects SiTU through the gated Swiglu path);situ_beta/situ_linear_beta(K3'sgemm1_alpha/gemm1_clamp_limit) toCuteDslMoEWrapper. Without them the kernel would compute plain SwiGLU.test/registered/unit/layers/quantization/test_nvfp4_cutedsl_w4a16_situ_moe.py.--moe-runner-backend flashinfer_cutedslwithSGLANG_FLASHINFER_CUTEDSL_NVFP4_W4A16=1.w1) and up (w3) must share oneweight_scale_2per expert, because the kernel applies one GEMM1 scale before SiTU'stanh.Verification?
Observed on GB300 with the same kernel path on a development branch (5-layer truncated K3 converted to ModelOpt NVFP4, TP4, CUDA graphs), CuTe DSL W4A16 vs Marlin on the same NVFP4 weights:
Reproduce:
Test?
test_nvfp4_cutedsl_w4a16_situ_moe.pyon GB300 with this branch and the upstream pins (flashinfer 0.7.1, torch 2.14.1+cu130, GB300): passed (observed). The test checks two things:test_nvfp4_moe_backends.py::TestNvFp4MoeBackends::test_flashinfer_cutedsl(existing SiLU path), same run: passed (observed;2 passed in 415.95stogether with the test above).pre-commit runon the changed files: all hooks passed (observed).🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ⏳ Run #41449060368
Latest PR Test (Extra): ❌ Run #41449060314
Latest PR Test (AMD ROCm 10): ⏳ Run #41449060148
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: