move create schedule and delete old API (#3377)

* move create schedule and delete old API

* fix test multitensor
This commit is contained in:
George Hotz
2024-02-12 18:10:45 +01:00
committed by GitHub
parent 41efaa848c
commit 2e60012bcf
21 changed files with 252 additions and 242 deletions

View File

@@ -10,16 +10,17 @@ from tinygrad.device import Device, Compiled
from tinygrad.helpers import DEBUG, GRAPH
from tinygrad.codegen.linearizer import Linearizer
from tinygrad.features.graph import print_tree, realized_lazybuffer
from tinygrad.realize import create_schedule
from tinygrad import nn, dtypes
def check_schedule(t:Tensor, allowed:int, to_prerealize:Optional[List[Tensor]]=None, filter_loadops=True):
seen = set()
if to_prerealize:
for pre in to_prerealize:
for s in pre.lazydata.schedule(seen.copy()):
for s in create_schedule([pre.lazydata], seen.copy()):
if GRAPH: realized_lazybuffer(s.out, 0)
seen.add(s.out)
sched = t.lazydata.schedule(seen)
sched = create_schedule([t.lazydata], seen)
if GRAPH:
for i,s in enumerate(sched): realized_lazybuffer(s.out, i+1)
if filter_loadops: sched = [s for s in sched if s.ast.op not in LoadOps]