@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 4f510bc2a1
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

[Model] Removes redundant all-reduce operation in Qwen3MoeSparseMoeBlock (#23169)

Signed-off-by: Yizhou Liu <liu_yizhou@outlook.com>

yiz-liu committed Aug 20, 2025 at 00:18 UTC 4f510bc2a175a6eebfdceafa7013da8a3865eb38
1 file changed +1 -5
vllm/model_executor/models/qwen3_moe.py
+1 -5
@@ -139,7 +139,7 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
139 top_k=config.num_experts_per_tok,
140 hidden_size=config.hidden_size,
141 intermediate_size=config.moe_intermediate_size,
142 - reduce_results=False,
142 + reduce_results=True,
143 renormalize=config.norm_topk_prob,
144 quant_config=quant_config,
145 prefix=f"{prefix}.experts",
@@ -163,10 +163,6 @@ class Qwen3MoeSparseMoeBlock(nn.Module):
163 final_hidden_states = self.experts(hidden_states=hidden_states,
164 router_logits=router_logits)
165
166 - if self.tp_size > 1:
167 - final_hidden_states = self.experts.maybe_all_reduce_tensor_model_parallel( # noqa E501
168 - final_hidden_states)
169 -
166 return final_hidden_states.view(orig_shape)
167
168