constants.py 829 B

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