Skip to content

Commit c1474c0

Browse files
committed
fix ge check
Signed-off-by: MengqingCao <cmq0113@163.com>
1 parent 9729773 commit c1474c0

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

vllm_ascend/platform.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import vllm.envs as envs
2424
from vllm.logger import logger
2525
from vllm.platforms import Platform, PlatformEnum
26-
from vllm.utils import supports_dynamo
2726

2827
from vllm_ascend.utils import ASCEND_QUATIZATION_METHOD, update_aclgraph_sizes
2928

@@ -131,16 +130,27 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
131130
if vllm_config.additional_config is not None:
132131
enable_graph_mode = vllm_config.additional_config.get(
133132
"enable_graph_mode", False)
134-
if enable_graph_mode and not supports_dynamo():
135-
logger.warning(
136-
"enable_graph_mode is not supported because the version of torch is too low, forcing close enable_graph_mode"
137-
)
138-
vllm_config.additional_config["enable_graph_mode"] = False
139-
if enable_graph_mode and envs.VLLM_USE_V1 and envs.VLLM_MLA_DISABLE:
140-
logger.warning(
141-
"NPU graph mode is still experimental and not supported for V1 without mla currently, "
142-
"it has been disabled automatically.")
143-
vllm_config.additional_config["enable_graph_mode"] = False
133+
if enable_graph_mode:
134+
if enforce_eager:
135+
raise RuntimeError(
136+
f"Expect enable_graph_mode != enforce_eager. However got enable_graph_mode={enable_graph_mode}"
137+
f" and enforce_eager={enforce_eager}. Please set `enforce_eager=False` if you attempt"
138+
" to enable NPU graph mode.")
139+
elif envs.VLLM_USE_V1 and envs.VLLM_MLA_DISABLE:
140+
logger.warning(
141+
"NPU graph mode is still experimental and not supported for V1 without mla currently, "
142+
"it has been disabled automatically.")
143+
vllm_config.additional_config["enable_graph_mode"] = False
144+
if model_config:
145+
model_type = model_config.hf_config.model_type
146+
if "deepseek" not in model_type:
147+
raise NotImplementedError(
148+
"NPU Graph only supports deepseek. Please "
149+
"disable it by additional_config={'enable_graph_mode': True} "
150+
"to serve deepseek models with NPU graph mode on vllm-ascend with V0 engine."
151+
" Or set `enforce_eager=True` to use eager mode on V1 engine."
152+
)
153+
144154
elif envs.VLLM_USE_V1 and model_config is not None and not enforce_eager:
145155
model_type = model_config.hf_config.model_type
146156
if "deepseek" in model_type:

0 commit comments

Comments
 (0)