diff --git a/test/test_arange.py b/test/test_arange.py index fe82f41d8b..c79255051f 100644 --- a/test/test_arange.py +++ b/test/test_arange.py @@ -159,7 +159,7 @@ class TestIndexing(unittest.TestCase): torch_emb.weight[:] = torch.tensor(emb_w, dtype=torch.float32) torch_z = torch_emb(torch.tensor(x.numpy())) # TODO: reshape to match torch, should we do this in nn? - np.testing.assert_allclose(z.numpy().reshape(4, 3), torch_z.detach().numpy(), atol=1e-8, rtol=1e-8) + np.testing.assert_allclose(z.numpy().reshape(4, embed_size), torch_z.detach().numpy(), atol=1e-8, rtol=1e-8) # at least the arange is being fused def test_llama_embedding_opt(self): self.test_llama_embedding(0, 1736704000) diff --git a/test/test_linearizer_failures.py b/test/test_linearizer_failures.py index cde86a33d6..a9d8b1221d 100644 --- a/test/test_linearizer_failures.py +++ b/test/test_linearizer_failures.py @@ -352,7 +352,7 @@ class TestLinearizerFailures(unittest.TestCase): LazyOp(BinaryOps.MUL, arg=None, src=( LazyOp(BufferOps.LOAD, arg=MemBuffer(idx=1, dtype=dtypes.half, st=ShapeTracker(views=(View(shape=(1, 256, 1, 128, 4, 58, 4, 58), strides=(0, 401408, 0, 3136, 0, 56, 0, 1), offset=-57, mask=((0, 1), (0, 256), (0, 1), (0, 128), (0, 4), (1, 57), (0, 4), (1, 57)), contiguous=False), View(shape=(256, 1, 128, 28, 28, 128, 3, 3), strides=(6889472, 0, 0, 464, 2, 53824, 13688, 59), offset=0, mask=None, contiguous=False)))), src=()), LazyOp(BufferOps.LOAD, arg=MemBuffer(idx=2, dtype=dtypes.half, st=ShapeTracker(views=(View(shape=(256, 1, 128, 28, 28, 128, 3, 3), strides=(0, 0, 1152, 0, 0, 9, 3, 1), offset=0, mask=None, contiguous=False),))), src=()),)),)),)),)),)),)) opts=[Opt(op=OptOps.TC, axis=5, amt=2), Opt(op=OptOps.UNROLL, axis=0, amt=0)] - helper_test_lin(Kernel(ast), opts=opts, failed_platforms=["AMD", "HIP"]) + helper_test_lin(Kernel(ast), opts=opts, failed_platforms=["AMD", "HIP", "METAL"]) # llama3 8B failure with BEAM=2 https://github.com/tinygrad/tinygrad/actions/runs/10150118124/job/28066519425#step:14:1, these don't compile @unittest.skipUnless(Device[Device.DEFAULT].renderer.has_local, "test needs local") diff --git a/tinygrad/engine/realize.py b/tinygrad/engine/realize.py index 7f68522e21..8d933a88a3 100644 --- a/tinygrad/engine/realize.py +++ b/tinygrad/engine/realize.py @@ -146,11 +146,11 @@ class BufferXfer(BufferCopy): # **************** method cache **************** -method_cache: Dict[Tuple[str, LazyOp, int, bool], CompiledRunner] = {} +method_cache: Dict[Tuple[str, LazyOp, int, int, bool], CompiledRunner] = {} def get_runner(dname:str, ast:LazyOp) -> CompiledRunner: - ckey = (dname, ast, BEAM.value, False) + ckey = (dname, ast, BEAM.value, NOOPT.value, False) if cret:=method_cache.get(ckey): return cret - bkey = (dname.split(":")[0], ast, BEAM.value, True) + bkey = (dname.split(":")[0], ast, BEAM.value, NOOPT.value, True) if bret:=method_cache.get(bkey): method_cache[ckey] = ret = CompiledRunner(replace(bret.p, dname=dname), bret.lib) else: