File size: 2,636 Bytes
c4b2834
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# t128d curve: 5 checkpoints x 2 lengths @x32, N=100.
# Uses the harness's own fan-out (run_longeval.sh:163) instead of one job per
# GPU: generation is LATENCY-bound (one full forward per token, no KV cache,
# batch hardcoded to 1), so at ~5.6 GB/job on a 143 GB card the GPUs sit at
# 4-25% util. Oversubscribe. Two invocations run in parallel, JOBS_PER_GPU=2
# each -> 8 slots each, 5 jobs each, all 10 concurrent, ~14 GB/GPU.
set -uo pipefail
cd "$(dirname "$0")"
export LD_LIBRARY_PATH="$(cd ../.. && pwd)/Tensor-Implementations/lib:$(cd ../.. && pwd)/Profiler/lib:${LD_LIBRARY_PATH:-}"
export PATH=/usr/local/cuda/bin:$PATH
export PY=/root/Adhi/BluTrain/envv/bin/python
L=eval_t128d_logs; mkdir -p "$L"; M="$L/master.log"
HAY=data/mix128_b6_60/val_shard_00000.bin
A680="CP_N_EMBD=1536 CP_N_LAYER=24 CP_N_HEAD=12 CP_N_KVHEAD=4 CP_FFN=4096 CP_WEIGHT_TYING=1"
STEPS="100 200 300 350 360"
say(){ echo "[$(date -u +%H:%M:%S)] $*" | tee -a "$M" >&2; }
[ "$(stat -c%s "$HAY")" = 199754694 ] || { say "FATAL haystack differs"; exit 1; }
$PY -c "import tiktoken,numpy" || { say "FATAL venv lacks tiktoken"; exit 1; }

EXTRA=""; NAMES=""
for s in $STEPS; do EXTRA="$EXTRA s${s}=t128d_s${s}.ckpt"; NAMES="$NAMES s${s}"; done

blk(){ # prompt_len
  local PL="$1"; local O="ed_${PL}"
  A1B="$A680" HAY="$HAY" GEN_DATA_ROOT="data/mix128_b6_60" \
  CKPT_EXTRA="${EXTRA# }" CKPTS="${NAMES# }" TASKS="niah_single" N=100 \
  T=131072 YARN=32 YARN_ORIG=4096 PROMPT_LEN="$PL" \
  GPUS="0,1,2,3" NP=1 JOBS_PER_GPU=2 OUT="$O" \
    ./run_longeval.sh > "$L/len_${PL}.log" 2>&1
  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')"
}
say "=== t128d curve, 10 jobs, JOBS_PER_GPU=2 on 4 GPUs ==="
blk 4096 & blk 32744 &
wait
say "=== RESULTS  niah_single  T=131072 x32 ORIG=4096  N=100 ==="
hdr=$(head -1 ed_4096/summary.csv 2>/dev/null | tr -d '\r')
say "  column order: $hdr"
printf "  %-6s %8s %8s\n" step 4096 32744 | tee -a "$M"
for s in $STEPS; do
  i=$(head -1 ed_4096/summary.csv 2>/dev/null | tr -d '\r' | tr ',' '\n' | grep -n "^s${s}$" | cut -d: -f1)
  j=$(head -1 ed_32744/summary.csv 2>/dev/null | tr -d '\r' | tr ',' '\n' | grep -n "^s${s}$" | cut -d: -f1)
  a=$(grep -h '^niah_single,' ed_4096/summary.csv  2>/dev/null | tr -d '\r' | cut -d, -f"${i:-99}")
  b=$(grep -h '^niah_single,' ed_32744/summary.csv 2>/dev/null | tr -d '\r' | cut -d, -f"${j:-99}")
  printf "  %-6s %8s %8s\n" "$s" "${a:-.}" "${b:-.}" | tee -a "$M"
done
say "ref t128c: s300 99/92  s400 97/75  s450 93/69  s500 94/76 | t64 100/93 | old-t128 98/69"
say "EVAL_T128D_DONE"