Upload scripts/e64k.sh with huggingface_hub
Browse files- scripts/e64k.sh +46 -0
scripts/e64k.sh
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# T=65,536 / YaRN 16 x 4096. Does the scale trend continue, or break?
|
| 3 |
+
#
|
| 4 |
+
# MEMORY: this is INFERENCE, not training. The 64k TRAINING figure (~117 GB at
|
| 5 |
+
# cp=2, hence >=4 GPUs) covers activations for backward, gradients and optimizer
|
| 6 |
+
# state -- none of which exist here. Measured at T=32,768: 3,823 MiB/GPU. KV
|
| 7 |
+
# cache at 65,536 is 3.22 GB + 1.36 GB weights, so cp=1 per job on an 80 GB card.
|
| 8 |
+
#
|
| 9 |
+
# 4,096 is included deliberately: at scale 16 the interpolation is most
|
| 10 |
+
# aggressive, so if over-compression costs short-context resolution it shows
|
| 11 |
+
# there first.
|
| 12 |
+
set -uo pipefail
|
| 13 |
+
cd "$(dirname "$0")"
|
| 14 |
+
export PATH=/root/Adhi/BluTrain/envv/bin:$PATH
|
| 15 |
+
source /root/Adhi/BluTrain/envv/bin/activate 2>/dev/null
|
| 16 |
+
L=e64k_logs; mkdir -p "$L"; M="$L/master.log"
|
| 17 |
+
say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a "$M" >&2; }
|
| 18 |
+
T=65536; SCALE=16; ORIG=4096
|
| 19 |
+
[ $((SCALE*ORIG)) -eq $T ] || { say "FATAL YaRN invariant"; exit 1; }
|
| 20 |
+
HAY=Data_Loader/Data/b2_8192_16384/val_shard_00000.bin
|
| 21 |
+
[ "$(stat -c%s "$HAY")" = 199754694 ] || { say "FATAL haystack differs from phase 1's"; exit 1; }
|
| 22 |
+
A1B_680="CP_N_EMBD=1536 CP_N_LAYER=24 CP_N_HEAD=12 CP_N_KVHEAD=4 CP_FFN=4096 CP_WEIGHT_TYING=1"
|
| 23 |
+
say "=== T=$T YaRN ${SCALE}x${ORIG} -- base680 (control) vs p1final ==="
|
| 24 |
+
for PL in 4096 16360 32744 65512; do
|
| 25 |
+
O="e64k_len${PL}"
|
| 26 |
+
[ -s "$O/summary.csv" ] && [ "$(wc -l < "$O/summary.csv")" -gt 1 ] && {
|
| 27 |
+
say " len $PL cached: $(grep '^niah_single,' $O/summary.csv)"; continue; }
|
| 28 |
+
say "eval prompt_len=$PL"
|
| 29 |
+
A1B="$A1B_680" HAY="$HAY" GEN_DATA_ROOT="Data_Loader/Data/evalsrc" \
|
| 30 |
+
CKPT_EXTRA="p1final=blumodelcp_run12_step_1200.ckpt base680=varybatch.ckpt" \
|
| 31 |
+
CKPTS="p1final base680" TASKS=niah_single N=100 \
|
| 32 |
+
T=$T YARN=$SCALE YARN_ORIG=$ORIG PROMPT_LEN=$PL GPUS=0,1 NP=1 OUT="$O" \
|
| 33 |
+
./run_longeval.sh >> "$L/eval_${PL}.log" 2>&1
|
| 34 |
+
if [ -s "$O/summary.csv" ] && [ "$(wc -l < "$O/summary.csv")" -gt 1 ]; then
|
| 35 |
+
say " len $PL -> $(head -1 $O/summary.csv) | $(grep '^niah_single,' $O/summary.csv)"
|
| 36 |
+
grep -ahoiE 'out of memory|bad_alloc' "$O"/gen/*.log 2>/dev/null | head -1 | tee -a "$M" >&2
|
| 37 |
+
else
|
| 38 |
+
say " len $PL FAILED"; grep -ahA2 'what()' "$O"/gen/*.log 2>/dev/null | head -4 | tee -a "$M" >&2
|
| 39 |
+
fi
|
| 40 |
+
done
|
| 41 |
+
say "=== RESULTS T=$T (cols base680,p1final) ==="
|
| 42 |
+
for PL in 4096 16360 32744 65512; do
|
| 43 |
+
f="e64k_len${PL}/summary.csv"
|
| 44 |
+
[ -f "$f" ] && say " len $PL $(head -1 $f) -> $(grep '^niah_single,' $f)"
|
| 45 |
+
done
|
| 46 |
+
say "DONE"
|