diff --git a/tinygrad/helpers.py b/tinygrad/helpers.py index e88d2c16f2..5f1fe24bfd 100644 --- a/tinygrad/helpers.py +++ b/tinygrad/helpers.py @@ -166,13 +166,13 @@ def db_connection(): if _db_connection is None: os.makedirs(CACHEDB.rsplit("/", 1)[0], exist_ok=True) _db_connection = sqlite3.connect(CACHEDB) - if DEBUG >= 5: _db_connection.set_trace_callback(print) + if DEBUG >= 7: _db_connection.set_trace_callback(print) if diskcache_get("meta", "version") != VERSION: print("cache is out of date, clearing it") del _db_connection os.unlink(CACHEDB) _db_connection = sqlite3.connect(CACHEDB) - if DEBUG >= 5: _db_connection.set_trace_callback(print) + if DEBUG >= 7: _db_connection.set_trace_callback(print) diskcache_put("meta", "version", VERSION) return _db_connection diff --git a/tinygrad/ops.py b/tinygrad/ops.py index bf877a9781..200cf690d2 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -144,7 +144,7 @@ class Interpreted: ret = _interpret_ast(ast) src = '\n'.join(['def run(inputs):'] + lines + [f" return {gstr(self.from_underlying, 'from_underlying')}({ret})" if self.from_underlying else f" return {ret}"]) - if DEBUG >= 4: print(functools.reduce(lambda x,y: (x.replace(y[0], str(y[1])) if y[0][0:2] == "m0" else x), tglob.items(), src)) + if DEBUG >= 4 and self != InterpretedFlopCounter: print(functools.reduce(lambda x,y: (x.replace(y[0], str(y[1])) if y[0][0:2] == "m0" else x), tglob.items(), src)) exec(compile(src, "", "exec"), tglob) # pylint: disable=exec-used return tglob['run']