[Refactor] Optimize select_experts (#28069)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2025-11-19 18:53:15 -05:00
committed by GitHub
parent 3aaa94ac99
commit 5031cd5d55
5 changed files with 7 additions and 15 deletions

View File

@@ -625,7 +625,7 @@ class OpenPanguDecoderLayer(nn.Module):
bias=getattr(config, "mlp_bias", False),
prefix=f"{prefix}.mlp",
)
self.routed_scaling_factor = getattr(config, "routed_scaling_factor", None)
self.routed_scaling_factor = getattr(config, "routed_scaling_factor", 1.0)
self.num_hidden_layers = config.num_hidden_layers
self.first_k_dense_replace = getattr(
config, "first_k_dense_replace", self.num_hidden_layers