unparallelled commited on
Commit
a99d9df
·
verified ·
1 Parent(s): 932355a

Upload scripts/eval_cliff.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/eval_cliff.sh +47 -0
scripts/eval_cliff.sh ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Eval the checkpoint at the cliff ONSET (local step 200 = global 1400) against
3
+ # its own parent (mix64k step 1200 = 83/70/50/31, measured on this harness).
4
+ # The question: has the loss cliff actually cost capability yet, or only loss?
5
+ set -uo pipefail
6
+ cd "$(dirname "$0")"
7
+ source /root/Adhi/BluTrain/envv/bin/activate
8
+ export LD_LIBRARY_PATH="/root/Adhi/BluTrain/Tensor-Implementations/lib:/root/Adhi/BluTrain/Profiler/lib:${LD_LIBRARY_PATH:-}"
9
+ PY=python
10
+ T=65536; ORIG=32768; SCALE=2
11
+ DATA=Data_Loader/Data/mixcont
12
+ HAY="$PWD/Data_Loader/Data/b2_8192_16384/val_shard_00000.bin"
13
+ L=mixcont_logs; M="$L/eval.log"; : > "$M"
14
+ say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a "$M" >&2; }
15
+ say "=== eval global step 1400 (cliff onset) -- 4 lengths, one GPU each ==="
16
+ for LEN in 8192 16360 32744 65512; do
17
+ ( GEN_DATA_ROOT=$DATA HAY="$HAY" PY=$PY OUT=cliff1400_len_$LEN TASKS="niah_single" \
18
+ CKPTS="c1400" N=100 PROMPT_LEN=$LEN MAX_NEW=24 T=$T \
19
+ DEPTHS="0.0,0.25,0.5,0.75,1.0" YARN_ORIG=$ORIG YARN=$SCALE \
20
+ GPUS=$(( (LEN==8192)?0:(LEN==16360)?1:(LEN==32744)?2:3 )) JOBS_PER_GPU=1 \
21
+ BF16=1 GREEDY=1 CKPT_EXTRA="c1400=cliff_g1400.ckpt" ./run_longeval.sh \
22
+ >> "$L/eval_$LEN.log" 2>&1 ) &
23
+ done
24
+ wait
25
+ say "=== results vs parent (mix64k step 1200) ==="
26
+ $PY - <<'PY' | tee -a "$M"
27
+ import csv, math, os
28
+ P={8192:83.0,16360:70.0,32744:50.0,65512:31.0} # the parent, measured
29
+ def w(p,n=100):
30
+ z=1.96; ph=p/100
31
+ return 100*z*math.sqrt(ph*(1-ph)/n+z*z/(4*n*n))/(1+z*z/n)
32
+ print(f" {'ctx':>7} {'parent':>7} {'g1400':>7} {'delta':>7} {'bar':>6} verdict")
33
+ for L in (8192,16360,32744,65512):
34
+ f=f"cliff1400_len_{L}/summary.csv"; v=None
35
+ if os.path.exists(f):
36
+ for r in csv.reader(open(f)):
37
+ if r and r[0].strip()=="niah_single": v=float(r[1])
38
+ if v is None: print(f" {L:>7} {P[L]:>7.1f} {'-':>7} {'-':>7} {'-':>6} not scored"); continue
39
+ b=math.hypot(w(v),w(P[L])); d=v-P[L]
40
+ print(f" {L:>7} {P[L]:>7.1f} {v:>7.1f} {d:>+7.1f} {b:>6.1f} {'DEGRADED' if -d>b else 'ok'}")
41
+ PY
42
+ say "=== depth profiles ==="
43
+ for LEN in 8192 16360 32744 65512; do
44
+ f=cliff1400_len_$LEN/depth_summary.csv
45
+ [ -s "$f" ] && { printf " %6s: " "$LEN" >&2; awk -F, 'NR>1{printf "%5.1f ",$5}' "$f" >&2; echo >&2; }
46
+ done
47
+ say "=== EVAL DONE ==="