@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 426cc8629f
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

[BugFix] Fix routed_scaling_factor double mul for dots1 and glm4 MoE models (#24132)

Signed-off-by: Yong Hoon Shin <yhshin@meta.com>

Yong Hoon Shin committed Sep 2, 2025 at 21:57 UTC 426cc8629f7e630e1c5a0b96fe2db737a170a06d
2 files changed +4 -2
vllm/model_executor/models/dots1.py
+2 -1
@@ -137,7 +137,8 @@ class Dots1MoE(nn.Module):
137 topk_group=config.topk_group,
138 prefix=f"{prefix}.experts",
139 scoring_func=config.scoring_func,
140 - routed_scaling_factor=self.routed_scaling_factor,
140 + # we do scaling outside, set factor to 1.0 to avoid double mul
141 + routed_scaling_factor=1.0,
142 e_score_correction_bias=self.gate.e_score_correction_bias)
143
144 if config.n_shared_experts is not None:
vllm/model_executor/models/glm4_moe.py
+2 -1
@@ -159,7 +159,8 @@ class Glm4MoE(nn.Module):
159 topk_group=config.topk_group,
160 prefix=f"{prefix}.experts",
161 scoring_func="sigmoid",
162 - routed_scaling_factor=self.routed_scaling_factor,
162 + # we do scaling outside, set factor to 1.0 to avoid double mul
163 + routed_scaling_factor=1.0,
164 e_score_correction_bias=self.gate.e_score_correction_bias,
165 enable_eplb=self.enable_eplb,
166 num_redundant_experts=self.n_redundant_experts)