Skip to content

Commit 343955c

Browse files
authored
[CI] Follow vLLM FusedMoEParallelConfig interface change and clean up unused config (#1625)
This commit vllm-project/vllm@78fe775 from vllm reverted the change for FusedMoEParallelConfig This PR do the same to fix the CI error Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent 4e91018 commit 343955c

File tree

4 files changed

+13
-26
lines changed

4 files changed

+13
-26
lines changed

tests/ut/test_ascend_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from transformers import PretrainedConfig
66
from vllm.config import ModelConfig, VllmConfig
77

8-
from vllm_ascend.ascend_config import (check_ascend_config,
9-
check_torchair_supported,
8+
from vllm_ascend.ascend_config import (_check_torchair_supported,
9+
check_ascend_config,
1010
clear_ascend_config, get_ascend_config,
1111
init_ascend_config)
1212

@@ -248,5 +248,5 @@ def test_check_torchair_supported(self):
248248
test_cases = [('deepseek_v3', True), ('PanguProMoE', True),
249249
('qwen', False), ('llama', False)]
250250
for model_type, expected_output in test_cases:
251-
self.assertEqual(check_torchair_supported(model_type),
251+
self.assertEqual(_check_torchair_supported(model_type),
252252
expected_output)

vllm_ascend/ascend_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
TORCHAIR_MODEL_LIST = ["deepseek", "pangu"]
2222

2323

24-
def check_torchair_supported(model_type: str):
24+
def _check_torchair_supported(model_type: str):
2525
for supported_model in TORCHAIR_MODEL_LIST:
2626
if supported_model in model_type.lower():
2727
return True
@@ -147,10 +147,10 @@ def check_ascend_config(vllm_config, enforce_eager):
147147
else:
148148
# torchair_graph case
149149
if ascend_config.torchair_graph_config.enabled:
150-
# torchair_graph is supported for deepseek model only currently.
150+
# torchair_graph is supported for deepseek/pangu model only.
151151
if vllm_config.model_config:
152152
model_type = vllm_config.model_config.hf_config.model_type
153-
if not check_torchair_supported(model_type):
153+
if not _check_torchair_supported(model_type):
154154
raise NotImplementedError(
155155
"Torchair graph mode only works with following model types:"
156156
f"{TORCHAIR_MODEL_LIST}.")

vllm_ascend/attention/attention_v1_torchair.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from vllm.v1.core.sched.output import SchedulerOutput
2828
from vllm.v1.worker.gpu_input_batch import InputBatch
2929

30-
from vllm_ascend.ascend_config import get_ascend_config
3130
from vllm_ascend.attention.attention_v1 import AscendAttentionState
3231
from vllm_ascend.utils import (ACL_FORMAT_FRACTAL_NZ, aligned_16, is_310p,
3332
nd_to_nz_2d)
@@ -160,8 +159,6 @@ class AscendAttentionTorchairMetadataBuilder:
160159

161160
def __init__(self, runner):
162161
self.runner = runner
163-
self.torchair_graph_enabled = get_ascend_config(
164-
).torchair_graph_config.enabled
165162

166163
def reorder_batch(self, input_batch: "InputBatch",
167164
scheduler_output: "SchedulerOutput") -> bool:

vllm_ascend/ops/fused_moe.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
from vllm.distributed import (GroupCoordinator, get_tensor_model_parallel_rank,
2727
get_tensor_model_parallel_world_size,
2828
tensor_model_parallel_all_reduce)
29-
from vllm.distributed.parallel_state import (get_dp_group, get_tp_group,
30-
get_world_group)
29+
from vllm.distributed.parallel_state import get_dp_group, get_tp_group
3130
from vllm.forward_context import get_forward_context
3231
from vllm.model_executor.layers.fused_moe.layer import (
3332
FusedMoE, UnquantizedFusedMoEMethod, determine_expert_map)
@@ -1119,21 +1118,12 @@ def __init__(
11191118

11201119
vllm_config = get_current_vllm_config()
11211120

1122-
if vllm_version_is("0.9.1"):
1123-
self.moe_parallel_config = FusedMoEParallelConfig.make(
1124-
tp_size_=(tp_size if tp_size is not None else
1125-
get_tensor_model_parallel_world_size()),
1126-
dp_size_=(dp_size if dp_size is not None else
1127-
get_dp_group().world_size),
1128-
vllm_parallel_config=vllm_config.parallel_config)
1129-
else:
1130-
self.moe_parallel_config = FusedMoEParallelConfig.make(
1131-
tp_size_=(tp_size if tp_size is not None else
1132-
get_tensor_model_parallel_world_size()),
1133-
dp_size_=(dp_size if dp_size is not None else
1134-
get_dp_group().world_size),
1135-
world_size_=get_world_group().world_size,
1136-
vllm_parallel_config=vllm_config.parallel_config)
1121+
self.moe_parallel_config = FusedMoEParallelConfig.make(
1122+
tp_size_=(tp_size if tp_size is not None else
1123+
get_tensor_model_parallel_world_size()),
1124+
dp_size_=(dp_size
1125+
if dp_size is not None else get_dp_group().world_size),
1126+
vllm_parallel_config=vllm_config.parallel_config)
11371127

11381128
self.top_k = top_k
11391129
self.num_experts = num_experts

0 commit comments

Comments
 (0)