Skip to content

Commit

Permalink
change dist to torch.distributed to fix bug in assert. (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
awan-10 authored Jan 5, 2021
1 parent a9a83a6 commit d38ad6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deepspeed/utils/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def mpi_discovery(distributed_port=TORCH_DISTRIBUTED_DEFAULT_PORT, verbose=True)
os.environ['MASTER_PORT']))

if torch.distributed.is_initialized():
assert dist.get_rank() == rank, "MPI rank {} does not match torch rank {}".format(rank, dist.get_rank())
assert dist.get_world_size() == world_size, "MPI world size {} does not match torch world size {}".format(
world_size, dist.get_world_size())
assert torch.distributed.get_rank() == rank, "MPI rank {} does not match torch rank {}".format(rank, dist.get_rank())
assert torch.distributed.get_world_size() == world_size, "MPI world size {} does not match torch world size {}".format(
world_size, torch.distributed.get_world_size())


def in_aml():
Expand Down

0 comments on commit d38ad6a

Please sign in to comment.