@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / dfb9af2014
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 Shared Expert/Zero expert code in FusedMoE.process_chunk (#25698)

Signed-off-by: Sage Moore <sage@neuralmagic.com> Co-authored-by: Robert Shaw <114415538+robertgshaw2-redhat@users.noreply.github.com>

Sage Moore committed Sep 26, 2025 at 01:25 UTC dfb9af20142a848b114ee2bbe3e148856f59c552
1 file changed +3 -1
vllm/model_executor/layers/fused_moe/layer.py
+3 -1
@@ -1925,7 +1925,9 @@ class FusedMoE(CustomOp):
1925 assert self.shared_experts is None or isinstance(
1926 final_hidden_states, tuple)
1927
1928 - if isinstance(final_hidden_states, tuple):
1928 + if self.zero_expert_num is not None and self.zero_expert_num > 0:
1929 + assert isinstance(final_hidden_states, tuple)
1930 + assert self.shared_experts is None
1931 final_hidden_states, zero_expert_result = final_hidden_states
1932 if zero_expert_result is not None:
1933 final_hidden_states += zero_expert_result