From d773b49e5b425d4e0f8e6d00751f9f69fb14b138 Mon Sep 17 00:00:00 2001 From: Mohammad Miadh Angkad <176301910+mmangkad@users.noreply.github.com> Date: Thu, 18 Jun 2026 07:44:23 +0800 Subject: [PATCH] Fix MXFP8 FlashInfer CUTLASS scale selection (#28553) --- python/sglang/srt/layers/quantization/fp8.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/sglang/srt/layers/quantization/fp8.py b/python/sglang/srt/layers/quantization/fp8.py index 0706206f7..08ba0cada 100644 --- a/python/sglang/srt/layers/quantization/fp8.py +++ b/python/sglang/srt/layers/quantization/fp8.py @@ -790,10 +790,9 @@ class Fp8LinearMethod(LinearMethodBase): ) if self.use_mxfp8: - if ( - get_fp8_gemm_runner_backend().is_flashinfer_cutlass() - or get_fp8_gemm_runner_backend().is_flashinfer_trtllm() - ): + if get_fp8_gemm_runner_backend().is_flashinfer_cutlass(): + weight_scale = layer.weight_scale_inv_swizzled + elif get_fp8_gemm_runner_backend().is_flashinfer_trtllm(): weight_scale = layer.weight_scale_inv_shuffled else: weight_scale = layer.weight_scale_inv