Commit 14dc2b30 authored by 王敏's avatar 王敏
Browse files

[fix]解决deepseek模型cudagraph模式下精度异常问题

parent 09c2856a
......@@ -181,6 +181,11 @@ class DeepseekV2MoE(nn.Module):
quant_config=None,
prefix=f"{prefix}.gate")
if config.topk_method == "noaux_tc":
if envs.VLLM_ENABLE_MOE_FUSED_GATE:
# avoid moe_fused_gate precision error
self.gate.e_score_correction_bias = nn.Parameter(
torch.empty(config.n_routed_experts))
else:
self.gate.e_score_correction_bias = nn.Parameter(
torch.empty(config.n_routed_experts, dtype=torch.float32))
else:
......
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