Skip to content

Commit ec210cb

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

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lightning/pytorch/loops/training_epoch_loop.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414
import math
1515
from collections import OrderedDict
16-
from contextlib import suppress
1716
from dataclasses import dataclass
1817
from typing import Any, Optional, Union
1918

@@ -277,7 +276,7 @@ def advance(self, data_fetcher: _DataFetcher) -> None:
277276

278277
# =====================================================================
279278
from lightning.pytorch.utilities.exceptions import SIGTERMException
280-
279+
281280
if dist.is_available() and dist.is_initialized() and self.trainer.world_size > 1:
282281
try:
283282
# Prepare the SIGTERM signal tensor (1 if signal received, else 0)
@@ -290,7 +289,7 @@ def advance(self, data_fetcher: _DataFetcher) -> None:
290289
except Exception:
291290
# In case broadcast fails (e.g., CPU-only or non-DDP), fallback to no SIGTERM
292291
sigterm_tensor = torch.tensor([0], device=self.trainer.strategy.root_device)
293-
292+
294293
# If SIGTERM flag is set, synchronize all ranks and raise exception to exit
295294
if sigterm_tensor.item() == 1:
296295
try:

0 commit comments

Comments
 (0)