add llama3 BEAM=2 failures to test_linearizer_failures (#5553)

* skips

* opts.device

* benchmarks

* add to test_linearizer_failures

* remove hardcoded ones

* linter

* skip cpu
This commit is contained in:
qazal
2024-07-30 05:37:32 +08:00
committed by GitHub
parent cb6718347f
commit 5e827e51d2
2 changed files with 56 additions and 0 deletions

22
test/external/process_replay/restore.py vendored Normal file
View File

@@ -0,0 +1,22 @@
# restore a specific benchmark process replay
import pickle, os
from tinygrad.device import Device
from tinygrad.helpers import db_connection, VERSION, tqdm
cur = db_connection()
RUN_ID = os.environ["GITHUB_RUN_ID"]
ATTEMPT = os.environ["GITHUB_RUN_ATTEMPT"]
TABLE_NAME = f"process_replay_{RUN_ID}_{ATTEMPT}_{VERSION}"
PAGE_SIZE = 100
row_cnt = cur.execute(f"select count(*) from {TABLE_NAME}").fetchone()[0]
for offset in tqdm(range(0, row_cnt, PAGE_SIZE)):
rows = cur.execute(f"SELECT val FROM '{TABLE_NAME}' LIMIT ? OFFSET ?", (PAGE_SIZE, offset)).fetchall()
for row in rows:
ast, opts, applied_opts, name, compare_src, ctx = pickle.loads(row[0])
try: Device[opts.device].compiler.compile(compare_src)
except Exception:
print("FAILED TO COMPILE")
print(ast)
print(applied_opts)
print(compare_src)
continue

View File

@@ -352,5 +352,39 @@ class TestLinearizerFailures(unittest.TestCase):
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"])
# llama3 8B failure with BEAM=2 https://github.com/tinygrad/tinygrad/actions/runs/10150118124/job/28066519425#step:14:1, these don't compile
@unittest.expectedFailure
@unittest.skipUnless(Device[Device.DEFAULT].renderer.has_local, "test needs local")
@unittest.skipUnless(Device[Device.DEFAULT].renderer.has_shared, "test needs shared")
def test_failure_42(self):
ast = LazyOp(MetaOps.KERNEL, arg=None, src=(
LazyOp(BufferOps.STORE, arg=MemBuffer(idx=0, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(25, 1), strides=(1, 0), offset=0, mask=None, contiguous=True),))), src=(
LazyOp(ReduceOps.SUM, arg=(1,), src=(
LazyOp(BufferOps.LOAD, arg=MemBuffer(idx=1, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(26, 49), strides=(0, -1), offset=48, mask=((0, 26), (24, 49)), contiguous=False), View(shape=(25, 25), strides=(1, 50), offset=0, mask=None, contiguous=False)))), src=()),)),)),))
opts = [Opt(op=OptOps.GROUP, axis=0, amt=0), Opt(op=OptOps.PADTO, axis=0, amt=32), Opt(op=OptOps.UPCAST, axis=0, amt=2), Opt(op=OptOps.PADTO, axis=0, amt=32)]
helper_test_lin(Kernel(ast), opts=opts, failed_platforms=[])
@unittest.expectedFailure
@unittest.skipUnless(Device[Device.DEFAULT].renderer.has_local, "test needs local")
@unittest.skipUnless(Device[Device.DEFAULT].renderer.has_shared, "test needs shared")
def test_failure_43(self):
ast = LazyOp(MetaOps.KERNEL, arg=None, src=(
LazyOp(BufferOps.STORE, arg=MemBuffer(idx=0, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(25, 1), strides=(1, 0), offset=0, mask=None, contiguous=True),))), src=(
LazyOp(ReduceOps.SUM, arg=(1,), src=(
LazyOp(BufferOps.LOAD, arg=MemBuffer(idx=1, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(26, 49), strides=(0, -1), offset=48, mask=((0, 26), (24, 49)), contiguous=False), View(shape=(25, 25), strides=(1, 50), offset=0, mask=None, contiguous=False)))), src=()),)),)),))
opts = [Opt(op=OptOps.GROUP, axis=0, amt=0), Opt(op=OptOps.PADTO, axis=0, amt=32), Opt(op=OptOps.LOCAL, axis=0, amt=4), Opt(op=OptOps.UPCAST, axis=0, amt=0)]
helper_test_lin(Kernel(ast), opts=opts, failed_platforms=[])
@unittest.expectedFailure
@unittest.skipUnless(Device[Device.DEFAULT].renderer.has_local, "test needs local")
@unittest.skipUnless(Device[Device.DEFAULT].renderer.has_shared, "test needs shared")
def test_failure_44(self):
ast = LazyOp(MetaOps.KERNEL, arg=None, src=(
LazyOp(BufferOps.STORE, arg=MemBuffer(idx=0, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(25, 1), strides=(1, 0), offset=0, mask=None, contiguous=True),))), src=(
LazyOp(ReduceOps.SUM, arg=(1,), src=(
LazyOp(BufferOps.LOAD, arg=MemBuffer(idx=1, dtype=dtypes.float, st=ShapeTracker(views=(View(shape=(26, 49), strides=(0, -1), offset=48, mask=((0, 26), (24, 49)), contiguous=False), View(shape=(25, 25), strides=(1, 50), offset=0, mask=None, contiguous=False)))), src=()),)),)),))
opts = [Opt(op=OptOps.GROUP, axis=0, amt=0), Opt(op=OptOps.PADTO, axis=0, amt=32), Opt(op=OptOps.LOCAL, axis=0, amt=4), Opt(op=OptOps.UPCAST, axis=0, amt=4)]
helper_test_lin(Kernel(ast), opts=opts, failed_platforms=[])
if __name__ == '__main__':
unittest.main()