Upload scripts/eval_t128d.sh with huggingface_hub
Browse files- scripts/eval_t128d.sh +48 -0
scripts/eval_t128d.sh
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# t128d curve: 5 checkpoints x 2 lengths @x32, N=100.
|
| 3 |
+
# Uses the harness's own fan-out (run_longeval.sh:163) instead of one job per
|
| 4 |
+
# GPU: generation is LATENCY-bound (one full forward per token, no KV cache,
|
| 5 |
+
# batch hardcoded to 1), so at ~5.6 GB/job on a 143 GB card the GPUs sit at
|
| 6 |
+
# 4-25% util. Oversubscribe. Two invocations run in parallel, JOBS_PER_GPU=2
|
| 7 |
+
# each -> 8 slots each, 5 jobs each, all 10 concurrent, ~14 GB/GPU.
|
| 8 |
+
set -uo pipefail
|
| 9 |
+
cd "$(dirname "$0")"
|
| 10 |
+
export LD_LIBRARY_PATH="$(cd ../.. && pwd)/Tensor-Implementations/lib:$(cd ../.. && pwd)/Profiler/lib:${LD_LIBRARY_PATH:-}"
|
| 11 |
+
export PATH=/usr/local/cuda/bin:$PATH
|
| 12 |
+
export PY=/root/Adhi/BluTrain/envv/bin/python
|
| 13 |
+
L=eval_t128d_logs; mkdir -p "$L"; M="$L/master.log"
|
| 14 |
+
HAY=data/mix128_b6_60/val_shard_00000.bin
|
| 15 |
+
A680="CP_N_EMBD=1536 CP_N_LAYER=24 CP_N_HEAD=12 CP_N_KVHEAD=4 CP_FFN=4096 CP_WEIGHT_TYING=1"
|
| 16 |
+
STEPS="100 200 300 350 360"
|
| 17 |
+
say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a "$M" >&2; }
|
| 18 |
+
[ "$(stat -c%s "$HAY")" = 199754694 ] || { say "FATAL haystack differs"; exit 1; }
|
| 19 |
+
$PY -c "import tiktoken,numpy" || { say "FATAL venv lacks tiktoken"; exit 1; }
|
| 20 |
+
|
| 21 |
+
EXTRA=""; NAMES=""
|
| 22 |
+
for s in $STEPS; do EXTRA="$EXTRA s${s}=t128d_s${s}.ckpt"; NAMES="$NAMES s${s}"; done
|
| 23 |
+
|
| 24 |
+
blk(){ # prompt_len
|
| 25 |
+
local PL="$1"; local O="ed_${PL}"
|
| 26 |
+
A1B="$A680" HAY="$HAY" GEN_DATA_ROOT="data/mix128_b6_60" \
|
| 27 |
+
CKPT_EXTRA="${EXTRA# }" CKPTS="${NAMES# }" TASKS="niah_single" N=100 \
|
| 28 |
+
T=131072 YARN=32 YARN_ORIG=4096 PROMPT_LEN="$PL" \
|
| 29 |
+
GPUS="0,1,2,3" NP=1 JOBS_PER_GPU=2 OUT="$O" \
|
| 30 |
+
./run_longeval.sh > "$L/len_${PL}.log" 2>&1
|
| 31 |
+
say " len $PL done: $(head -1 $O/summary.csv 2>/dev/null) | $(grep -h '^niah_single,' $O/summary.csv 2>/dev/null | tr -d '\r')"
|
| 32 |
+
}
|
| 33 |
+
say "=== t128d curve, 10 jobs, JOBS_PER_GPU=2 on 4 GPUs ==="
|
| 34 |
+
blk 4096 & blk 32744 &
|
| 35 |
+
wait
|
| 36 |
+
say "=== RESULTS niah_single T=131072 x32 ORIG=4096 N=100 ==="
|
| 37 |
+
hdr=$(head -1 ed_4096/summary.csv 2>/dev/null | tr -d '\r')
|
| 38 |
+
say " column order: $hdr"
|
| 39 |
+
printf " %-6s %8s %8s\n" step 4096 32744 | tee -a "$M"
|
| 40 |
+
for s in $STEPS; do
|
| 41 |
+
i=$(head -1 ed_4096/summary.csv 2>/dev/null | tr -d '\r' | tr ',' '\n' | grep -n "^s${s}$" | cut -d: -f1)
|
| 42 |
+
j=$(head -1 ed_32744/summary.csv 2>/dev/null | tr -d '\r' | tr ',' '\n' | grep -n "^s${s}$" | cut -d: -f1)
|
| 43 |
+
a=$(grep -h '^niah_single,' ed_4096/summary.csv 2>/dev/null | tr -d '\r' | cut -d, -f"${i:-99}")
|
| 44 |
+
b=$(grep -h '^niah_single,' ed_32744/summary.csv 2>/dev/null | tr -d '\r' | cut -d, -f"${j:-99}")
|
| 45 |
+
printf " %-6s %8s %8s\n" "$s" "${a:-.}" "${b:-.}" | tee -a "$M"
|
| 46 |
+
done
|
| 47 |
+
say "ref t128c: s300 99/92 s400 97/75 s450 93/69 s500 94/76 | t64 100/93 | old-t128 98/69"
|
| 48 |
+
say "EVAL_T128D_DONE"
|