unparallelled commited on
Commit
74e8b1d
·
verified ·
1 Parent(s): de15638

Upload scripts/teardown_upload2.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/teardown_upload2.sh +69 -0
scripts/teardown_upload2.sh ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Teardown upload for the 2026-09-15 session. Every file is confirmed by the byte
3
+ # size HF reports back -- an "ok" from the CLI is not proof (2026-09-10: it
4
+ # returned SUCCESS for a missing file and 17 GB was lost silently).
5
+ set -uo pipefail
6
+ cd "$(dirname "$0")"
7
+ source /root/Adhi/BluTrain/envv/bin/activate
8
+ HF=hf; PY=python; REPO=unparallelled/BluScriptCP
9
+ F=mixcont_logs/teardown2.log; : > "$F"
10
+ say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a "$F" >&2; }
11
+ MAN=/tmp/td2_manifest.txt; : > "$MAN"
12
+
13
+ up(){ # src dst
14
+ local src=$1 dst=$2
15
+ [ -e "$src" ] || { say " MISSING (not uploaded): $src"; echo "MISSING|$src|$dst" >>"$MAN"; return 1; }
16
+ $HF upload "$REPO" "$src" "$dst" >>mixcont_logs/upload2.log 2>&1 \
17
+ || { say " UPLOAD FAILED $dst"; echo "FAILED|$src|$dst" >>"$MAN"; return 1; }
18
+ [ -f "$src" ] && echo "FILE|$src|$dst" >>"$MAN" || echo "DIR|$src|$dst" >>"$MAN"
19
+ say " sent $dst"
20
+ }
21
+
22
+ say "=== 1. checkpoints (the branch points) ==="
23
+ up checkpoints_bluscriptcp/rank_0/cliff_g1400.ckpt checkpoints/mixcont_g1400_cliff.ckpt
24
+ # mix64k_step1200 and mixcont_step200 are already on HF from earlier runs
25
+
26
+ say "=== 2. the PPL-vs-position evidence (how the collapse was diagnosed) ==="
27
+ up mixcont_logs/ppl_clean1200.csv logs/mixcont/ppl_clean_g1200.csv
28
+ up mixcont_logs/ppl_degraded1400.csv logs/mixcont/ppl_degraded_g1400.csv
29
+ up mixcont_logs/ppl_clean1200.log logs/mixcont/ppl_clean_g1200.log
30
+ up mixcont_logs/ppl_degraded1400.log logs/mixcont/ppl_degraded_g1400.log
31
+
32
+ say "=== 3. the g1400 eval (proof the loss cliff cost capability) ==="
33
+ for d in cliff1400_len_*; do [ -d "$d" ] && up "$d" "logs/mixcont/$d/"; done
34
+ up mixcont_logs/eval.log logs/mixcont/eval.log
35
+
36
+ say "=== 4. training logs ==="
37
+ up mixcont_logs/train.log logs/mixcont/train.log
38
+ up mixcont_logs/master.log logs/mixcont/master.log
39
+ up mixcont_logs/probe.log logs/mixcont/probe.log
40
+ up mixcont_logs/shipper.log logs/mixcont/shipper.log
41
+
42
+ say "=== 5. scripts + the data manifest (so this is reproducible) ==="
43
+ for s in mixcont_h100.sh ckpt_shipper.sh eval_cliff.sh ppl_vs_pos.sh \
44
+ mk_mix64k_plots.py mix_buckets.py dcpm_index.py teardown_upload2.sh; do
45
+ [ -f "$s" ] && up "$s" "scripts/$s"
46
+ done
47
+ up Data_Loader/Data/mixcont/MANIFEST.txt docs/mixcont_MANIFEST.txt
48
+
49
+ say "=== 6. VERIFY every upload against the size HF reports back ==="
50
+ $PY - "$REPO" "$MAN" <<'PYEOF' | tee -a "$F"
51
+ import sys, os
52
+ from huggingface_hub import HfApi
53
+ repo, man = sys.argv[1], sys.argv[2]
54
+ remote={f.rfilename:(f.size or 0) for f in HfApi().repo_info(repo,files_metadata=True).siblings}
55
+ rows=[l.rstrip("\n").split("|",2) for l in open(man) if l.strip()]
56
+ bad=0
57
+ for kind,src,dst in rows:
58
+ if kind in ("MISSING","FAILED"): print(f" {kind:<8} {dst}"); bad+=1; continue
59
+ if kind=="DIR": print(f" DIR {dst} (not size-checked)"); continue
60
+ want=os.path.getsize(src); got=remote.get(dst)
61
+ if got==want: print(f" VERIFIED {want:>14,} {dst}")
62
+ else: print(f" *** {'ABSENT' if got is None else 'MISMATCH'} local={want:,} remote={got} {dst}"); bad+=1
63
+ print(f"\n{len(rows)-bad}/{len(rows)} verified")
64
+ sys.exit(1 if bad else 0)
65
+ PYEOF
66
+ VOK=$?
67
+ [ "$VOK" -eq 0 ] && say "=== ALL VERIFIED -- safe to tear down ===" \
68
+ || say "=== VERIFICATION FAILED -- DO NOT TEAR DOWN ==="
69
+ exit $VOK