Skip to content

Commit

Permalink
Fix ray instance detect issue
Browse files Browse the repository at this point in the history
Signed-off-by: yan ma <[email protected]>
  • Loading branch information
yma11 committed Oct 24, 2024
1 parent b7df53c commit af18da6
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 is_hip() 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 af18da6

Please sign in to comment.