From 400b8289f744c4b8cdaa2c35268192c23e90d26c Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Mon, 18 Sep 2023 22:36:17 -0700 Subject: [PATCH] Add pyarrow to dependencies & Print warning on Ray import error (#1094) --- requirements.txt | 1 + vllm/engine/ray_utils.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index bb65f440de0ae..bb189fcb47e6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ ninja # For faster builds. psutil ray >= 2.5.1 pandas # Required for Ray data. +pyarrow # Required for Ray data. sentencepiece # Required for LLaMA tokenizer. numpy torch >= 2.0.0 diff --git a/vllm/engine/ray_utils.py b/vllm/engine/ray_utils.py index 2982f0f91febe..80479967cc62f 100644 --- a/vllm/engine/ray_utils.py +++ b/vllm/engine/ray_utils.py @@ -2,6 +2,9 @@ import socket from typing import Optional, Tuple, TYPE_CHECKING from vllm.config import ParallelConfig +from vllm.logger import init_logger + +logger = init_logger(__name__) try: import ray @@ -28,7 +31,10 @@ try: executor = getattr(self, method) return executor(*args, **kwargs) -except ImportError: +except ImportError as e: + logger.warning(f"Failed to import Ray with {e!r}. " + "For distributed inference, please install Ray with " + "`pip install ray pandas pyarrow`.") ray = None TorchDistributedWorker = None RayWorker = None # pylint: disable=invalid-name