Skip to content

Commit

Permalink
Add pyarrow to dependencies & Print warning on Ray import error (vllm…
Browse files Browse the repository at this point in the history
  • Loading branch information
WoosukKwon authored Sep 19, 2023
1 parent 023ec76 commit e0d6e5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion vllm/engine/ray_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
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
Expand All @@ -28,7 +31,10 @@ def execute_method(self, method, *args, **kwargs):
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
Expand Down

0 comments on commit e0d6e5e

Please sign in to comment.