unparallelled commited on
Commit
f9284e1
·
verified ·
1 Parent(s): 199235a

Upload source/files/run_probepos_experiment.sh with huggingface_hub

Browse files
source/files/run_probepos_experiment.sh ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Probe-position sweep on ONE GPU. Two questions, one job set:
3
+ # (1) ADJACENCY vs END-OF-DOCUMENT -- variant p1 (needle adjacent) is run at each
4
+ # PROBE_POS. Arms B and C are ~4 nats worse than base at p1 when the probe sits
5
+ # at the end (16364). If they recover with the probe mid-document, the defect is
6
+ # end-of-document, not adjacency.
7
+ # (2) U-SHAPE -- variant p<D> holds needle-probe DISTANCE fixed at 4087 tokens while
8
+ # the probe's ABSOLUTE position moves. needle_gen's default (probe pinned at the
9
+ # end) makes distance and position perfectly anti-correlated, so the main sweep
10
+ # could not tell "far from the question" from "early in the document". This can.
11
+ set -uo pipefail
12
+ cd "$(dirname "$0")"
13
+ LOG=probepos_logs; mkdir -p $LOG
14
+ M=$LOG/master.log
15
+ say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a $M; }
16
+
17
+ CK=checkpoints_bluscriptcp/rank_0
18
+ declare -A MODELS=( [base]=blumodelcp_run7_step_750.ckpt \
19
+ [armB]=blumodelcp_run15_step_400.ckpt \
20
+ [armC]=blumodelcp_run16_step_400.ckpt )
21
+ # P=8192 first: the decisive middle-vs-end contrast. P=12288 adds the third curve point.
22
+ POSITIONS="8192 12288"
23
+ declare -A PFRAC=( [6144]=0.3331 [8192]=0.5001 [12288]=0.6670 )
24
+
25
+ say "probe-pos sweep starting on $(nvidia-smi --query-gpu=name --format=csv,noheader | head -1)"
26
+ for P in $POSITIONS; do
27
+ for MK in base armB armC; do
28
+ OUT=probe_pos${P}_${MK}
29
+ if [ -f "$OUT/reach.csv" ]; then say " $OUT already done"; continue; fi
30
+ say " PROBE_POS=$P model=$MK (variants: p${PFRAC[$P]} p1 null absent)"
31
+ CKPT="$PWD/$CK/${MODELS[$MK]}" OUT=$OUT \
32
+ PROBE_POS=$P VARIANTS="p${PFRAC[$P]} p1 absent null" \
33
+ FACTORS=4 CACHES=yarn YARN_SCALE=4 GPUS=0 BLOCKS=3 \
34
+ ./probe_1b.sh >>"$M" 2>&1 \
35
+ && say " -> $OUT/reach.csv" \
36
+ || say " WARN: $MK at P=$P returned nonzero (CSVs may still be usable)"
37
+ done
38
+ done
39
+ say "ALL DONE"