summaryrefslogtreecommitdiff
path: root/tests/test_autograd.py
diff options
context:
space:
mode:
authorTim Dettmers <tim.dettmers@gmail.com>2022-09-05 16:23:03 -0700
committerTim Dettmers <tim.dettmers@gmail.com>2022-09-05 16:23:03 -0700
commiteab4d8232d558f2e6bd7f7cc3d00e2e6e94f4e80 (patch)
tree1a70991e0d9d5632a20388bf87e4c56dfb06d64e /tests/test_autograd.py
parent5d9bc7a301618d6642a70951ac46637d4889c82b (diff)
parent8e7053a988f7bf6c0b2605a3d0ec461f5d9b05e4 (diff)
Merge branch 'bugfix_cpu_and_cc' into main
Diffstat (limited to 'tests/test_autograd.py')
-rw-r--r--tests/test_autograd.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_autograd.py b/tests/test_autograd.py
index 0cd17c9..bae26de 100644
--- a/tests/test_autograd.py
+++ b/tests/test_autograd.py
@@ -40,6 +40,7 @@ names = [
ids=names,
)
def test_matmul(dim1, dim2, dim3, dim4, funcs, dtype, req_grad, transpose):
+ if not torch.cuda.is_available(): pytest.skip('No GPU found.')
if dim2 > 0:
dim2 = dim2 - (dim2 % 16)
dim3 = dim3 - (dim3 % 16)
@@ -306,6 +307,7 @@ def test_matmullt(
has_fp16_weights,
has_bias
):
+ if not torch.cuda.is_available(): pytest.skip('No GPU found.')
dimA = (dim2, dim3) if not transpose[0] else (dim3, dim2)
dimB = (dim3, dim4) if not transpose[1] else (dim4, dim3)
outlier_dim = torch.randint(0, dimA[1], size=(dimA[1] // 8,), device="cuda")