unparallelled commited on
Commit
c40c998
·
verified ·
1 Parent(s): de1d39a

Upload source/files/upload_all_to_hf.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. source/files/upload_all_to_hf.sh +66 -0
source/files/upload_all_to_hf.sh ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Upload every artifact of the IN2 / reach work to HuggingFace.
3
+ # Idempotent: re-running re-uploads changed files and skips identical ones.
4
+ # Does NOT handle git or the vault logs branch -- see the note at the end.
5
+ set -uo pipefail
6
+ cd "$(dirname "$0")"
7
+
8
+ HF=/root/Adhi/BluTrain/envv/bin/hf
9
+ REPO=unparallelled/BluScriptCP
10
+ CK=checkpoints_bluscriptcp/rank_0
11
+ ok=0; fail=0
12
+ up(){ # up <local> <path-in-repo> <label>
13
+ if [ ! -e "$1" ]; then echo " SKIP (absent): $3"; return; fi
14
+ if "$HF" upload "$REPO" "$1" "$2" >/dev/null 2>&1; then
15
+ echo " ok $3"; ok=$((ok+1))
16
+ else
17
+ echo " FAIL $3"; fail=$((fail+1))
18
+ fi
19
+ }
20
+
21
+ echo "=== 1. source ==="
22
+ tar czf /tmp/cp_source_now.tgz \
23
+ --exclude='build' --exclude='checkpoints_bluscriptcp' --exclude='in2_data' \
24
+ --exclude='Data_Loader/Data' --exclude='.git' --exclude='*.bin' --exclude='probe_*' \
25
+ -C /root/Adhi/BluTrain dist/Context_Parallelism dist/zero 2>/dev/null
26
+ up /tmp/cp_source_now.tgz "source/cp_source_$(date -u +%Y-%m-%d).tgz" "source tarball"
27
+ for f in run_in2_experiment.sh run_probepos_experiment.sh upload_all_to_hf.sh probe_1b.sh \
28
+ Tests/bluscriptcp/needle_score.py Tests/bluscriptcp/needle_gen.py \
29
+ Tests/bluscriptcp/in2_gen.py Tests/bluscriptcp/in2_gate.py \
30
+ Tests/bluscriptcp/needle_sweep.sh; do
31
+ up "$f" "source/files/$(basename "$f")" "$(basename "$f")"
32
+ done
33
+
34
+ echo "=== 2. checkpoints (3.9 GB each -- the slow part) ==="
35
+ up "$CK/blumodelcp_run7_step_750.ckpt" checkpoints/in2/extended_blumodelcp_run7_step_750.ckpt "base run7 (init source)"
36
+ up "$CK/blumodelcp_run12_step_400.ckpt" checkpoints/in2/arm_a_blumodelcp_run12_step_400.ckpt "arm A run12"
37
+ up "$CK/blumodelcp_run15_step_400.ckpt" checkpoints/in2/arm_b_blumodelcp_run15_step_400.ckpt "arm B run15"
38
+ up "$CK/blumodelcp_run16_step_400.ckpt" checkpoints/in2/arm_c_blumodelcp_run16_step_400.ckpt "arm C run16"
39
+
40
+ echo "=== 3. probe results (reach.csv + per-job CSVs + needles + state) ==="
41
+ for d in probe_arm_a probe_arm_b probe_arm_c probe_run7_yarn4 probe_run8_s4 \
42
+ probe_pos8192_base probe_pos8192_armB probe_pos8192_armC \
43
+ probe_pos12288_base probe_pos12288_armB probe_pos12288_armC; do
44
+ up "$d" "logs/$d/" "$d"
45
+ done
46
+
47
+ echo "=== 4. training CSVs and configs ==="
48
+ up CP_BluScreipt_Training_logs logs/in2_train_csv/ "training CSVs"
49
+
50
+ echo "=== 5. run logs ==="
51
+ up in2_logs logs/in2/ "driver + arm training logs"
52
+ up probepos_logs logs/probepos_logs/ "probe-pos master log"
53
+ up run_logs logs/in2_stdout/ "stdout logs"
54
+
55
+ echo "=== 6. vault snapshot (reports + log index) ==="
56
+ up /root/claude-vault docs/ "vault"
57
+
58
+ echo
59
+ echo "uploaded: $ok failed: $fail"
60
+ echo
61
+ echo "NOT covered by this script:"
62
+ echo " - git commits/pushes for BluTrain and the Context_Parallelism submodule"
63
+ echo " - the vault logs branch: run scripts/logs-push.sh so today's log lines and"
64
+ echo " report reach the laptop; the docs/ copy above is a snapshot, not the branch"
65
+ echo " - in2_data/ (1.4 GB of generated shards) is deliberately excluded:"
66
+ echo " regenerate deterministically with in2_gen.py --seed 0"