@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 969aec4bc8
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 2, 03:30 UTC

[Bugfix] Fix Deepseek v4 non-mega-moe model init error (#44356)

Signed-off-by: wzhao18 <wzhao18.sz@gmail.com>

Wei Zhao committed Jun 2, 2026 at 21:26 UTC 969aec4bc845794581fcfa5f3c0bad42023b8358
1 file changed +8
vllm/models/deepseek_v4/nvidia/model.py
+8
@@ -620,6 +620,14 @@ class DeepseekV4MoE(nn.Module):
620 self.experts_start_idx = self.tp_rank * self.n_local_experts
621 self.experts_end_idx = self.experts_start_idx + self.n_local_experts
622
623 + self.n_redundant_experts = 0
624 + self.n_shared_experts = config.n_shared_experts or 0
625 + self.n_logical_experts = self.n_routed_experts
626 + self.n_physical_experts = self.n_logical_experts
627 + self.n_local_physical_experts = self.n_local_experts
628 + self.physical_expert_start = self.experts_start_idx
629 + self.physical_expert_end = self.experts_end_idx
630 +
631 self.experts = FusedMoE(
632 shared_experts=self.shared_experts,
633 gate=self.gate,