Revert "cleanup process_replay/* namings [run_process_replay] (#6429)" (#6437)

This reverts commit f4e83b30b4.
This commit is contained in:
George Hotz
2024-09-09 18:52:36 +08:00
committed by GitHub
parent d5bd38c278
commit eda177da84
4 changed files with 20 additions and 25 deletions

View File

@@ -2,14 +2,14 @@
# extract asts from process replay artifacts
import os, pickle
from tinygrad.helpers import db_connection, getenv, VERSION
from test.external.process_replay.process_replay import _pmap
from test.external.process_replay.process_replay import _run_differ
PAGE_SIZE = 100
RUN_ID = os.getenv("GITHUB_RUN_ID", "HEAD")
TABLE_NAME = f"process_replay_{RUN_ID}_{getenv('GITHUB_RUN_ATTEMPT')}_{VERSION}"
LOGOPS = os.getenv("LOGOPS", "/tmp/ops")
def extract_ast(offset:int) -> bool:
def extract_ast(offset:int):
logops = open(LOGOPS, "a")
conn = db_connection()
for row in conn.execute(f"SELECT val FROM '{TABLE_NAME}' LIMIT ? OFFSET ?", (PAGE_SIZE, offset)).fetchall():
@@ -19,4 +19,4 @@ def extract_ast(offset:int) -> bool:
if __name__ == "__main__":
conn = db_connection()
row_count = conn.execute(f"SELECT COUNT(*) FROM '{TABLE_NAME}'").fetchone()[0]
_pmap(row_count, extract_ast)
_run_differ(row_count, extract_ast)

View File

@@ -1,5 +1,5 @@
#!/bin/bash
export LOGOPS=/tmp/ops
export LOGOPS=/tmp/sops
export RUN_PROCESS_REPLAY=1
rm $LOGOPS
test/external/process_replay/reset.py