summaryrefslogtreecommitdiff
path: root/ep_run/ep_rr_check.py
diff options
context:
space:
mode:
authorYuren Hao <yurenh2@illinois.edu>2026-07-03 05:56:50 -0500
committerYuren Hao <yurenh2@illinois.edu>2026-07-03 05:56:50 -0500
commitb83947778e2c776f757a07d4719b7ce961d7ed55 (patch)
treeb9cc01d7adda691d9156d9d04f4fb2f644674e96 /ep_run/ep_rr_check.py
Initial commit: ept — backprop-free equilibrium transformer (EP)
Code (ep_run/), organized docs (docs/{method,campaign,hardware,outreach,paper}), analysis scripts (scripts/), ONBOARDING.md entry point. Large data/checkpoints git-ignored (share separately). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014FAPDWQ49M5Ye3NpTndTpn
Diffstat (limited to 'ep_run/ep_rr_check.py')
-rw-r--r--ep_run/ep_rr_check.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ep_run/ep_rr_check.py b/ep_run/ep_rr_check.py
new file mode 100644
index 0000000..a820545
--- /dev/null
+++ b/ep_run/ep_rr_check.py
@@ -0,0 +1,22 @@
+import time, os, re, subprocess
+os.chdir("/home/yurenh2/ept/ep_run"); LOG="runs/ep_rr_scratch.log"; TARGET=2.70
+def alive(): return subprocess.run(["pgrep","-f","ckpt runs/ep_rr_scratch.pt"],capture_output=True).returncode==0
+def latest():
+ try: ls=[l for l in open(LOG) if l.startswith("step")]
+ except Exception: return None
+ if not ls: return None
+ l=ls[-1]
+ ms=re.search(r"step\s+(\d+)",l); mv=re.search(r"val CE ([\d.eE+-]+)",l); mb=re.search(r"best ([\d.eE+-]+)",l)
+ mr=re.search(r"res=([\d.eE+-]+)",l); mi=re.search(r"([\d.]+) it/s",l)
+ if not (ms and mv and mb and mr): return None
+ return (int(ms.group(1)),float(mv.group(1)),float(mb.group(1)),float(mr.group(1)), mi.group(1) if mi else "?")
+fired=None; t0=time.time()
+while fired is None and time.time()-t0<23*3600:
+ time.sleep(120)
+ d=latest()
+ if not alive(): fired=f"ep_rr_scratch EXITED; last {d}"; break
+ if not d: continue
+ step,val,best,res,its=d
+ if (val>12 or res>0.3) and step>400: fired=f"ep_rr_scratch BLEW @step{step} val{val:.2f} res{res:.1e} best{best:.4f} ({its} it/s)"; break
+ if best<=TARGET: fired=f"ep_rr_scratch reached {TARGET}(from-scratch 干净降入墙区): step{step} best{best:.4f} val{val:.4f} res{res:.1e} {its}it/s"; break
+print(f"=== EP_RR_SCRATCH -> {TARGET} ==="); print(fired or "23h timeout"); print("last:",latest())