Skip to content

Commit 6c52477

Browse files
awaelchlirohitgr7SkafteNicki
authored andcommitted
skip multi-gpu test when running on single-gpu machine (#5186)
* skip test * Apply suggestions from code review Co-authored-by: Rohit Gupta <[email protected]> Co-authored-by: Nicki Skafte <[email protected]>
1 parent 9040bee commit 6c52477

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/models/test_gpu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_multi_gpu_none_backend(tmpdir):
4747
tpipes.run_model_test(trainer_options, model)
4848

4949

50-
@pytest.mark.skipif(not torch.cuda.is_available(), reason="test requires GPU machine")
50+
@pytest.mark.skipif(torch.cuda.device_count() < 2, reason="test requires multi-GPU machine")
5151
@pytest.mark.parametrize('gpus', [1, [0], [1]])
5252
def test_single_gpu_model(tmpdir, gpus):
5353
"""Make sure single GPU works (DP mode)."""

0 commit comments

Comments
 (0)