Skip to content

Commit

Permalink
skip multi-gpu test when running on single-gpu machine (#5186)
Browse files Browse the repository at this point in the history
* skip test

* Apply suggestions from code review

Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Nicki Skafte <skaftenicki@gmail.com>
  • Loading branch information
3 people authored and Borda committed Jan 4, 2021
1 parent 36a493c commit a71e09d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/models/test_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_multi_gpu_none_backend(tmpdir):
tpipes.run_model_test(trainer_options, model)


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

0 comments on commit a71e09d

Please sign in to comment.