diff --git a/python/sglang/srt/layers/quantization/mxfp4.py b/python/sglang/srt/layers/quantization/mxfp4.py index 64a50e433..245751022 100644 --- a/python/sglang/srt/layers/quantization/mxfp4.py +++ b/python/sglang/srt/layers/quantization/mxfp4.py @@ -565,10 +565,16 @@ class Mxfp4MoEMethod(FusedMoEMethodBase): from triton_kernels.numerics_details.mxfp import upcast_from_mxfp w13_weight = upcast_from_mxfp( - layer.w13_weight, layer.w13_weight_scale, dtype=torch.bfloat16, axis=-1 + layer.w13_weight, + layer.w13_weight_scale, + target_dtype=torch.bfloat16, + axis=-1, ) w2_weight = upcast_from_mxfp( - layer.w2_weight, layer.w2_weight_scale, dtype=torch.bfloat16, axis=-1 + layer.w2_weight, + layer.w2_weight_scale, + target_dtype=torch.bfloat16, + axis=-1, ) del layer.w13_weight del layer.w2_weight