From 1bd4f01da2d0d290c0b0ca11d4561dc5271a7e1e Mon Sep 17 00:00:00 2001 From: George Hotz <72895+geohot@users.noreply.github.com> Date: Fri, 29 Mar 2024 19:59:02 -0700 Subject: [PATCH] size instead of st.size (#4001) --- tinygrad/engine/realize.py | 2 +- tinygrad/engine/schedule.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tinygrad/engine/realize.py b/tinygrad/engine/realize.py index 10be6b2e65..6a62575b51 100644 --- a/tinygrad/engine/realize.py +++ b/tinygrad/engine/realize.py @@ -49,6 +49,6 @@ def run_schedule(schedule:List[ScheduleItem]): real_buffers = [x.buffer for x in si.outputs+si.inputs if x.size != 0] assert dont_allocate or all(hasattr(x, "_buf") for x in real_buffers), f"can't run, some inputs aren't realized {real_buffers}" if prg: prg.exec(real_buffers, si.var_vals) - elif (out:=si.outputs[0]).size > 0: update_stats(colored(f"empty {out.st.size:10d} {out.dtype}", "yellow"), 0, 0, {}, None, 1, device=out.device) + elif (out:=si.outputs[0]).size > 0: update_stats(colored(f"empty {out.size:10d} {out.dtype}", "yellow"), 0, 0, {}, None, 1, device=out.device) if GRAPH: for out in si.outputs: realized_lazybuffer(out, GlobalCounters.kernel_count) diff --git a/tinygrad/engine/schedule.py b/tinygrad/engine/schedule.py index ac7b1354cc..907f3bd285 100644 --- a/tinygrad/engine/schedule.py +++ b/tinygrad/engine/schedule.py @@ -188,8 +188,8 @@ def create_schedule(outs:List[LazyBuffer], seen:Optional[Set[LazyBuffer]]=None) assign_targets = {x.srcs[1]:x for x in realizes if x.op is LoadOps.ASSIGN and x not in seen and x.realized is None} # breadth first ordering - graph: DefaultDict[LazyBuffer,List[LazyBuffer]] = defaultdict(list) - in_degree: DefaultDict[LazyBuffer,int] = defaultdict(int) + graph: DefaultDict[LazyBuffer, List[LazyBuffer]] = defaultdict(list) + in_degree: DefaultDict[LazyBuffer, int] = defaultdict(int) for out, si in prescheduled.items(): for x in si.inputs: graph[x].append(out)