p4_stop_probe: repin to b6210a29 (per-rank post-train marks + readable probe failures)
Browse files- kernels/p4_stop_probe.py +20 -4
kernels/p4_stop_probe.py
CHANGED
|
@@ -24,7 +24,7 @@ import hashlib, json, os, re, shutil, signal, subprocess, sys, threading, time
|
|
| 24 |
|
| 25 |
os.chdir("/kaggle/working")
|
| 26 |
sys.path.insert(0, "/kaggle/working")
|
| 27 |
-
REV = "
|
| 28 |
WANT = {
|
| 29 |
"ounce100m_credentials.py": ("ounce100m_credentials.py",
|
| 30 |
"6525f62f03f2d73650a1eb4f70fcb52d1194caad4ca88b2d8bd8fd54f88339b6"),
|
|
@@ -33,7 +33,7 @@ WANT = {
|
|
| 33 |
"hubckpt.py": ("train/hubckpt.py",
|
| 34 |
"d4b50ed0928c678c94ce6764612a4655f2959c0a7b91d6fd588e8efddff298b2"),
|
| 35 |
"train_ounce100m.py": ("train/train_ounce100m.py",
|
| 36 |
-
"
|
| 37 |
}
|
| 38 |
BASE = "https://huggingface.co/Cion-lab/ounce100m-code/resolve/" + REV
|
| 39 |
for p, (rp, want) in sorted(WANT.items()):
|
|
@@ -128,10 +128,11 @@ def run(argv, label, timeout):
|
|
| 128 |
lines.append(line)
|
| 129 |
if line.startswith(("CKPT ", "RUN_JSON ", "resume from", "auto-resume", "precision:",
|
| 130 |
"params:", "mix:", "checkpoint hub target", "segment boundary",
|
| 131 |
-
"latest.json", "TRAIN DONE", "validation loss",
|
|
|
|
| 132 |
print(" KEY>", line[:300], flush=True)
|
| 133 |
keep.append(line)
|
| 134 |
-
del keep[:-
|
| 135 |
finally:
|
| 136 |
timer.cancel()
|
| 137 |
hard.cancel()
|
|
@@ -140,6 +141,16 @@ def run(argv, label, timeout):
|
|
| 140 |
print(" TIMEOUT after %d s" % timeout, flush=True)
|
| 141 |
rc = -9
|
| 142 |
if rc != 0:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
print(" TAIL:\n" + "\n".join(keep)[-2500:], flush=True)
|
| 144 |
print("%s_RC %s seconds %.1f elapsed %.0f" % (label, rc, time.time() - t0, time.time() - T0),
|
| 145 |
flush=True)
|
|
@@ -179,6 +190,11 @@ def diag(tag):
|
|
| 179 |
'ls -R "%s" 2>&1 | head -40; '
|
| 180 |
'for f in $(find "%s" -type f 2>/dev/null | head -8); do echo "==== $f"; '
|
| 181 |
'tail -70 "$f"; done' % (TLOG, TLOG)], "DIAG_" + tag, 180)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
return out
|
| 183 |
|
| 184 |
|
|
|
|
| 24 |
|
| 25 |
os.chdir("/kaggle/working")
|
| 26 |
sys.path.insert(0, "/kaggle/working")
|
| 27 |
+
REV = "b6210a298619be7534b4a06e722bd31592f5d986"
|
| 28 |
WANT = {
|
| 29 |
"ounce100m_credentials.py": ("ounce100m_credentials.py",
|
| 30 |
"6525f62f03f2d73650a1eb4f70fcb52d1194caad4ca88b2d8bd8fd54f88339b6"),
|
|
|
|
| 33 |
"hubckpt.py": ("train/hubckpt.py",
|
| 34 |
"d4b50ed0928c678c94ce6764612a4655f2959c0a7b91d6fd588e8efddff298b2"),
|
| 35 |
"train_ounce100m.py": ("train/train_ounce100m.py",
|
| 36 |
+
"d795bb388dab42be5efedf133d0124265b3a0c60ddd8f5c375986a85de70b954"),
|
| 37 |
}
|
| 38 |
BASE = "https://huggingface.co/Cion-lab/ounce100m-code/resolve/" + REV
|
| 39 |
for p, (rp, want) in sorted(WANT.items()):
|
|
|
|
| 128 |
lines.append(line)
|
| 129 |
if line.startswith(("CKPT ", "RUN_JSON ", "resume from", "auto-resume", "precision:",
|
| 130 |
"params:", "mix:", "checkpoint hub target", "segment boundary",
|
| 131 |
+
"validation skipped", "latest.json", "TRAIN DONE", "validation loss",
|
| 132 |
+
"[rank ", "past the ", "peak_stats:", "Traceback", "Error")):
|
| 133 |
print(" KEY>", line[:300], flush=True)
|
| 134 |
keep.append(line)
|
| 135 |
+
del keep[:-400]
|
| 136 |
finally:
|
| 137 |
timer.cancel()
|
| 138 |
hard.cancel()
|
|
|
|
| 141 |
print(" TIMEOUT after %d s" % timeout, flush=True)
|
| 142 |
rc = -9
|
| 143 |
if rc != 0:
|
| 144 |
+
# Probe v6 died on the early-stop leg and everything that could have said *where* was in `lines`
|
| 145 |
+
# and never printed: the last-40-line tail was all torchrun's summary, and the failing rank's own
|
| 146 |
+
# traceback came a hundred lines earlier. Grep the whole capture, then show the tail.
|
| 147 |
+
pat = ("[rank", "Traceback", "Error", "error", "Exception", "assert", "exitcode", "Signal",
|
| 148 |
+
"SystemExit", "refusing", "skipped", "CUDA", "NCCL", "out of memory", 'File "', "line ",
|
| 149 |
+
"raise ", "FileNotFoundError", "RuntimeError")
|
| 150 |
+
hits = [l for l in lines if any(q in l for q in pat)]
|
| 151 |
+
print(" FAILURE LINES (%d of %d):" % (len(hits), len(lines)), flush=True)
|
| 152 |
+
for l in hits[-45:]:
|
| 153 |
+
print(" !", l[:300], flush=True)
|
| 154 |
print(" TAIL:\n" + "\n".join(keep)[-2500:], flush=True)
|
| 155 |
print("%s_RC %s seconds %.1f elapsed %.0f" % (label, rc, time.time() - t0, time.time() - T0),
|
| 156 |
flush=True)
|
|
|
|
| 190 |
'ls -R "%s" 2>&1 | head -40; '
|
| 191 |
'for f in $(find "%s" -type f 2>/dev/null | head -8); do echo "==== $f"; '
|
| 192 |
'tail -70 "$f"; done' % (TLOG, TLOG)], "DIAG_" + tag, 180)
|
| 193 |
+
# run() only echoes lines it recognises, which made v4's and v6's diag print *nothing* while the
|
| 194 |
+
# rank logs sat right there on disk. Say what was found, even if it is a traceback shape we do not
|
| 195 |
+
# have a filter word for.
|
| 196 |
+
print(" DIAG %s (%d chars, rc %s):\n%s" % (tag, len(out or ""), rc, (out or "")[-4000:]),
|
| 197 |
+
flush=True)
|
| 198 |
return out
|
| 199 |
|
| 200 |
|