constants.py 804 B

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