mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user