Skip to content

Commit dd5f1d4

Browse files
shikang-hangzhou22dimensions
authored andcommitted
Signed-off-by: 22dimensions <waitingwind@foxmail.com>
1 parent 5f0b42e commit dd5f1d4

File tree

11 files changed

+367
-307
lines changed

11 files changed

+367
-307
lines changed

examples/offline_data_parallel.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,16 @@
5454
--master-port=13345
5555
"""
5656

57-
import os
58-
from time import sleep
5957
import contextlib
6058
import gc
59+
import os
60+
from time import sleep
6161

6262
import torch
63-
6463
from vllm import LLM, SamplingParams
65-
from vllm.utils import get_open_port
6664
from vllm.distributed.parallel_state import ( # noqa E402
6765
destroy_distributed_environment, destroy_model_parallel)
66+
from vllm.utils import get_open_port
6867

6968
os.environ["VLLM_USE_MODELSCOPE"] = "True"
7069
os.environ["VLLM_WORKER_MULTIPROC_METHOD"] = "spawn"

tests/e2e/singlecard/test_aclgraph.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
Run `pytest tests/compile/test_aclgraph.py`.
2121
"""
2222

23+
import os
24+
2325
import pytest
2426
import torch
2527
from vllm import LLM, SamplingParams
@@ -84,3 +86,16 @@ def test_deepseek_raises_error(monkeypatch: pytest.MonkeyPatch) -> None:
8486
max_model_len=1024,
8587
enforce_eager=False)
8688
assert "ACL Graph does not support deepseek" in str(excinfo.value)
89+
90+
91+
@pytest.mark.skipif(os.getenv("VLLM_USE_V1") == "0",
92+
reason="aclgraph only support on v1")
93+
@pytest.mark.parametrize("model", MODELS)
94+
def test_ray_backend_sets_no_compilation(
95+
model: str, monkeypatch: pytest.MonkeyPatch) -> None:
96+
with monkeypatch.context() as m:
97+
m.setenv("VLLM_USE_V1", "1")
98+
runner = VllmRunner(model,
99+
enforce_eager=False,
100+
distributed_executor_backend="ray")
101+
assert runner.model.llm_engine.vllm_config.compilation_config.level == 0

vllm_ascend/ascend_config.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,31 @@ def __init__(self, torchair_graph_config):
7676
raise ValueError(
7777
"graph_batch_sizes_init is only valid when graph_batch_sizes is empty"
7878
)
79+
if not self.enabled:
80+
if self.use_cached_graph:
81+
raise RuntimeError(
82+
"use_cached_graph is valid only when Torchair graph mode is enabled"
83+
)
84+
if self.graph_batch_sizes:
85+
raise RuntimeError(
86+
"graph_batch_sizes is valid only when Torchair graph mode is enabled"
87+
)
88+
if self.graph_batch_sizes_init:
89+
raise RuntimeError(
90+
"graph_batch_sizes_init is valid only when Torchair graph mode is enabled"
91+
)
92+
if self.enable_multistream_mla:
93+
raise RuntimeError(
94+
"enable_multistream_mla is valid only when Torchair graph mode is enabled"
95+
)
96+
if self.enable_multistream_moe:
97+
raise RuntimeError(
98+
"enable_multistream_moe is valid only when Torchair graph mode is enabled"
99+
)
100+
if self.enable_kv_nz:
101+
raise RuntimeError(
102+
"enable_kv_nz is valid only when Torchair graph mode is enabled"
103+
)
79104

80105

81106
class AscendSchedulerConfig:

0 commit comments

Comments
 (0)