Skip to content

Commit

Permalink
avoid from gpu sync attempt when using single gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
Moshe Raboh [email protected] committed Sep 18, 2024
1 parent 00f7044 commit ec259f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fuse/eval/metrics/metrics_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ def collect(self, batch: Dict) -> None:
value = batch[key]

# collect distributed
if dist.is_initialized() and self._collect_distributed:
if (
dist.is_initialized()
and dist.get_world_size() > 1
and self._collect_distributed
):
value = self.sync_tensor_data_and_concat(value)

batch_to_collect[name] = value
Expand Down

0 comments on commit ec259f1

Please sign in to comment.