Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion roll/third_party/vllm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ async def create_async_llm(resource_placement_groups: List[Dict], **kwargs):
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = ""
# torch.cuda may already init, explicitly disable expandable_segments
# here (only matters when VLLM_USE_RAY_SPMD_WORKER=0)
current_platform.memory._set_allocator_settings("expandable_segments:False")
if not current_platform.is_npu():
current_platform.memory._set_allocator_settings("expandable_segments:False")

os.environ["VLLM_CACHE_ROOT"] = os.path.join(get_default_cache_root(), "vllm", os.environ.get("WORKER_NAME", ""))

Expand Down
2 changes: 1 addition & 1 deletion roll/third_party/vllm/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def broadcast_parameter(self, names, dtypes, shapes, group_name, is_lora=False):
weights_and_handles = []
for name, dtype, shape in zip(names, dtypes, shapes):
target_dtype = dtype if isinstance(dtype, torch.dtype) else getattr(torch, dtype)
weight = torch.empty(shape, dtype=target_dtype, device=self.device)
weight = torch.empty(shape, dtype=target_dtype, device=current_platform.device_type)
handle = collective.broadcast(tensor=weight, src_rank=0, group_name=group_name, async_op=True)
weights_and_handles.append((name, weight, handle))

Expand Down
Loading