Skip to content

Commit de80783

Browse files
authored
[Misc] Use ray[adag] dependency instead of cuda (vllm-project#7938)
1 parent e5cab71 commit de80783

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ WORKDIR /workspace
3737

3838
# install build and runtime dependencies
3939
COPY requirements-common.txt requirements-common.txt
40-
COPY requirements-adag.txt requirements-adag.txt
4140
COPY requirements-cuda.txt requirements-cuda.txt
4241
RUN --mount=type=cache,target=/root/.cache/pip \
4342
python3 -m pip install -r requirements-cuda.txt
@@ -66,7 +65,6 @@ COPY setup.py setup.py
6665
COPY cmake cmake
6766
COPY CMakeLists.txt CMakeLists.txt
6867
COPY requirements-common.txt requirements-common.txt
69-
COPY requirements-adag.txt requirements-adag.txt
7068
COPY requirements-cuda.txt requirements-cuda.txt
7169
COPY pyproject.toml pyproject.toml
7270
COPY vllm vllm

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
include LICENSE
2-
include requirements-adag.txt
32
include requirements-common.txt
43
include requirements-cuda.txt
54
include requirements-rocm.txt

requirements-adag.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements-test.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Needed for Ray accelerated DAG tests
2-
-r requirements-adag.txt
3-
41
# testing
52
pytest
63
tensorizer>=2.9.0
@@ -16,7 +13,7 @@ httpx
1613
librosa # required for audio test
1714
peft
1815
requests
19-
ray
16+
ray[adag]>=2.35
2017
sentence-transformers # required for embedding
2118
soundfile # required for audio test
2219
compressed-tensors==0.4.0 # required for compressed-tensors

vllm/executor/ray_gpu_executor.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,18 +427,34 @@ def _wait_for_tasks_completion(self, parallel_worker_tasks: Any) -> None:
427427
async_run_remote_workers_only to complete."""
428428
ray.get(parallel_worker_tasks)
429429

430-
def _compiled_ray_dag(self, enable_asyncio: bool):
430+
def _check_ray_adag_installation(self):
431431
import pkg_resources
432432
from packaging import version
433433

434-
required_version = version.parse("2.32")
434+
required_version = version.parse("2.35")
435435
current_version = version.parse(
436436
pkg_resources.get_distribution("ray").version)
437437
if current_version < required_version:
438438
raise ValueError(f"Ray version {required_version} or greater is "
439439
f"required, but found {current_version}")
440440

441+
import importlib.util
442+
adag_spec = importlib.util.find_spec(
443+
"ray.experimental.compiled_dag_ref")
444+
if adag_spec is None:
445+
raise ValueError("Ray accelerated DAG is not installed. "
446+
"Run `pip install ray[adag]` to install it.")
447+
448+
cupy_spec = importlib.util.find_spec("cupy")
449+
if cupy_spec is None and envs.VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL:
450+
raise ValueError(
451+
"cupy is not installed but required since "
452+
"VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL is set."
453+
"Run `pip install ray[adag]` and check cupy installation.")
454+
455+
def _compiled_ray_dag(self, enable_asyncio: bool):
441456
assert self.parallel_config.use_ray
457+
self._check_ray_adag_installation()
442458
from ray.dag import InputNode, MultiOutputNode
443459
from ray.experimental.channel.torch_tensor_type import TorchTensorType
444460

0 commit comments

Comments
 (0)