unparallelled commited on
Commit
81b8994
·
verified ·
1 Parent(s): 3a4d18f

Upload scripts/ruler_suite.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/ruler_suite.sh +68 -0
scripts/ruler_suite.sh ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # =============================================================================
3
+ # FULL RULER SUITE on t64 -- the first real RULER-coverage number this project
4
+ # will have. 13 tasks across RULER's four categories:
5
+ # retrieval niah_single, _1, _3, multikey, _2, _3, multivalue, multiquery
6
+ # multi-hop vt
7
+ # aggregation cwe, fwe
8
+ # QA qa_1, qa_2
9
+ #
10
+ # WHY THIS MATTERS: t64 scores 98-100 on niah_single at every length. A "RULER
11
+ # score" built from that alone reads ~99 and means nothing -- RULER exists
12
+ # precisely because vanilla NIAH saturates. multikey already went 39 -> 32 with
13
+ # 64k training, so the suite is where the real number lives.
14
+ #
15
+ # Config: x64 at 32,744 -- t64's best measured setting (99 on niah_single).
16
+ # t64 first (the model we care about), p1final second as control.
17
+ # =============================================================================
18
+ set -uo pipefail
19
+ cd "$(dirname "$0")"
20
+ export PATH=/root/Adhi/BluTrain/envv/bin:$PATH
21
+ source /root/Adhi/BluTrain/envv/bin/activate 2>/dev/null
22
+ L=ruler_logs; mkdir -p "$L"; M="$L/master.log"
23
+ say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a "$M" >&2; }
24
+ die(){ say "FATAL: $*"; exit 1; }
25
+ EXE=./build/bluscriptCP_exec
26
+ HAY=Data_Loader/Data/b2_8192_16384/val_shard_00000.bin
27
+ CK=checkpoints_bluscriptcp/rank_0
28
+ [ -x "$EXE" ] || die "binary missing"
29
+ [ "$(stat -c%s "$HAY")" = 199754694 ] || die "haystack differs from prior evals"
30
+ [ -s "$CK/t64.ckpt" ] || die "t64 missing"
31
+ A680="CP_N_EMBD=1536 CP_N_LAYER=24 CP_N_HEAD=12 CP_N_KVHEAD=4 CP_FFN=4096 CP_WEIGHT_TYING=1"
32
+ T=131072; S=32; PL=32744 # x32 -> virtual 1,023; t64 scores 99 on niah_single here
33
+ [ $((S*4096)) -eq $T ] || die "YaRN invariant"
34
+
35
+ # wait for the val_backward diagnostic to release the GPU
36
+ while pgrep -x bluscriptCP_exec >/dev/null 2>&1; do sleep 30; done
37
+ say "GPU free -- starting RULER suite"
38
+
39
+ TASKS_ALL="niah_single niah_single_1 niah_single_3 niah_multikey niah_multikey_2 niah_multikey_3 \
40
+ niah_multivalue niah_multiquery vt cwe fwe qa_1 qa_2"
41
+
42
+ one(){ # model ckptfile
43
+ local NAME=$1 F=$2
44
+ for t in $TASKS_ALL; do
45
+ local O="ruler_${NAME}_${t}"
46
+ [ -s "$O/summary.csv" ] && [ "$(wc -l < "$O/summary.csv")" -gt 1 ] && { say " $NAME/$t cached"; continue; }
47
+ say " $NAME / $t"
48
+ A1B="$A680" HAY="$HAY" GEN_DATA_ROOT="Data_Loader/Data/evalsrc" \
49
+ CKPT_EXTRA="$NAME=$F" CKPTS="$NAME" TASKS="$t" N=100 \
50
+ T=$T YARN=$S YARN_ORIG=4096 PROMPT_LEN=$PL GPUS=0 NP=1 OUT="$O" \
51
+ ./run_longeval.sh >> "$L/${NAME}_${t}.log" 2>&1
52
+ if [ -s "$O/summary.csv" ] && [ "$(wc -l < "$O/summary.csv")" -gt 1 ]; then
53
+ say " $(tail -n +2 $O/summary.csv | tr '\n' ' ')"
54
+ else
55
+ say " FAILED"; grep -ahA2 'what()\|Error\|Traceback' "$O"/gen/*.log "$L/${NAME}_${t}.log" 2>/dev/null|head -3|tee -a "$M" >&2
56
+ fi
57
+ done
58
+ }
59
+ say "=== RULER suite, 13 tasks, N=100, PL=$PL, T=$T x$S ==="
60
+ one t64 t64.ckpt
61
+ one p1final p1final.ckpt
62
+ say "=== RULER TABLE ==="
63
+ for t in $TASKS_ALL; do
64
+ a=$(tail -n +2 ruler_t64_${t}/summary.csv 2>/dev/null | cut -d, -f2 | head -1)
65
+ b=$(tail -n +2 ruler_p1final_${t}/summary.csv 2>/dev/null | cut -d, -f2 | head -1)
66
+ printf " %-18s t64=%-6s p1final=%-6s\n" "$t" "${a:-.}" "${b:-.}" | tee -a "$M"
67
+ done
68
+ say "RULER DONE"