Skip to content

Commit

Permalink
Add sync point only if DDP is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
BloodAxe committed Feb 13, 2024
1 parent 9b6eb79 commit 3fad92d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_toolbelt/utils/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __enter__(self):

def __exit__(self, exc_type, exc_val, exc_tb):
try:
if self.dist_is_available:
if self.dist_is_available and self.dist_is_initialized:
torch.distributed.barrier()
# torch.distributed.destroy_process_group()
except Exception as e:
Expand Down

0 comments on commit 3fad92d

Please sign in to comment.