Skip to content

Commit 873a792

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5600bff commit 873a792

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/lightning/pytorch/loops/training_epoch_loop.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,19 +277,15 @@ def advance(self, data_fetcher: _DataFetcher) -> None:
277277
# =====================================================================
278278
# FINAL: Check for SIGTERM broadcast and exit synchronously across ranks
279279
from lightning.pytorch.utilities.exceptions import SIGTERMException
280-
281-
if (
282-
dist.is_available()
283-
and dist.is_initialized()
284-
and self.trainer.world_size > 1
285-
):
280+
281+
if dist.is_available() and dist.is_initialized() and self.trainer.world_size > 1:
286282
try:
287283
sigterm_tensor = torch.tensor(
288284
[1 if getattr(self.trainer, "received_sigterm", False) else 0],
289285
device=self.trainer.strategy.root_device,
290286
)
291287
dist.broadcast(sigterm_tensor, src=0)
292-
288+
293289
if sigterm_tensor.item() == 1:
294290
dist.barrier()
295291
raise SIGTERMException()

0 commit comments

Comments
 (0)