Skip to content

Commit

Permalink
Revert "unify init logic for all platforms"
Browse files Browse the repository at this point in the history
This reverts commit 74b9123.

Signed-off-by: yan ma <[email protected]>
  • Loading branch information
yma11 committed Oct 24, 2024
1 parent 2b95ce7 commit bc652ab
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions vllm/executor/ray_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit bc652ab

Please sign in to comment.