@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 48bfb0c9b7
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Bug] Fix R1 Accuracy 0 Bug (#23294)

Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>

Wentao Ye committed Aug 21, 2025 at 13:11 UTC 48bfb0c9b733aab69f4c7d77051e20a80c8d088f
1 file changed +15 -7
vllm/model_executor/layers/quantization/fp8.py
+15 -7
@@ -1099,8 +1099,7 @@ class Fp8MoEMethod(FusedMoEMethodBase):
1099 apply_router_weight_on_input=apply_router_weight_on_input,
1100 )
1101 else:
1102 - from vllm.model_executor.layers.fused_moe import fused_experts
1103 - return fused_experts(
1102 + common_kwargs = dict(
1103 hidden_states=x,
1104 w1=layer.w13_weight,
1105 w2=layer.w2_weight,
@@ -1117,11 +1116,20 @@ class Fp8MoEMethod(FusedMoEMethodBase):
1116 if self.block_quant else layer.w2_weight_scale),
1117 a1_scale=layer.w13_input_scale,
1118 a2_scale=layer.w2_input_scale,
1120 - use_fp8_w8a8=True,
1121 - block_shape=self.quant_config.weight_block_size,
1122 - allow_deep_gemm=self.allow_deep_gemm,
1123 - allow_cutlass_block_scaled_grouped_gemm=(
1124 - self.allow_cutlass_block_scaled_grouped_gemm))
1119 + )
1120 +
1121 + if self.fused_experts is not None:
1122 + return self.fused_experts(**common_kwargs)
1123 + else:
1124 + from vllm.model_executor.layers.fused_moe import fused_experts
1125 + return fused_experts(
1126 + **common_kwargs,
1127 + use_fp8_w8a8=True,
1128 + block_shape=self.quant_config.weight_block_size,
1129 + allow_deep_gemm=self.allow_deep_gemm,
1130 + allow_cutlass_block_scaled_grouped_gemm=(
1131 + self.allow_cutlass_block_scaled_grouped_gemm),
1132 + )
1133
1134
1135 class Fp8KVCacheMethod(BaseKVCacheMethod):