restore process replay runs by their id (#5453)

This commit is contained in:
qazal
2024-07-14 00:32:34 +08:00
committed by GitHub
parent b8c9298164
commit 23b907efbb
3 changed files with 3 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ from tinygrad.codegen.kernel import Kernel
from tinygrad.helpers import Context, ContextVar, colored, db_connection, VERSION, getenv, tqdm
page_size = 100
table_name = f"process_replay_{getenv('GITHUB_SHA', 'HEAD')}_{VERSION}"
table_name = f"process_replay_{getenv('GITHUB_RUN_ID', 'HEAD')}_{VERSION}"
def process_replay(offset:int):
conn = db_connection()

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3
from tinygrad.helpers import db_connection, VERSION, getenv
cur = db_connection()
cur.execute(f"drop table if exists process_replay_{getenv('GITHUB_SHA', 'HEAD')}_{VERSION}")
cur.execute(f"drop table if exists process_replay_{getenv('GITHUB_RUN_ID', 'HEAD')}_{VERSION}")

View File

@@ -760,7 +760,7 @@ class Kernel:
self.linearize()
src = self.opts.render(name:=to_function_name(self.name), self.uops)
if getenv("RUN_PROCESS_REPLAY"):
table_name = f"process_replay_{getenv('GITHUB_SHA', 'HEAD')}"
table_name = f"process_replay_{getenv('GITHUB_RUN_ID', 'HEAD')}"
diskcache_put(table_name, id(self), (self.ast, self.opts, self.applied_opts, name, src, {k:v.value for k,v in ContextVar._cache.items()}))
info = get_lazyop_info(self.ast.src[0]) # TODO: this should be removed
ops, mem = flops_mem(self.uops.uops)