Skip to content

Commit ff0e09e

Browse files
jiqing-fengefraimdahl
authored andcommitted
TST Skip some GPU tests on non-CUDA devices (huggingface#2473)
1 parent 10bf023 commit ff0e09e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/bnb/test_bnb_regression.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def bytes_from_tensor(x):
4949
############
5050

5151

52-
@pytest.mark.skipif(not (torch.cuda.is_available() or is_xpu_available()), reason="No CUDA device available.")
52+
@pytest.mark.skipif(not torch.cuda.is_available(), reason="No CUDA device available.")
5353
def test_opt_350m_4bit():
5454
torch.manual_seed(0)
5555
bnb_config = BitsAndBytesConfig(
@@ -91,7 +91,7 @@ def test_opt_350m_8bit():
9191
torch.testing.assert_allclose(output, expected)
9292

9393

94-
@pytest.mark.skipif(not (torch.cuda.is_available() or is_xpu_available()), reason="No CUDA device available.")
94+
@pytest.mark.skipif(not torch.cuda.is_available(), reason="No CUDA device available.")
9595
def test_opt_350m_4bit_double_quant():
9696
torch.manual_seed(0)
9797
bnb_config = BitsAndBytesConfig(
@@ -114,7 +114,7 @@ def test_opt_350m_4bit_double_quant():
114114
torch.testing.assert_allclose(output, expected)
115115

116116

117-
@pytest.mark.skipif(not (torch.cuda.is_available() or is_xpu_available()), reason="No CUDA device available.")
117+
@pytest.mark.skipif(torch.cuda.is_available(), reason="No CUDA device available.")
118118
def test_opt_350m_4bit_compute_dtype_float16():
119119
torch.manual_seed(0)
120120
bnb_config = BitsAndBytesConfig(

0 commit comments

Comments
 (0)