              dtype=dtype,
          ),
          diagonal=0,
+@@ -121,7 +122,7 @@ def test_attention_fwd_bwd(
+ 
+     # Torch version:
+     torch_q, torch_k, torch_v = [x.clone() for x in qkvs]
+-    attn_mask = 1e6 * (-1 + (attn_mask.reshape((1, 1, n_ctx, n_ctx)).cuda()))
++    attn_mask = 1e6 * (-1 + (attn_mask.reshape((1, 1, n_ctx, n_ctx)).to(device=device)))
+     torch_q.retain_grad()
+     torch_k.retain_grad()
+     torch_v.retain_grad()
 diff --git a/python/test/unit/operators/test_cross_entropy.py b/python/test/unit/operators/test_cross_entropy.py
 index 48cb303b..8a683319 100644
 --- a/python/test/unit/operators/test_cross_entropy.py

From f87e78ed1d68ece7907df5e4836c961655ee632a Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Wed, 2 Mar 2022 17:26:00 +1100
Subject: [PATCH 6/6] fixturize device

     def kernel(X, N, seed):
         offset = tl.program_id(0) * BLOCK + tl.arange(0, BLOCK)
diff --git a/python/test/unit/operators/test_blocksparse.py b/python/test/unit/operators/test_blocksparse.py
index 3b9a1c17..55608499 100644
--- a/python/test/unit/operators/test_blocksparse.py
+++ b/python/test/unit/operators/test_blocksparse.py
@@ -8,12 +8,12 @@ import pytest
