From d6c490192d12a5191b83c2dbc1255a91d8717a6c Mon Sep 17 00:00:00 2001 From: yctseng0211 Date: Thu, 4 Dec 2025 15:30:11 +0800 Subject: [PATCH] [AMD] fix the regression issue for DeepseekV3 on MI300 (#14383) --- python/sglang/srt/layers/quantization/fp8.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/sglang/srt/layers/quantization/fp8.py b/python/sglang/srt/layers/quantization/fp8.py index aa39fcbcc..d858abcea 100644 --- a/python/sglang/srt/layers/quantization/fp8.py +++ b/python/sglang/srt/layers/quantization/fp8.py @@ -762,6 +762,15 @@ class Fp8MoEMethod(FusedMoEMethodBase): w2_weight_scale, requires_grad=False ) layer.w2_input_scale = None + if _use_aiter: + # add this section for MI300 + # Pre-shuffle weights + layer.w13_weight.data = shuffle_weight( + layer.w13_weight.contiguous(), (16, 16) + ) + layer.w2_weight.data = shuffle_weight( + layer.w2_weight.contiguous(), (16, 16) + ) elif _use_aiter: # Pre-shuffle weights layer.w13_weight.data = shuffle_weight(