diff --git a/test/test_rangeify.py b/test/test_rangeify.py index a40bcbb4a6..0febe622d8 100644 --- a/test/test_rangeify.py +++ b/test/test_rangeify.py @@ -116,10 +116,10 @@ class TestRangeify(unittest.TestCase): out.realize() def test_flash_attention(self): - #BS, HEADS, SEQLEN, EMB = 4, 2, 16, 8 + BS, HEADS, SEQLEN, EMB = 4, 2, 16, 8 # bigger - BS, HEADS, SEQLEN, EMB = 4, 32, 128, 64 + #BS, HEADS, SEQLEN, EMB = 4, 32, 128, 64 # llama 8B #BS, HEADS, SEQLEN, EMB = 4, 32, 2048, 128 diff --git a/tinygrad/codegen/late/devectorizer.py b/tinygrad/codegen/late/devectorizer.py index 9b8e2a4d16..b1b150beb0 100644 --- a/tinygrad/codegen/late/devectorizer.py +++ b/tinygrad/codegen/late/devectorizer.py @@ -238,7 +238,6 @@ def no_vectorized_buf(buf:UOp): def no_vectorized_index(buf:UOp, cast:UOp, idx:UOp): cnt = cast.dtype.count - if idx.dtype.count > 1: return None assert idx.dtype.count == 1, f"idx dtype must be 1 {idx.dtype}" return buf.broadcast(cnt).index(idx.broadcast(cnt)*cnt+UOp.const(dtypes.int.vec(cnt), tuple(range(cnt)))) diff --git a/tinygrad/codegen/late/expander.py b/tinygrad/codegen/late/expander.py index 50dafcbdbf..bd88548d87 100644 --- a/tinygrad/codegen/late/expander.py +++ b/tinygrad/codegen/late/expander.py @@ -86,7 +86,7 @@ expander = PatternMatcher([ (UPat(Ops.UNROLL, name="outer", src=(UPat(Ops.UNROLL, name="inner"),)), lambda outer, inner: UOp(Ops.UNROLL, outer.dtype, (inner.src[0],), inner.arg+outer.arg)), # do expansion - (UPat((*GroupOp.ALU, Ops.CAST, Ops.BITCAST, Ops.GEP, Ops.WMMA, Ops.LOAD, Ops.STORE, Ops.INDEX, #Ops.BUFFERIZE, + (UPat((*GroupOp.ALU, Ops.CAST, Ops.BITCAST, Ops.GEP, Ops.WMMA, Ops.LOAD, Ops.STORE, Ops.INDEX, Ops.BUFFERIZE, Ops.VECTORIZE, Ops.IF, Ops.REDUCE), name="root", custom_early_reject=set([Ops.UNROLL])), do_expand), (UPat(Ops.CONTRACT, name="con"), do_contract), # BARRIERs aren't actually expanded diff --git a/tinygrad/uop/ops.py b/tinygrad/uop/ops.py index 8ed9e107c8..28b7b40488 100644 --- a/tinygrad/uop/ops.py +++ b/tinygrad/uop/ops.py @@ -211,8 +211,6 @@ class UOp(MathTrait, metaclass=UOpMetaClass): if len(delete_ranges): for s in UOp.sink(*delete_ranges).ranges: if s in ret: del ret[s] - elif self.op in {Ops.BARRIER}: - ret = {x:None for x in self.src[0].ranges if x.arg[1] != AxisType.LOCAL} else: for s in self.src: ret.update(s.ranges) return ret diff --git a/tinygrad/uop/spec.py b/tinygrad/uop/spec.py index 0036f80047..0d9e210616 100644 --- a/tinygrad/uop/spec.py +++ b/tinygrad/uop/spec.py @@ -202,7 +202,7 @@ spec = PatternMatcher([ (UPat(Ops.ENDRANGE, dtype=dtypes.void, src=(UPat(Ops.RANGE),)), lambda: True), # WMMA has a - (UPat(Ops.WMMA, src=(UPat(), UPat(), UPat()), allow_any_len=True, name="x"), lambda x: isinstance(x.arg, tuple) and len(x.arg) == 8), + (UPat(Ops.WMMA, src=(UPat(), UPat(), UPat()), name="x"), lambda x: isinstance(x.arg, tuple) and len(x.arg) == 8), (UPat(Ops.CONTRACT, name="x"), lambda x: x.dtype.count == prod(y[1] for y in x.arg)), (UPat(Ops.UNROLL, name="x"), lambda x: x.src[0].dtype.count == prod(y[1] for y in x.arg)),