Skip to content

Commit dfb9af2

Browse files
[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>
1 parent 19f76ee commit dfb9af2

File tree

1 file changed

+3
-1
lines changed
  • vllm/model_executor/layers/fused_moe

1 file changed

+3
-1
lines changed

vllm/model_executor/layers/fused_moe/layer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,9 @@ def process_chunk(chunk_start, chunk_end, skip_result_store=False):
19251925
assert self.shared_experts is None or isinstance(
19261926
final_hidden_states, tuple)
19271927

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
19291931
final_hidden_states, zero_expert_result = final_hidden_states
19301932
if zero_expert_result is not None:
19311933
final_hidden_states += zero_expert_result

0 commit comments

Comments
 (0)