test_masked_upcast_wino check device buf_max (#6723)

This commit is contained in:
qazal
2024-09-25 11:26:53 +08:00
committed by GitHub
parent f45d178a55
commit e0d8685c99
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1694,6 +1694,7 @@ class TestHandCodedOpts(unittest.TestCase):
# float4/other hcopt shouldn't upcast last axis, since we already have 7 upcast, and the last axis is not very contiguous
assert k.upcasted == 1 and k.full_shape[-1] == 7
@unittest.skipIf((buf_max:=Device[Device.DEFAULT].renderer.buf_max) is not None and buf_max <= 37, "this test uses too many bufs")
def test_masked_upcast_wino(self):
monster = Tensor.stack(*[Tensor.stack(*[Tensor.rand(16) for _ in range(6)]) for _ in range(6)])
+1 -1
View File
@@ -269,7 +269,7 @@ class MetalRenderer(CStyleLanguage):
tensor_cores = [TensorCore(dims=(8,8,8),threads=[(0,2),(1,4),(0,2),(1,2)],expanded_shape=(2,2,2,2),upcast_axes=([(1,2)],[(1,2)],[(1,2)]),
st1_pattern=(((1,1),(0,1),(1,0),(0,3)),((0,0),(0,2),(1,3),(1,2))),st2_pattern=(((0,0),(1,1),(1,2),(0,2),(1,0)),((0,1),(0,3),(1,3))),
dtype_in=di,dtype_out=do,reduce_axes=[(0,8)]) for di,do in [(dtypes.float,dtypes.float),(dtypes.half,dtypes.float),(dtypes.half,dtypes.half)]]
bufs_max = 32
buf_max = 32
def __init__(self): self.tensor_cores = MetalRenderer.tensor_cores if os.uname().machine == "arm64" else []
# language options