diff --git a/test/unit/test_viz.py b/test/unit/test_viz.py index b2d2973803..b7edb9d2c6 100644 --- a/test/unit/test_viz.py +++ b/test/unit/test_viz.py @@ -359,7 +359,7 @@ def load_profile(lst:list[ProfileEvent]) -> dict: for _ in range(event_count): alloc, ts, key = u(" ({shape:shapeMap.get(u32()), repr:strings[u32()], num:u8(), mode:u8()})); + free.users = Array.from({ length: u32() }, () => ({shape:shapeMap.get(u32()), repr:strings[u32()], num:u32(), mode:u8()})); timestamps.push(ts); valueMap.set(ts, y); x += 1; y -= free.nbytes; free.x.push(x); diff --git a/tinygrad/viz/serve.py b/tinygrad/viz/serve.py index b20b3524e2..068b3c1d1c 100755 --- a/tinygrad/viz/serve.py +++ b/tinygrad/viz/serve.py @@ -178,12 +178,12 @@ def timeline_layout(dev_events:list[tuple[int, int, float, DevEvent]], start_ts: return struct.pack(" bytes: - ei_encoding:list[tuple[int, int, int, int]] = [] # <[u32, u32, u8, u8] [run id, display name, buffer number and mode (2 = r/w, 1 = w, 0 = r)] + ei_encoding:list[tuple[int, int, int, int]] = [] # <[u32, u32, u32, u8] [run id, display name, buffer number and mode (2 = r/w, 1 = w, 0 = r)] for e in execs: num = next(i for i,k in enumerate(e.arg["bufs"]) if k == key) mode = 2 if (num in e.arg["inputs"] and num in e.arg["outputs"]) else 1 if (num in e.arg["outputs"]) else 0 ei_encoding.append((e.key, enum_str(e.arg["name"], scache), num, mode)) - return struct.pack(" bytes|None: