mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/46624 Test Plan: Imported from OSS Reviewed By: glaringlee Differential Revision: D24761656 Pulled By: xuzhao9 fbshipit-source-id: b55aee5dd2b97f573a50e5bbfddde7d984943fec
26 lines
912 B
Python
26 lines
912 B
Python
from datetime import timedelta
|
|
|
|
from torch._C._distributed_rpc import (
|
|
_DEFAULT_INIT_METHOD,
|
|
_DEFAULT_NUM_SEND_RECV_THREADS,
|
|
_DEFAULT_NUM_WORKER_THREADS,
|
|
_DEFAULT_RPC_TIMEOUT_SEC,
|
|
_UNSET_RPC_TIMEOUT,
|
|
)
|
|
|
|
|
|
# For any RpcAgent.
|
|
DEFAULT_RPC_TIMEOUT_SEC: float = _DEFAULT_RPC_TIMEOUT_SEC
|
|
DEFAULT_INIT_METHOD: str = _DEFAULT_INIT_METHOD
|
|
DEFAULT_SHUTDOWN_TIMEOUT: float = 5.0
|
|
|
|
# For ProcessGroupAgent.
|
|
DEFAULT_NUM_SEND_RECV_THREADS: int = _DEFAULT_NUM_SEND_RECV_THREADS
|
|
# For TensorPipeAgent.
|
|
DEFAULT_NUM_WORKER_THREADS: int = _DEFAULT_NUM_WORKER_THREADS
|
|
# Ensure that we don't time out when there are long periods of time without
|
|
# any operations against the underlying ProcessGroup.
|
|
DEFAULT_PROCESS_GROUP_TIMEOUT: timedelta = timedelta(milliseconds=2 ** 31 - 1)
|
|
# Value indicating that timeout is not set for RPC call, and the default should be used.
|
|
UNSET_RPC_TIMEOUT: float = _UNSET_RPC_TIMEOUT
|