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

This reverts commit eda177da84.
This commit is contained in:
George Hotz
2024-09-10 07:00:16 +08:00
committed by GitHub
parent 8d3450ceab
commit 904f6a63fa
4 changed files with 25 additions and 20 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 _run_differ
from test.external.process_replay.process_replay import _pmap
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/sops")
def extract_ast(offset:int):
def extract_ast(offset:int) -> bool:
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):
if __name__ == "__main__":
conn = db_connection()
row_count = conn.execute(f"SELECT COUNT(*) FROM '{TABLE_NAME}'").fetchone()[0]
_run_differ(row_count, extract_ast)
_pmap(row_count, extract_ast)

View File

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