Skip to content

Commit 22ee30d

Browse files
committed
Revert "fix"
This reverts commit 6907571. Signed-off-by: Cody Yu <hao.yu.cody@gmail.com>
1 parent 6907571 commit 22ee30d

File tree

3 files changed

+3
-55
lines changed

3 files changed

+3
-55
lines changed

examples/offline_inference/rlhf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ def __init__(self, *args, **kwargs):
4444
train_model.to("cuda:0")
4545
"""
4646
Start the inference process, here we use vLLM to hold a model on GPU 1 and
47-
GPU 2 by creating a Ray placement group. The placement group will be passed
48-
to the worker processes spawned by vLLM. For the details on how to use Ray,
49-
please refer to the Ray documentation https://docs.ray.io/en/latest/ .
47+
GPU 2. For the details on how to use ray, please refer to the ray
48+
documentation https://docs.ray.io/en/latest/ .
5049
"""
5150
os.environ["CUDA_VISIBLE_DEVICES"] = "1,2"
5251
ray.init()

vllm/envs.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
VLLM_ENABLE_MOE_ALIGN_BLOCK_SIZE_TRITON: bool = False
8787
VLLM_RAY_PER_WORKER_GPUS: float = 1.0
8888
VLLM_RAY_BUNDLE_INDICES: str = ""
89-
VLLM_RAY_PLACEMENT_GROUP: Optional[str] = None
9089
VLLM_CUDART_SO_PATH: Optional[str] = None
9190
VLLM_USE_HPU_CONTIGUOUS_CACHE_FETCH: bool = True
9291
VLLM_DP_RANK: int = 0
@@ -578,12 +577,6 @@ def maybe_convert_int(value: Optional[str]) -> Optional[int]:
578577
"VLLM_RAY_BUNDLE_INDICES":
579578
lambda: os.getenv("VLLM_RAY_BUNDLE_INDICES", ""),
580579

581-
# Ray placement group (serialized string), if it is set and
582-
# ray.util.get_current_placement_group() is None, it will be used as the
583-
# placement group in vLLM Ray executor.
584-
"VLLM_RAY_PLACEMENT_GROUP":
585-
lambda: os.getenv("VLLM_RAY_PLACEMENT_GROUP", None),
586-
587580
# In some system, find_loaded_library() may not work. So we allow users to
588581
# specify the path through environment variable VLLM_CUDART_SO_PATH.
589582
"VLLM_CUDART_SO_PATH":

vllm/executor/ray_utils.py

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
import json
43
import os
54
import time
65
from collections import defaultdict
76
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union
87

98
import msgspec
109

11-
import vllm.envs as envs
1210
import vllm.platforms
1311
from vllm.config import ParallelConfig
1412
from vllm.executor.msgspec_utils import decode_hook, encode_hook
@@ -164,41 +162,6 @@ def assert_ray_available():
164162
"`pip install ray`.") from ray_import_err
165163

166164

167-
def serialize_placement_group_to_str(placement_group: "PlacementGroup") -> str:
168-
"""Serialize a placement group to a string.
169-
FIXME: This should be implemented in Ray.
170-
171-
Args:
172-
placement_group: The placement group to serialize.
173-
174-
Returns:
175-
A string representation of the placement group.
176-
"""
177-
placement_group_data = {
178-
"id": placement_group.id.hex(),
179-
"bundle_cache": placement_group.bundle_cache,
180-
}
181-
return json.dumps(placement_group_data)
182-
183-
184-
def deserialize_placement_group_from_str(
185-
placement_group_str: str) -> "PlacementGroup":
186-
"""Deserialize a placement group from a string.
187-
FIXME: This should be implemented in Ray.
188-
189-
Args:
190-
placement_group_str: The string representation of the placement group.
191-
192-
Returns:
193-
A placement group.
194-
"""
195-
placement_group_data = json.loads(placement_group_str)
196-
return PlacementGroup(
197-
id=ray._raylet.PlacementGroupID.from_hex(placement_group_data["id"]),
198-
bundle_cache=placement_group_data["bundle_cache"],
199-
)
200-
201-
202165
def _verify_bundles(placement_group: "PlacementGroup",
203166
parallel_config: ParallelConfig, device_str: str):
204167
"""Verify a given placement group has bundles located in the right place.
@@ -345,19 +308,12 @@ def initialize_ray_cluster(
345308

346309
# Create or get the placement group for worker processes
347310
if parallel_config.placement_group:
348-
logger.info(
349-
"Using the existing Ray placement group from parallel config")
350311
current_placement_group = parallel_config.placement_group
351-
elif envs.VLLM_RAY_PLACEMENT_GROUP:
352-
logger.info("Using the existing Ray placement group from "
353-
"VLLM_RAY_PLACEMENT_GROUP")
354-
current_placement_group = deserialize_placement_group_from_str(
355-
envs.VLLM_RAY_PLACEMENT_GROUP)
356312
else:
357-
logger.info("Trying to get the existing Ray placement group")
358313
current_placement_group = ray.util.get_current_placement_group()
359314

360315
if current_placement_group:
316+
logger.info("Using the existing placement group")
361317

362318
# We are in a placement group
363319
bundles = current_placement_group.bundle_specs

0 commit comments

Comments
 (0)