Skip to content

Commit 07c7131

Browse files
authored
[Fix] Delete redundant variable (#4903)
### What this PR does / why we need it? The variable ’is_deepseek_v3_r1‘ now is useless in the repository, so delete it now. And the funciton 'get_fused_moe_state' is used only for torchair, so it need to be deleted along with torchair ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? - vLLM version: v0.12.0 - vLLM main: vllm-project/vllm@ad32e3e Signed-off-by: hust17yixuan <[email protected]>
1 parent e1bb6f4 commit 07c7131

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

vllm_ascend/ascend_forward_context.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
import torch
77
from vllm.config import CUDAGraphMode, VllmConfig
8-
from vllm.distributed import (get_dp_group, get_ep_group,
9-
get_tensor_model_parallel_world_size)
8+
from vllm.distributed import get_dp_group, get_tensor_model_parallel_world_size
109
from vllm.forward_context import (BatchDescriptor, get_forward_context,
1110
set_forward_context)
1211

@@ -29,25 +28,6 @@ class FusedMoEState(Enum):
2928
All2AllSeq = 5
3029

3130

32-
def get_fused_moe_state(ep_size: int, with_prefill: bool,
33-
is_deepseek_v3_r1: bool):
34-
# the fusion operator torch_npu.npu_grouped_matmul_finalize_routing called by allgather ep
35-
# only supports deepseek v3/r1
36-
if (envs_ascend.VLLM_ENABLE_FUSED_EXPERTS_ALLGATHER_EP and ep_size > 1
37-
and is_deepseek_v3_r1):
38-
return FusedMoEState.AllGatherEP
39-
elif ep_size == 1:
40-
if with_prefill:
41-
return FusedMoEState.NaiveMulticast
42-
else:
43-
return FusedMoEState.AllGather
44-
# NOTE: mc2 need ep_size >= 16 & all2all can't use in torchair graph.
45-
elif ep_size < 16 or with_prefill:
46-
return FusedMoEState.All2All
47-
else:
48-
return FusedMoEState.MC2
49-
50-
5131
class MoECommType(Enum):
5232
ALLGATHER = 0
5333
MC2 = 1
@@ -95,16 +75,7 @@ def set_ascend_forward_context(
9575

9676
forward_context.with_prefill = with_prefill
9777
tp_world_size = get_tensor_model_parallel_world_size()
98-
ep_size = (get_ep_group().world_size if
99-
vllm_config.parallel_config.enable_expert_parallel else 1)
100-
101-
# fused_moe_state is used in torchair, it will be deleted along with torchair
102-
is_deepseek_v3_r1 = hasattr(
103-
vllm_config.model_config.hf_config, 'n_routed_experts'
104-
) and vllm_config.model_config.hf_config.n_routed_experts == 256
105-
fused_moe_state = get_fused_moe_state(ep_size, with_prefill,
106-
is_deepseek_v3_r1)
107-
forward_context.fused_moe_state = fused_moe_state
78+
10879
forward_context.in_profile_run = in_profile_run
10980

11081
# NOTE: This cannot be set using set_forward_context

0 commit comments

Comments
 (0)