Skip to content

Commit

Permalink
[Bugfix] Fix ray instance detect issue (#9439)
Browse files Browse the repository at this point in the history
Signed-off-by: Shanshan Wang <shanshan.wang@h2o.ai>
  • Loading branch information
yma11 authored and cooleel committed Oct 28, 2024
1 parent 55b283d commit 30ba48f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions vllm/executor/ray_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,16 @@ def initialize_ray_cluster(

# Connect to a ray cluster.
if current_platform.is_rocm() or current_platform.is_xpu():
ray.init(address=ray_address,
ignore_reinit_error=True,
num_gpus=parallel_config.world_size)
# Try to connect existing 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,
ignore_reinit_error=True,
num_gpus=parallel_config.world_size)
else:
ray.init(address=ray_address, ignore_reinit_error=True)

Expand Down

0 comments on commit 30ba48f

Please sign in to comment.