Skip to content

Commit ce910ca

Browse files
committed
run _select_moe_comm_method only in MoE model
Signed-off-by: realliujiaxu <realliujiaxu@163.com>
1 parent 7dc6a33 commit ce910ca

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

vllm_ascend/ops/moe/moe_comm_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
def get_moe_comm_method(
4141
moe_comm_type: Optional[MoECommType]) -> Optional[MoECommMethod]:
42-
return _MoECommMethods.get(moe_comm_type)
42+
return _MoECommMethods.get(moe_comm_type, None)
4343

4444

4545
def setup_moe_comm_method(moe_config):

vllm_ascend/worker/model_runner_v1.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,7 +1824,7 @@ def _pool(
18241824
)
18251825

18261826
def _select_moe_comm_method(self, num_tokens: int,
1827-
with_prefill: bool) -> MoECommType:
1827+
with_prefill: bool) -> Optional[MoECommType]:
18281828
"""1. If expert parallel is not enabled, we use all-gather since MC2 and all-to-all
18291829
are designed for expert parallelism.
18301830
2. If expert parallel is enabled, we need to consider the soc version and the
@@ -1847,6 +1847,9 @@ def _select_moe_comm_method(self, num_tokens: int,
18471847
Returns:
18481848
MoECommType: The selected MoE communication method.
18491849
"""
1850+
if not is_moe_model(self.vllm_config):
1851+
return None
1852+
18501853
soc_version = get_ascend_soc_version()
18511854
quant_type = getattr(self.vllm_config.model_config.hf_config,
18521855
'moe_quantize', None)

0 commit comments

Comments
 (0)