From a2c2c09d7d2e146235a9f985b20375f6efa66c98 Mon Sep 17 00:00:00 2001 From: Minglei Zhu Date: Sat, 10 Jan 2026 17:19:59 -0800 Subject: [PATCH] [BugFix] fix gpt-oss-120b launch failure with --enable-piecewise-cuda-graph (#16757) --- python/sglang/srt/layers/quantization/mxfp4.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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