move print tree into graph (#2003)

* move print tree into graph

* add winograd profiling test

* change pre-commit to run ruff first
This commit is contained in:
George Hotz
2023-10-07 04:39:21 -07:00
committed by GitHub
parent 2114dc13d1
commit f54959e5cd
7 changed files with 32 additions and 28 deletions

View File

@@ -8,7 +8,7 @@ from tinygrad.tensor import Tensor
from tinygrad.ops import LoadOps, Device, Compiled
from tinygrad.helpers import DEBUG, dtypes
from tinygrad.codegen.linearizer import Linearizer
from tinygrad.graph import log_schedule_item
from tinygrad.graph import log_schedule_item, print_tree
from tinygrad import nn
def check_schedule(t:Tensor, allowed:int, to_prerealize:Optional[List[Tensor]]=None, filter_loadops=True):
@@ -23,7 +23,6 @@ def check_schedule(t:Tensor, allowed:int, to_prerealize:Optional[List[Tensor]]=N
if filter_loadops: sched = [s for s in sched if s[0].op not in LoadOps]
if len(sched) != allowed: print(f"SCHEDULE ISSUE, expecting {allowed} got {len(sched)}")
if len(sched) != allowed or DEBUG >= 3:
from extra.utils import print_tree
for i, s in enumerate(sched):
print("op", i)
print_tree(s[0])