From 1ed5d733bdcecd913096ca3e97fe13f2ad0c6e4e Mon Sep 17 00:00:00 2001 From: qazal <77887910+Qazalin@users.noreply.github.com> Date: Fri, 2 May 2025 20:59:19 +0300 Subject: [PATCH] disable TRACK_MATCH_STATS for type_verify (#10141) --- tinygrad/spec.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tinygrad/spec.py b/tinygrad/spec.py index 171542b13c..6b78872ef0 100644 --- a/tinygrad/spec.py +++ b/tinygrad/spec.py @@ -1,7 +1,7 @@ from typing import cast, Callable from tinygrad.ops import PatternMatcher, UPat, GroupOp, Ops, UOp, print_uops, python_alu, graph_rewrite, resolve from tinygrad.dtype import DType, ImageDType, dtypes, PtrDType -from tinygrad.helpers import all_same, prod, DEBUG, IGNORE_OOB +from tinygrad.helpers import all_same, prod, DEBUG, IGNORE_OOB, Context try: import z3 @@ -209,6 +209,7 @@ shape_spec = PatternMatcher([ def type_verify(uops:list[UOp], extra_spec:PatternMatcher|None=None): check_spec = (extra_spec+spec) if extra_spec is not None else spec for i,u in enumerate(uops): - if cast(bool|None, check_spec.rewrite(u)) is not True: + with Context(TRACK_MATCH_STATS=0): ret = check_spec.rewrite(u) + if cast(bool|None, ret) is not True: if DEBUG >= 3: print_uops(uops) raise RuntimeError(f"UOp verification failed at {i} on {u.op} {u.dtype} {len(u.src)} {[x.op for x in u.src]} {u.arg}")