"...git@developer.sourcefind.cn:2222/OpenDAS/vllm_cscc.git" did not exist on "e858bc4d1490808e23bbc32e17202ebbf8713a76"
Commit e0ba23b5 authored by 王敏's avatar 王敏
Browse files

修复部分代码

parent 46e26bf1
...@@ -227,15 +227,21 @@ class DeepseekV2MoE(nn.Module): ...@@ -227,15 +227,21 @@ class DeepseekV2MoE(nn.Module):
router_logits, _ = self.gate(hidden_states) router_logits, _ = self.gate(hidden_states)
if not self.use_mori_ep: if not self.use_mori_ep:
if hidden_states.dtype != torch.float16: if envs.VLLM_USE_LIGHTOP and not self.dpsk_fp16_quick:
final_hidden_states = self.experts( final_hidden_states = self.experts(
hidden_states=hidden_states, hidden_states=hidden_states,
router_logits=router_logits) * self.routed_scaling_factor router_logits=router_logits,
shared_output=shared_output)
else: else:
# Fix FP16 overflow if hidden_states.dtype != torch.float16 or self.dpsk_fp16_quick:
# See DeepseekV2DecoderLayer for more details. final_hidden_states = self.experts(
final_hidden_states = self.experts(hidden_states=hidden_states, hidden_states=hidden_states,
router_logits=router_logits) router_logits=router_logits) * self.routed_scaling_factor
else:
# Fix FP16 overflow
# See DeepseekV2DecoderLayer for more details.
final_hidden_states = self.experts(hidden_states=hidden_states,
router_logits=router_logits)
else: else:
final_hidden_states = self.experts(hidden_states=hidden_states, final_hidden_states = self.experts(hidden_states=hidden_states,
router_logits=router_logits) router_logits=router_logits)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment