Skip to content

Commit

Permalink
[Misc] Use ray[adag] dependency instead of cuda (vllm-project#7938)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisearch42 authored Sep 6, 2024
1 parent e5cab71 commit de80783
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ WORKDIR /workspace

# install build and runtime dependencies
COPY requirements-common.txt requirements-common.txt
COPY requirements-adag.txt requirements-adag.txt
COPY requirements-cuda.txt requirements-cuda.txt
RUN --mount=type=cache,target=/root/.cache/pip \
python3 -m pip install -r requirements-cuda.txt
Expand Down Expand Up @@ -66,7 +65,6 @@ COPY setup.py setup.py
COPY cmake cmake
COPY CMakeLists.txt CMakeLists.txt
COPY requirements-common.txt requirements-common.txt
COPY requirements-adag.txt requirements-adag.txt
COPY requirements-cuda.txt requirements-cuda.txt
COPY pyproject.toml pyproject.toml
COPY vllm vllm
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include LICENSE
include requirements-adag.txt
include requirements-common.txt
include requirements-cuda.txt
include requirements-rocm.txt
Expand Down
3 changes: 0 additions & 3 deletions requirements-adag.txt

This file was deleted.

5 changes: 1 addition & 4 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Needed for Ray accelerated DAG tests
-r requirements-adag.txt

# testing
pytest
tensorizer>=2.9.0
Expand All @@ -16,7 +13,7 @@ httpx
librosa # required for audio test
peft
requests
ray
ray[adag]>=2.35
sentence-transformers # required for embedding
soundfile # required for audio test
compressed-tensors==0.4.0 # required for compressed-tensors
Expand Down
20 changes: 18 additions & 2 deletions vllm/executor/ray_gpu_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,34 @@ def _wait_for_tasks_completion(self, parallel_worker_tasks: Any) -> None:
async_run_remote_workers_only to complete."""
ray.get(parallel_worker_tasks)

def _compiled_ray_dag(self, enable_asyncio: bool):
def _check_ray_adag_installation(self):
import pkg_resources
from packaging import version

required_version = version.parse("2.32")
required_version = version.parse("2.35")
current_version = version.parse(
pkg_resources.get_distribution("ray").version)
if current_version < required_version:
raise ValueError(f"Ray version {required_version} or greater is "
f"required, but found {current_version}")

import importlib.util
adag_spec = importlib.util.find_spec(
"ray.experimental.compiled_dag_ref")
if adag_spec is None:
raise ValueError("Ray accelerated DAG is not installed. "
"Run `pip install ray[adag]` to install it.")

cupy_spec = importlib.util.find_spec("cupy")
if cupy_spec is None and envs.VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL:
raise ValueError(
"cupy is not installed but required since "
"VLLM_USE_RAY_COMPILED_DAG_NCCL_CHANNEL is set."
"Run `pip install ray[adag]` and check cupy installation.")

def _compiled_ray_dag(self, enable_asyncio: bool):
assert self.parallel_config.use_ray
self._check_ray_adag_installation()
from ray.dag import InputNode, MultiOutputNode
from ray.experimental.channel.torch_tensor_type import TorchTensorType

Expand Down

0 comments on commit de80783

Please sign in to comment.