Skip to content

Commit

Permalink
Fixes #2455
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon committed Jul 2, 2020
1 parent 0264783 commit 80988a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_lightning/callbacks/early_stopping.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def _run_early_stopping_check(self, trainer, pl_module):
should_stop = self.wait_count >= self.patience

# check flag across all GPUs
should_stop = torch.tensor(should_stop)
if trainer.use_ddp or trainer.use_ddp2:
should_stop = torch.tensor(should_stop, device=pl_module.device)
dist.all_reduce(should_stop, op=dist.ReduceOp.MAX)

# do actual stop
Expand Down

0 comments on commit 80988a3

Please sign in to comment.