Skip to content

Commit

Permalink
fix issue in accelerate. (#2121)
Browse files Browse the repository at this point in the history
Co-authored-by: Ammar Ahmad Awan <ammar.awan@microsoft.com>
  • Loading branch information
Quentin-Anthony and awan-10 authored Jul 21, 2022
1 parent 80d0a32 commit 9f5895c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions deepspeed/comm/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ def __init__(self, backend, timeout, init_method, name='torch'):
self.init_process_group(backend, timeout, init_method)

def init_process_group(self, backend, timeout, init_method):
return torch.distributed.init_process_group(backend,
timeout=timeout,
init_method=init_method)
if not torch.distributed.is_initialized():
torch.distributed.init_process_group(backend,
timeout=timeout,
init_method=init_method)

def all_reduce(self,
tensor,
Expand Down

0 comments on commit 9f5895c

Please sign in to comment.