size instead of st.size (#4001)

This commit is contained in:
George Hotz
2024-03-29 19:59:02 -07:00
committed by GitHub
parent 8f1e34a2a0
commit 1bd4f01da2
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -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)