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 12, 09:45 UTC
[Bugfix] fix dots.llm1.inst (#29687)
Signed-off-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: Roger Wang <hey@rogerw.io>
Jiangyun Zhu committed
Nov 29, 2025 at 07:25 UTC
a51f4186f20d27a8329fc40fa970e22808dd4a27
1 file changed
+6
-5
vllm/model_executor/models/dots1.py
+6
-5
@@ -181,13 +181,14 @@ class Dots1MoE(nn.Module):
181
hidden_states = hidden_states.view(-1, hidden_dim)
182
183
router_logits, _ = self.gate(hidden_states)
184
- final_hidden_states = (
185
- self.experts(hidden_states=hidden_states, router_logits=router_logits)
186
- * self.routed_scaling_factor
187
- )
184
185
+ shared_out, routed_out = self.experts(
186
+ hidden_states=hidden_states, router_logits=router_logits
187
+ )
188
if self.shared_experts is not None:
190
- final_hidden_states = final_hidden_states[0] + final_hidden_states[1]
189
+ final_hidden_states = (routed_out + shared_out) * self.routed_scaling_factor
190
+ else:
191
+ final_hidden_states = routed_out * self.routed_scaling_factor
192
193
if self.tp_size > 1:
194
final_hidden_states = tensor_model_parallel_all_reduce(final_hidden_states)