[BugFix] Fix routed_scaling_factor double mul for dots1 and glm4 MoE models (#24132)
Signed-off-by: Yong Hoon Shin <yhshin@meta.com>
This commit is contained in:
@@ -137,7 +137,8 @@ class Dots1MoE(nn.Module):
|
|||||||
topk_group=config.topk_group,
|
topk_group=config.topk_group,
|
||||||
prefix=f"{prefix}.experts",
|
prefix=f"{prefix}.experts",
|
||||||
scoring_func=config.scoring_func,
|
scoring_func=config.scoring_func,
|
||||||
routed_scaling_factor=self.routed_scaling_factor,
|
# we do scaling outside, set factor to 1.0 to avoid double mul
|
||||||
|
routed_scaling_factor=1.0,
|
||||||
e_score_correction_bias=self.gate.e_score_correction_bias)
|
e_score_correction_bias=self.gate.e_score_correction_bias)
|
||||||
|
|
||||||
if config.n_shared_experts is not None:
|
if config.n_shared_experts is not None:
|
||||||
|
|||||||
@@ -159,7 +159,8 @@ class Glm4MoE(nn.Module):
|
|||||||
topk_group=config.topk_group,
|
topk_group=config.topk_group,
|
||||||
prefix=f"{prefix}.experts",
|
prefix=f"{prefix}.experts",
|
||||||
scoring_func="sigmoid",
|
scoring_func="sigmoid",
|
||||||
routed_scaling_factor=self.routed_scaling_factor,
|
# we do scaling outside, set factor to 1.0 to avoid double mul
|
||||||
|
routed_scaling_factor=1.0,
|
||||||
e_score_correction_bias=self.gate.e_score_correction_bias,
|
e_score_correction_bias=self.gate.e_score_correction_bias,
|
||||||
enable_eplb=self.enable_eplb,
|
enable_eplb=self.enable_eplb,
|
||||||
num_redundant_experts=self.n_redundant_experts)
|
num_redundant_experts=self.n_redundant_experts)
|
||||||
|
|||||||
Reference in New Issue
Block a user