diff --git a/vllm/executor/ray_utils.py b/vllm/executor/ray_utils.py index 5ee0045a26672..627776559372c 100644 --- a/vllm/executor/ray_utils.py +++ b/vllm/executor/ray_utils.py @@ -10,7 +10,7 @@ from vllm.logger import init_logger from vllm.platforms import current_platform from vllm.sequence import ExecuteModelRequest, IntermediateTensors -from vllm.utils import get_ip, is_hip, is_xpu +from vllm.utils import get_ip from vllm.worker.worker_base import WorkerWrapperBase logger = init_logger(__name__) @@ -230,15 +230,17 @@ def initialize_ray_cluster( """ assert_ray_available() # Connect to a ray cluster. - 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 try: ray.init("auto") except ConnectionError: logger.warning( - "No existing RAY instance detected. " - "A new instance will be launched with current node resources.") - ray.init(address=ray_address, + "Neither ray_address specified nor existing RAY instance" + " detected. A new instance will be launched with current" + " node resources.") + ray.init(address=None, ignore_reinit_error=True, num_gpus=parallel_config.world_size) else: