1from datetime import timedelta 2from typing import List 3 4from torch._C._distributed_rpc import ( 5 _DEFAULT_INIT_METHOD, 6 _DEFAULT_NUM_WORKER_THREADS, 7 _DEFAULT_RPC_TIMEOUT_SEC, 8 _UNSET_RPC_TIMEOUT, 9) 10 11 12# For any RpcAgent. 13DEFAULT_RPC_TIMEOUT_SEC: float = _DEFAULT_RPC_TIMEOUT_SEC 14DEFAULT_INIT_METHOD: str = _DEFAULT_INIT_METHOD 15DEFAULT_SHUTDOWN_TIMEOUT: float = 0 16 17# For TensorPipeAgent. 18DEFAULT_NUM_WORKER_THREADS: int = _DEFAULT_NUM_WORKER_THREADS 19# Ensure that we don't time out when there are long periods of time without 20# any operations against the underlying ProcessGroup. 21DEFAULT_PROCESS_GROUP_TIMEOUT: timedelta = timedelta(milliseconds=2**31 - 1) 22# Value indicating that timeout is not set for RPC call, and the default should be used. 23UNSET_RPC_TIMEOUT: float = _UNSET_RPC_TIMEOUT 24 25__all__: List[str] = [] 26