Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bmosaicml committed Jan 23, 2024
1 parent ef56d03 commit 936ebfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion composer/metrics/nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def sync(
):
# this is based off the gather_all_tensors utility function in torchmetrics, except it works with non-tensor objects
# (in particular, lists of strings). Link here: https://github.com/Lightning-AI/torchmetrics/blob/99d6d9d6ac4eb1b3398241df558604e70521e6b0/src/torchmetrics/utilities/distributed.py#L97-L148
if should_sync:
if torch.distributed.is_initialized() and should_sync:
print(f"Syncing")
group = process_group or self.process_group
world_size = torch.distributed.get_world_size(group) # pyright: ignore [reportGeneralTypeIssues]
Expand Down

0 comments on commit 936ebfc

Please sign in to comment.