Skip to content

Commit c8c9523

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2fc5178 commit c8c9523

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
@@ -287,22 +287,18 @@ def advance(self, data_fetcher: _DataFetcher) -> None:
287287
try:
288288
sigterm_tensor = torch.tensor([0], device=self.trainer.strategy.root_device)
289289
dist.broadcast(sigterm_tensor, src=0)
290-
except Exception as e:
290+
except Exception:
291291
# log or pass silently to avoid crashing tests on CPU CI
292292
pass
293293

294-
if (
295-
dist.is_available()
296-
and dist.is_initialized()
297-
and self.trainer.world_size > 1
298-
):
294+
if dist.is_available() and dist.is_initialized() and self.trainer.world_size > 1:
299295
sigterm_tensor = torch.tensor([0], device=self.trainer.strategy.root_device)
300296
try:
301297
dist.broadcast(sigterm_tensor, src=0)
302298
if sigterm_tensor.item() == 1:
303299
dist.barrier()
304300
raise SIGTERMException()
305-
except Exception as e:
301+
except Exception:
306302
# Fallback safety: log and skip gracefully
307303
pass
308304
# =====================================================================

0 commit comments

Comments
 (0)