multioutput ScheduleItem (#3699)

* refactor realize.py

* update docs

* update test_sched

* update runners and devices

* update openpilot and unit tests

* cleanup runner lowering

* update more tests
This commit is contained in:
qazal
2024-03-13 17:59:38 +02:00
committed by GitHub
parent 08064a0e29
commit 337cd53444
17 changed files with 125 additions and 117 deletions

View File

@@ -240,7 +240,7 @@ result = Tensor(2.0).realize() + Tensor(3.0).realize()
from tinygrad.codegen.linearizer import Linearizer
from tinygrad.realize import create_schedule
sched = create_schedule([result.lazydata])
linearizer = Linearizer(sched[-1].ast, opts=ClangCompiler.linearizer_opts)
linearizer = Linearizer(*sched[-1].ast, opts=ClangCompiler.linearizer_opts)
linearizer.linearize()
# print the uops

View File

@@ -86,11 +86,11 @@ out = a.e(BinaryOps.ADD, b)
# schedule the computation as a list of kernels
sched = create_schedule([out])
for si in sched: print(si.ast.op) # NOTE: the first two convert it to CLANG
for si in sched: print(si.ast[0].op) # NOTE: the first two convert it to CLANG
# DEBUGGING: print the compute ast as a tree
from tinygrad.features.graph import print_tree
print_tree(sched[-1].ast)
print_tree(sched[-1].ast[0])
# NOTE: sched[-1].ast is the same as st_0 above
# run that schedule