From aebae58b8c7894287a9ea8b5d844c65bbb58c9b2 Mon Sep 17 00:00:00 2001 From: Shijin Zhang <75300765+Dovis01@users.noreply.github.com> Date: Thu, 17 Sep 2026 15:25:17 +0800 Subject: [PATCH] [Moe] Fix flashinfer_trtllm silently dropping swiglu_limit clamped SwiGLU activation (#39920) --- python/sglang/srt/layers/quantization/fp8.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/layers/quantization/fp8.py b/python/sglang/srt/layers/quantization/fp8.py index 687bd96bb..290155641 100644 --- a/python/sglang/srt/layers/quantization/fp8.py +++ b/python/sglang/srt/layers/quantization/fp8.py @@ -2358,10 +2358,15 @@ class Fp8MoEMethod(FusedMoEMethodBase): """Materialize optional TRT-LLM SwiGLU parameters once per expert.""" num_experts = int(layer.num_local_experts) device = layer.w13_weight.device + clamp_limit = ( + self.moe_runner_config.gemm1_clamp_limit + if self.moe_runner_config.gemm1_clamp_limit is not None + else self.moe_runner_config.swiglu_limit + ) for name, value in ( ("gemm1_alpha", self.moe_runner_config.gemm1_alpha), ("gemm1_beta", self.moe_runner_config.gemm1_beta), - ("gemm1_clamp_limit", self.moe_runner_config.gemm1_clamp_limit), + ("gemm1_clamp_limit", clamp_limit), ): tensor = ( None