summaryrefslogtreecommitdiff
path: root/tests/_ref.py
diff options
context:
space:
mode:
authorjdj <jdj@kunix.org>2026-10-29 11:50:22 -0700
committerjdj <jdj@kunix.org>2026-10-29 11:50:22 -0700
commita0ddfb1b2f6242fac72f98e8d6ee1888e79667f3 (patch)
treea6e19658bae8466cb177d2ade41ad9176d23c2f8 /tests/_ref.py
parent2a02fecc86a87a6f1639b80da932b1f9daed8f17 (diff)
downloadvolta-train-kernels-master.tar.gz
volta-train-kernels-master.zip
Validate offsets and canon_rope_attention shapes; default test device cuda:0 with safe skip; narrow README claimsHEADmaster
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/_ref.py')
-rw-r--r--tests/_ref.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/_ref.py b/tests/_ref.py
index dc8626b..d4d8543 100644
--- a/tests/_ref.py
+++ b/tests/_ref.py
@@ -7,7 +7,7 @@ from torch.nn.attention import SDPBackend, sdpa_kernel
def device():
- return torch.device(os.environ.get("VK_TEST_DEVICE", "cuda:1"))
+ return torch.device(os.environ.get("VK_TEST_DEVICE", "cuda:0"))
def select(dev):
@@ -20,7 +20,11 @@ def usable(dev):
"""None if the kernels can run on dev, else the reason to skip."""
if not torch.cuda.is_available():
return "no CUDA"
- if torch.cuda.get_device_capability(dev) < (7, 0):
+ try:
+ cap = torch.cuda.get_device_capability(dev)
+ except (AssertionError, RuntimeError) as e:
+ return f"{dev} unavailable: {e}"
+ if cap < (7, 0):
return "needs compute capability >= 7.0"
return None