Skip to content

Commit ebbe682

Browse files
Update test_ddp_sigterm_handling.py
1 parent c8c9523 commit ebbe682

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/tests_pytorch/trainer/test_ddp_sigterm_handling.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
from lightning.pytorch.strategies.ddp import DDPStrategy
1212
from lightning.pytorch.utilities.exceptions import SIGTERMException
1313

14+
# Skip the test if DDP or multiple devices are not available
15+
pytestmark = pytest.mark.skipif(
16+
not torch.distributed.is_available() or torch.cuda.device_count() < 2,
17+
reason="Test requires torch.distributed and at least 2 CUDA devices"
18+
)
1419

1520
class DummyModel(LightningModule):
1621
def training_step(self, batch, batch_idx):

0 commit comments

Comments
 (0)