File size: 1,160 Bytes
59b8c35
 
 
 
 
 
 
 
f408637
 
59b8c35
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Kaggle kernel body for the Phase 4 stop/resume probe (2x T4). `save_notebook` cannot pass arguments, so
# this wrapper pins the probe's revision and sha256, sets the one thing that varies between submissions
# (MODE), and hands over. Edit REV/SHA/MODE before submitting; the probe asserts its own file hashes and
# refuses an unknown MODE, so a stale paste here fails fast rather than running the wrong experiment.
import hashlib, os, runpy, subprocess, sys

os.chdir("/kaggle/working")
sys.path.insert(0, "/kaggle/working")
REV = "add04ae7a24bd9925115773a93e870fc1dd01f59"
SHA = "f55bd29c94deff0a9309e41be2818c49db6720bf871cd60cd43de654810bfaf2"
MODE = "smoke"
url = f"https://huggingface.co/Cion-lab/ounce100m-code/resolve/{REV}/kernels/p4_stop_probe.py"
assert subprocess.run(["curl", "-sfL", url, "-o", "p4_stop_probe.py"]).returncode == 0, "fetch probe"
got = hashlib.sha256(open("p4_stop_probe.py", "rb").read()).hexdigest()
assert got == SHA, ("PROBE SHA MISMATCH", got[:16], SHA[:16])
os.environ["P4_PROBE_MODE"] = MODE
print("PROBE_BOOTSTRAP_OK", REV[:12], got[:12], "mode", MODE, flush=True)
runpy.run_path("p4_stop_probe.py", run_name="__main__")