[Core][Distributed] use cpu/gloo to initialize pynccl (#4248)
This commit is contained in:
@@ -2,7 +2,7 @@ import contextlib
|
||||
from typing import Optional
|
||||
|
||||
import torch
|
||||
from torch.distributed import ReduceOp
|
||||
from torch.distributed import ProcessGroup, ReduceOp
|
||||
|
||||
from vllm.logger import init_logger
|
||||
|
||||
@@ -37,17 +37,11 @@ def set_pynccl_stream(stream: torch.cuda.Stream):
|
||||
pass
|
||||
|
||||
|
||||
def init_process_group(world_size: int,
|
||||
rank: int,
|
||||
init_method: str,
|
||||
local_rank: int = -1) -> None:
|
||||
def init_process_group(group: Optional[ProcessGroup] = None) -> None:
|
||||
assert not is_initialized()
|
||||
global comm
|
||||
logger.info(f"vLLM is using nccl=={ncclGetVersion()}")
|
||||
comm = NCCLCommunicator(init_method=init_method,
|
||||
world_size=world_size,
|
||||
local_rank=local_rank,
|
||||
rank=rank)
|
||||
comm = NCCLCommunicator(group=group)
|
||||
|
||||
|
||||
def all_reduce(input_: torch.Tensor, op=ReduceOp.SUM) -> None:
|
||||
|
||||
Reference in New Issue
Block a user