Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-dnn/blob/main/evidence/STACK7-GPU-20261026/gpu-bench/run_paired.py # omega-dnn aien-dev/omega-dnn Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-dnn / evidence / STACK7-GPU-20261026 / gpu-bench / run_paired.py` 29 lines ยท 2230 bytes Raw Blame History 1 # THROWAWAY paired A/B runner (lane OmegaDnn.GpuDnn, 2026-10-26), not product code. 2 # Protocol frozen in /home/drakestapleton/handoffs/OmegaDnn/GPU.md section 2 before the first timed run. 3 # Usage: python run_paired.py RUNDIR [ROUNDS=5] [WARMUP_ROUNDS=1] 4 # Each round runs both arms, one process each, in an order from random.Random(`20261026`); every arm process 5 # holds /tmp/aien-gb10.lock only for its own lifetime (flock around the GPU command alone). After every arm 6 # process: loadavg and `nvidia-smi --query-compute-apps=pid` are recorded. 7 import json, os, random, subprocess, sys, time 8 rundir = sys.argv[1]; rounds = int(sys.argv[2]) if len(sys.argv) > 2 else 5; wr = int(sys.argv[3]) if len(sys.argv) > 3 else 1 9 B = "/tmp/OmegaDnn/gpu/bench"; PY = "/home/drakestapleton/.venv/bin/python" 10 os.makedirs(rundir, exist_ok=True) 11 rng = random.Random(`20261026`) 12 log = open(f"{rundir}/rounds.jsonl", "a") 13 for r in range(-wr, rounds): 14 order = ["omega", "torch"]; rng.shuffle(order) 15 for arm in order: 16 d = f"{rundir}/r{r}/{arm}"; os.makedirs(d, exist_ok=True) 17 if arm == "omega": cmd = [f"{B}/omega_dnn_bench", d] 18 else: cmd = [PY, f"{B}/torch_arm.py", f"{rundir}/inputs", d] 19 load0 = open("/proc/loadavg").read().split()[:3] 20 t0 = time.time() 21 p = subprocess.run(["flock", "-w", "900", "/tmp/aien-gb10.lock", f"{B}/held.sh", "taskset", "-c", "8-9", *cmd], capture_output=True, text=True) 22 t1 = time.time() 23 open(f"{d}/stdout.jsonl", "w").write(p.stdout); open(f"{d}/stderr.txt", "w").write(p.stderr) 24 held = [l for l in p.stderr.splitlines() if l.startswith("LOCK_HELD_S ")] 25 apps = subprocess.run(["nvidia-smi", "--query-compute-apps=pid", "--format=csv,noheader"], capture_output=True, text=True).stdout.strip() 26 rec = {"round": r, "arm": arm, "rc": p.returncode, "wall_s": round(t1 - t0, 3), "lock_held_s": held[-1].split()[1] if held else None, 27 "load_before": load0, "load_after": open("/proc/loadavg").read().split()[:3], "compute_apps_after": apps} 28 log.write(json.dumps(rec) + "\n"); log.flush(); print(json.dumps(rec), flush=True) 29 if p.returncode != 0: sys.exit(f"arm {arm} round {r} failed rc={p.returncode}")