[Feature] Add --cpu-distributed-timeout-seconds CLI Option for CPU Process Group Timeout (#42968)
Signed-off-by: fangyuchu <fangyuchu@qq.com> Signed-off-by: zWaNg3 <389750525@qq.com> Co-authored-by: zWaNg3 <389750525@qq.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
zWaNg3
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
0f66623b0d
commit
e26e1f0928
@@ -491,6 +491,16 @@ def get_cached_tcp_store_client(host: str, port: int) -> TCPStore:
|
||||
return TCPStore(host, port, is_master=False, wait_for_workers=False)
|
||||
|
||||
|
||||
def get_cpu_distributed_timeout_or_none() -> timedelta | None:
|
||||
from vllm.config import get_current_vllm_config_or_none
|
||||
|
||||
vllm_config = get_current_vllm_config_or_none()
|
||||
if vllm_config is None:
|
||||
return None
|
||||
timeout_seconds = vllm_config.parallel_config.cpu_distributed_timeout_seconds
|
||||
return timedelta(seconds=timeout_seconds) if timeout_seconds is not None else None
|
||||
|
||||
|
||||
def init_gloo_process_group(
|
||||
prefix_store: PrefixStore,
|
||||
group_rank: int,
|
||||
@@ -570,6 +580,10 @@ def stateless_init_torch_distributed_process_group(
|
||||
init_method = get_tcp_uri(host, port)
|
||||
backend = Backend(backend) # it is basically string
|
||||
timeout = _get_default_timeout(backend)
|
||||
if backend == "gloo":
|
||||
gloo_timeout = get_cpu_distributed_timeout_or_none()
|
||||
if gloo_timeout is not None:
|
||||
timeout = gloo_timeout
|
||||
|
||||
if listen_socket is not None:
|
||||
store = create_tcp_store(
|
||||
|
||||
Reference in New Issue
Block a user