From 2008152c48c976a3d2858cccc9f8d301b0915df6 Mon Sep 17 00:00:00 2001 From: zhanghw0354 Date: Thu, 31 Jul 2025 15:30:28 +0800 Subject: [PATCH] [main][bugfix]Fix vLLM startup failure when inferring DeepSeek R1 model in DP scenario (#2020) ### What this PR does / why we need it? Fix vLLM startup failure when inferring DeepSeek R1 model in DP scenario. When running vLLM inference for the DeepSeek R1 model in DP32+TP1 configuration, the vLLM service fails to start with the following error. 21b2011042d4f77f36f5243fa64d9c18 The root cause is a missing else branch after [this line of code](https://github.com/vllm-project/vllm-ascend/blob/d629f0b2b573c3ba858a09fc93c42f2c2634e043/vllm_ascend/ops/fused_moe.py#L1411). This PR fixes the issue. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? CI passed with new added/existing test. - vLLM version: v0.10.0 - vLLM main: https://github.com/vllm-project/vllm/commit/5bbaf492a6238ff517249e73151ae9989f7bea9e --------- Signed-off-by: zhanghaiwen Co-authored-by: zhanghaiwen --- vllm_ascend/ops/fused_moe.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vllm_ascend/ops/fused_moe.py b/vllm_ascend/ops/fused_moe.py index 6b3338a..451b1ca 100644 --- a/vllm_ascend/ops/fused_moe.py +++ b/vllm_ascend/ops/fused_moe.py @@ -1469,6 +1469,8 @@ class AscendFusedMoE(FusedMoE): e_hidden_states, dim=0) final_hidden_states = final_hidden_states[:num_tokens] dispose_tensor(e_hidden_states) + else: + final_hidden_states = e_hidden_states else: final_hidden_states = e_hidden_states