"...text-generation-inference.git" did not exist on "e6d29656b50c741484b43479bc560a0fc64c97cd"
Unverified Commit 4e2dc4e4 authored by Jeff Rasley's avatar Jeff Rasley Committed by GitHub
Browse files

Add deepspeed.init_distributed to RTD page (#645)


Co-authored-by: default avatarOlatunji Ruwase <olruwase@microsoft.com>
parent 8cea96dd
...@@ -12,15 +12,17 @@ def init_distributed(dist_backend="nccl", ...@@ -12,15 +12,17 @@ def init_distributed(dist_backend="nccl",
auto_mpi_discovery=True, auto_mpi_discovery=True,
distributed_port=TORCH_DISTRIBUTED_DEFAULT_PORT, distributed_port=TORCH_DISTRIBUTED_DEFAULT_PORT,
verbose=True): verbose=True):
""" """Initialize torch.distributed backend, potentially performing MPI discovery if needed.
Initialize torch.distributed backend, potentially performing MPI discovery if needed
Arguments: Arguments:
dist_backend (str): torch distributed backend, e.g., nccl, mpi, gloo dist_backend: torch distributed backend, e.g., nccl, mpi, gloo
auto_mpi_discovery (bool): if distributed environment variables are not set, attempt to discover them from MPI
distributed_port (int, optional): torch distributed backend port
verbose (bool, optional): verbose logging
"""
auto_mpi_discovery: if distributed environment variables are not set, attempt to discover them from MPI
distributed_port: torch distributed backend port
verbose: verbose logging
"""
required_env = ["RANK", "WORLD_SIZE", "MASTER_ADDR", "MASTER_PORT", "LOCAL_RANK"] required_env = ["RANK", "WORLD_SIZE", "MASTER_ADDR", "MASTER_PORT", "LOCAL_RANK"]
if auto_mpi_discovery and not all(map(lambda v: v in os.environ, required_env)): if auto_mpi_discovery and not all(map(lambda v: v in os.environ, required_env)):
if verbose: if verbose:
......
...@@ -25,7 +25,7 @@ to add DeepSpeed's builtin arguments to your application's parser. ...@@ -25,7 +25,7 @@ to add DeepSpeed's builtin arguments to your application's parser.
Training Initialization Training Initialization
----------------------- -----------------------
The entrypoint for all training with DeepSpeed is ``deepspeed.initialize()``. The entrypoint for all training with DeepSpeed is ``deepspeed.initialize()``. Will initialize distributed backend if it is not intialized already.
Example usage: Example usage:
...@@ -36,3 +36,9 @@ Example usage: ...@@ -36,3 +36,9 @@ Example usage:
model_parameters=net.parameters()) model_parameters=net.parameters())
.. autofunction:: deepspeed.initialize .. autofunction:: deepspeed.initialize
Distributed Initialization
-----------------------
Optional distributed backend initializating separate from ``deepspeed.initialize()``. Useful in scenarios where the user wants to use torch distributed calls before calling ``deepspeed.initialize()``, such as when using model parallelism, pipeline parallelism, or certain data loader scenarios.
.. autofunction:: deepspeed.init_distributed
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment