SIGN IN SIGN UP

Pretrain, finetune ANY AI model of ANY size on 1 or 10,000+ GPUs with zero code changes.

0 0 0 Python

fix: set nonzero exit code for SIGTERMException (#21623)

* fix: set nonzero exit code for SIGTERMException (#19916)

`SIGTERMException(SystemExit)` was raised without arguments, causing
`SystemExit.code` to default to `None`, which Python converts to exit
code 0. Scripts monitoring the training process exit code could not
distinguish a SIGTERM termination from a successful exit.

Override `__init__` to pass 143 (128 + SIGTERM signal number 15) to
`SystemExit`, following the standard Unix convention.

Fixes #19916

* Apply suggestion from @deependujha

* Apply suggestion from @deependujha

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/lightning/pytorch/utilities/exceptions.py

---------

Co-authored-by: Deependu <deependujha21@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
J
Javier De Jesus committed
f4027f79f6a13e6df01d1547cfe5699a2fda0f85
Parent: 0f3691b
Committed by GitHub <noreply@github.com> on 3/30/2026, 11:27:37 AM