ounce100m-code / kernels /phase4_bootstrap.py
Cion-lab's picture
mirror kernels/ so the kept code is self-contained
17135b7 verified
Raw History Blame Contribute Delete
1.33 kB
# Phase 4 GPU session bootstrap. The session logic lives in kernels/phase4_session.py at a pinned
# revision; this file only fixes what save_notebook cannot pass -- environment -- and then hands over.
# Edit QUOTA_LEFT_HOURS (from a live get_accelerator_quota read) before submitting; everything else the
# launcher already defaults correctly (12,300 tok/s from D-018, 6.9 h ceiling, 8 GB disk floor, and
# it passes --no-grad-ckpt with a 127-step push cadence).
import hashlib, os, runpy, subprocess, sys
os.chdir("/kaggle/working")
sys.path.insert(0, "/kaggle/working")
REV = "c237b478076f68da43dabd3403daa5639286899e"
LAUNCHER_SHA = "5fb14bc3597d999a21772a66b6f409f01f722019dc78da313feddb2f9c769c48"
os.environ["OUNCE100M_REV"] = REV
os.environ["QUOTA_LEFT_HOURS"] = "7.0" # live read 2026-09-21T08:29Z: 82,755.0 s of 108,000 used
url = f"https://huggingface.co/Cion-lab/ounce100m-code/resolve/{REV}/kernels/phase4_session.py"
rc = subprocess.run(["curl", "-sfL", url, "-o", "phase4_session.py"]).returncode
assert rc == 0, "could not fetch the launcher"
got = hashlib.sha256(open("phase4_session.py", "rb").read()).hexdigest()
assert got == LAUNCHER_SHA, f"launcher sha {got[:16]} != {LAUNCHER_SHA[:16]}"
print("BOOTSTRAP_OK", REV[:12], got[:12], flush=True)
runpy.run_path("phase4_session.py", run_name="__main__")