constants.py 788 B

123456789101112131415161718192021
  1. # Copyright (c) Microsoft Corporation.
  2. # SPDX-License-Identifier: Apache-2.0
  3. # DeepSpeed Team
  4. import os
  5. from datetime import timedelta
  6. #############################################
  7. # Torch distributed constants
  8. #############################################
  9. TORCH_DISTRIBUTED_DEFAULT_PORT = 29500
  10. # Default process group wide timeout, if applicable.
  11. # This only applies to the gloo and nccl backends
  12. # (only if NCCL_BLOCKING_WAIT or NCCL_ASYNC_ERROR_HANDLING is set to 1).
  13. # To make an attempt at backwards compatibility with THD, we use an
  14. # extraordinarily high default timeout, given that THD did not have timeouts.
  15. default_pg_timeout = timedelta(minutes=int(os.getenv("DEEPSPEED_TIMEOUT", default=30)))
  16. INFERENCE_GENERIC_MODE = 'generic'
  17. INFERENCE_SPECIALIZED_MODE = 'specialized'