[Bugfix] Fix Deepseek v4 non-mega-moe model init error (#44356)
Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>
This commit is contained in:
@@ -620,6 +620,14 @@ class DeepseekV4MoE(nn.Module):
|
||||
self.experts_start_idx = self.tp_rank * self.n_local_experts
|
||||
self.experts_end_idx = self.experts_start_idx + self.n_local_experts
|
||||
|
||||
self.n_redundant_experts = 0
|
||||
self.n_shared_experts = config.n_shared_experts or 0
|
||||
self.n_logical_experts = self.n_routed_experts
|
||||
self.n_physical_experts = self.n_logical_experts
|
||||
self.n_local_physical_experts = self.n_local_experts
|
||||
self.physical_expert_start = self.experts_start_idx
|
||||
self.physical_expert_end = self.experts_end_idx
|
||||
|
||||
self.experts = FusedMoE(
|
||||
shared_experts=self.shared_experts,
|
||||
gate=self.gate,
|
||||
|
||||
Reference in New Issue
Block a user