From 71d41212e4111ed335e5717d8151514d9c192b74 Mon Sep 17 00:00:00 2001 From: Qiaolin Yu Date: Fri, 24 Oct 2025 02:04:50 -0700 Subject: [PATCH] Fix dpsk-r1-fp4 launching crash (#12063) --- .../sglang/srt/layers/quantization/mxfp4.py | 12 +++++------- .../sglang/srt/layers/quantization/unquant.py | 19 ++++++------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/python/sglang/srt/layers/quantization/mxfp4.py b/python/sglang/srt/layers/quantization/mxfp4.py index d0db9a947..77f5f3f35 100644 --- a/python/sglang/srt/layers/quantization/mxfp4.py +++ b/python/sglang/srt/layers/quantization/mxfp4.py @@ -587,13 +587,11 @@ class Mxfp4MoEMethod(FusedMoEMethodBase): self, layer: torch.nn.Module, moe_runner_config: MoeRunnerConfig ): self.moe_runner_config = moe_runner_config - backend = get_moe_runner_backend() - if backend.is_auto(): - backend = ( - MoeRunnerBackend.TRITON_KERNELS - if self.use_triton_kernels - else MoeRunnerBackend.TRITON - ) + backend = ( + MoeRunnerBackend.TRITON_KERNELS + if self.use_triton_kernels + else MoeRunnerBackend.TRITON + ) self.runner = MoeRunner(backend, moe_runner_config) def apply( diff --git a/python/sglang/srt/layers/quantization/unquant.py b/python/sglang/srt/layers/quantization/unquant.py index eb15dc442..55c5b8e3f 100644 --- a/python/sglang/srt/layers/quantization/unquant.py +++ b/python/sglang/srt/layers/quantization/unquant.py @@ -8,12 +8,7 @@ from torch.nn.parameter import Parameter from sglang.srt.custom_op import CustomOp from sglang.srt.layers.amx_utils import _amx_process_weight_after_loading -from sglang.srt.layers.moe import ( - MoeRunner, - MoeRunnerBackend, - MoeRunnerConfig, - get_moe_runner_backend, -) +from sglang.srt.layers.moe import MoeRunner, MoeRunnerBackend, MoeRunnerConfig from sglang.srt.layers.moe.moe_runner.triton import TritonMoeQuantInfo from sglang.srt.layers.quantization.base_config import ( FusedMoEMethodBase, @@ -225,13 +220,11 @@ class UnquantizedFusedMoEMethod(FusedMoEMethodBase, CustomOp): self, layer: torch.nn.Module, moe_runner_config: MoeRunnerConfig ): self.moe_runner_config = moe_runner_config - backend = get_moe_runner_backend() - if backend.is_auto(): - backend = ( - MoeRunnerBackend.TRITON_KERNELS - if self.use_triton_kernels - else MoeRunnerBackend.TRITON - ) + backend = ( + MoeRunnerBackend.TRITON_KERNELS + if self.use_triton_kernels + else MoeRunnerBackend.TRITON + ) self.runner = MoeRunner(backend, moe_runner_config) def apply(