Skip to content

Commit

Permalink
[Bugfix] Fix ray instance detect issue (vllm-project#9439)
Browse files Browse the repository at this point in the history
  • Loading branch information
yma11 authored Oct 28, 2024
1 parent feb92fb commit 2adb440
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 2adb440

Please sign in to comment.