From bc652ab14b5b0496e3fa97eccf50651af7206ea8 Mon Sep 17 00:00:00 2001 From: yan ma Date: Thu, 24 Oct 2024 18:59:57 +0800 Subject: [PATCH] Revert "unify init logic for all platforms" This reverts commit 74b9123c2c4c33c5adf94873180933f67689248e. Signed-off-by: yan ma --- vllm/executor/ray_utils.py | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/vllm/executor/ray_utils.py b/vllm/executor/ray_utils.py index e6b05cd378603..0114b200e28d5 100644 --- a/vllm/executor/ray_utils.py +++ b/vllm/executor/ray_utils.py @@ -10,11 +10,7 @@ from vllm.logger import init_logger from vllm.platforms import current_platform from vllm.sequence import ExecuteModelRequest, IntermediateTensors -<<<<<<< HEAD from vllm.utils import get_ip, is_hip -======= -from vllm.utils import get_ip ->>>>>>> unify init logic for all platforms from vllm.worker.worker_base import WorkerWrapperBase logger = init_logger(__name__) @@ -234,31 +230,17 @@ def initialize_ray_cluster( """ assert_ray_available() # Connect to a ray cluster. -<<<<<<< HEAD -<<<<<<< HEAD if is_hip() or current_platform.is_xpu(): - ray.init(address=ray_address, - ignore_reinit_error=True, - num_gpus=parallel_config.world_size) -======= - if is_hip() or is_xpu(): # Try to connect existing ray instance and create a new one if not found -======= - if ray_address is None: - # Try to connect latest created ray instance and create - # a new one if not found ->>>>>>> unify init logic for all platforms try: - ray.init("auto") + ray.init('auto') except ConnectionError: logger.warning( - "Neither ray_address specified nor existing RAY instance" - " detected. A new instance will be launched with current" - " node resources.") - ray.init(address=None, + "No existing RAY instance detected. " + "A new instance will be launched with current node resources.") + ray.init(address=ray_address, ignore_reinit_error=True, num_gpus=parallel_config.world_size) ->>>>>>> Fix ray instance detect issue else: ray.init(address=ray_address, ignore_reinit_error=True)