unparallelled commited on
Commit
7d8e759
·
verified ·
1 Parent(s): f827ec2

Upload scripts/ctl_106b.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/ctl_106b.sh +72 -0
scripts/ctl_106b.sh ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # THE CONTROL: is the ceiling a property of the CONFIG or of the 680M?
4
+ #
5
+ # mix64k_step1200 (1.06B, best of the 3-stage ladder) was TRAINED at
6
+ # ORIG=32768 SCALE=2, which puts a 16,360 prompt at virtual 8,180 -- twice
7
+ # beyond the 4,096 range it was pretrained on. Re-parameterising to
8
+ # ORIG=4096 SCALE=16 (same T=65,536) puts it at virtual 1,022.
9
+ #
10
+ # mixcont_g1400_cliff is the COLLAPSED checkpoint. If the collapse is partly a
11
+ # config artefact it should recover too; if it is real damage it should not.
12
+ #
13
+ # PRE-REGISTERED PREDICTIONS (mix64k), written before the run:
14
+ # 16,360 @ x16 -> 85-92 (known 70 at its trained config)
15
+ # 32,744 @ x32 -> 70-80 (known 50)
16
+ # 65,512 @ x32 -> 40-50 (known 31)
17
+ # 16,360 @ x2/ORIG=32768 -> 66-74 <- REPRODUCTION CHECK of the prior 70.
18
+ # If this does not reproduce, the harness differs from the prior session
19
+ # and NONE of the cross-session comparisons in this analysis are valid.
20
+ # =============================================================================
21
+ set -uo pipefail
22
+ cd "$(dirname "$0")"
23
+ export PATH=/root/Adhi/BluTrain/envv/bin:$PATH
24
+ source /root/Adhi/BluTrain/envv/bin/activate 2>/dev/null
25
+ L=ctl_logs; mkdir -p "$L"; M="$L/master.log"
26
+ say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a "$M" >&2; }
27
+ CK=checkpoints_bluscriptcp/rank_0
28
+ HAY=Data_Loader/Data/b2_8192_16384/val_shard_00000.bin
29
+ [ "$(stat -c%s "$HAY")" = 199754694 ] || { say "FATAL haystack differs"; exit 1; }
30
+
31
+ for f in mix64k_step_1200 mixcont_g1400_cliff; do
32
+ [ -f "$CK/$f.ckpt" ] && continue
33
+ say "downloading $f.ckpt"
34
+ hf download unparallelled/BluScriptCP --quiet --include "checkpoints/$f.ckpt" --local-dir dl_c || exit 1
35
+ mv -f "dl_c/checkpoints/$f.ckpt" "$CK/" || exit 1
36
+ done
37
+ rm -rf dl_c
38
+ for f in mix64k_step_1200 mixcont_g1400_cliff; do
39
+ [ "$(stat -c%s "$CK/$f.ckpt")" = 3750897182 ] || { say "FATAL $f wrong size"; exit 1; }
40
+ done
41
+ say "both 1.06B checkpoints verified at 3,750,897,182 B"
42
+
43
+ # 1.06B arch is run_longeval.sh's DEFAULT A1B (36 layers, weight_tying=0) -- do not override
44
+ run(){ # T SCALE ORIG PL tag
45
+ local T=$1 S=$2 OR=$3 PL=$4 TAG=$5
46
+ local O="ctl_${TAG}_len${PL}"
47
+ [ $((S*OR)) -eq $T ] || { say "YaRN invariant $S*$OR != $T"; return 1; }
48
+ [ -s "$O/summary.csv" ] && [ "$(wc -l < "$O/summary.csv")" -gt 1 ] && {
49
+ say " $TAG len $PL cached: $(grep '^niah_single,' $O/summary.csv)"; return 0; }
50
+ say " $TAG len $PL (T=$T scale=$S orig=$OR -> virtual $((PL/S)))"
51
+ HAY="$HAY" GEN_DATA_ROOT="Data_Loader/Data/evalsrc" \
52
+ CKPT_EXTRA="mix1200=mix64k_step_1200.ckpt cliff1400=mixcont_g1400_cliff.ckpt" \
53
+ CKPTS="mix1200 cliff1400" TASKS=niah_single N=100 \
54
+ T=$T YARN=$S YARN_ORIG=$OR PROMPT_LEN=$PL GPUS=0,1 NP=1 OUT="$O" \
55
+ ./run_longeval.sh >> "$L/${TAG}_${PL}.log" 2>&1
56
+ if [ -s "$O/summary.csv" ] && [ "$(wc -l < "$O/summary.csv")" -gt 1 ]; then
57
+ say " -> $(head -1 $O/summary.csv) | $(grep '^niah_single,' $O/summary.csv)"
58
+ else say " FAILED"; grep -ahA2 'what()' "$O"/gen/*.log 2>/dev/null|head -3|tee -a "$M" >&2; fi
59
+ }
60
+ say "=== 1.06B CONTROL: config vs model ==="
61
+ say "REPRODUCTION CHECK first -- if 16,360 @ x2/orig32768 is not ~70, stop trusting everything"
62
+ run 65536 2 32768 16360 astrained
63
+ say "now the corrected parameterisation (ORIG held at the 4096 pretrain length)"
64
+ run 65536 16 4096 16360 x16
65
+ run 131072 32 4096 32744 x32
66
+ run 131072 32 4096 65512 x32
67
+ say "=== CONTROL RESULTS (cols: mix1200, cliff1400) ==="
68
+ for t in astrained_16360 x16_16360 x32_32744 x32_65512; do
69
+ f="ctl_${t%_*}_len${t##*_}/summary.csv"
70
+ [ -f "$f" ] && say " $t $(head -1 $f) -> $(grep '^niah_single,' $f)"
71
+ done
72
+ say "DONE"