From 8a868f8c00c74da88366f56d5af6b94c1b1d1538 Mon Sep 17 00:00:00 2001 From: YAMY <74099316+YAMY1234@users.noreply.github.com> Date: Tue, 7 Jul 2026 23:50:52 -0700 Subject: [PATCH] [NVIDIA] Allow modelopt_mixed quantization with flashinfer_cutedsl MoE runner (#30443) --- python/sglang/srt/layers/moe/ep_moe/layer.py | 2 +- python/sglang/srt/server_args.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/layers/moe/ep_moe/layer.py b/python/sglang/srt/layers/moe/ep_moe/layer.py index 46391d5bb..d54d79364 100644 --- a/python/sglang/srt/layers/moe/ep_moe/layer.py +++ b/python/sglang/srt/layers/moe/ep_moe/layer.py @@ -99,7 +99,7 @@ class DeepEPMoE(FusedMoE): elif ( get_moe_runner_backend().is_flashinfer_cutedsl() and quant_config is not None - and quant_config.get_name() == "modelopt_fp4" + and quant_config.get_name() in ("modelopt_fp4", "modelopt_mixed") ): self.deprecate_flag = True elif ( diff --git a/python/sglang/srt/server_args.py b/python/sglang/srt/server_args.py index 73d937602..6a874517b 100644 --- a/python/sglang/srt/server_args.py +++ b/python/sglang/srt/server_args.py @@ -5169,10 +5169,11 @@ class ServerArgs: ], "The expert parallel size must be 1 or the same as the tensor parallel size" if view.moe_runner_backend == "flashinfer_cutedsl": + # modelopt_mixed with non-NVFP4 MoE layers is rejected at load time. assert ( - view.quantization in ["modelopt_fp4"] + view.quantization in ["modelopt_fp4", "modelopt_mixed"] or self.get_model_config().nvfp4_moe_meta is not None - ), f"Invalid quantization '{view.quantization}'. \nFlashInfer CuteDSL MOE currently supports only: 'modelopt_fp4' or hybrid NVFP4 models." + ), f"Invalid quantization '{view.quantization}'. \nFlashInfer CuteDSL MOE currently supports only: 'modelopt_fp4', 'modelopt_mixed' (with NVFP4 MoE layers), or hybrid NVFP4 models." assert view.ep_size in [ 1, self.tp_size,