File size: 1,318 Bytes
3bbd5dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env bash
# Trough-depth comparison across L1/L4/L5 under corrected position sampling.
#
# Phase 2's trough depths are not usable for this comparison: they were
# measured with leading-position sampling, which is biased for byte-level
# conditions, so L1/L4 have to be re-measured the same way L5 now is.
# entropy_trough_depth reads horizon-1 points only, so max_horizon=1 keeps
# this cheap -- one forward pass per position, no top-k, no Monte Carlo.
set -uo pipefail
cd "$(dirname "$0")/.."
source .venv/bin/activate

OUT="${1:?usage: phase2b_run_trough.sh <output_dir>}"
mkdir -p "$OUT"

launch() {
  local gpu="$1" tag="$2"; shift 2
  echo "$(date '+%F %T') launch tag=$tag gpu=$gpu" >> "$OUT/concurrency.log"
  CUDA_VISIBLE_DEVICES="$gpu" "$@" > "$OUT/$tag.log" 2>&1
  echo "$(date '+%F %T') finish tag=$tag gpu=$gpu rc=$?" >> "$OUT/concurrency.log"
}

( launch 3 b_trough_L1 python scripts/phase2b_blocker_b.py --model sarvam1 --text-column devanagari \
    --limit 400 --max-horizon 1 --strategies spread --out "$OUT/b_trough_L1.json" ) &
( launch 0 b_trough_L4 python scripts/phase2b_blocker_b.py --model llama32 --text-column devanagari \
    --limit 400 --max-horizon 1 --strategies spread --out "$OUT/b_trough_L4.json" ) &

wait
echo "$(date '+%F %T') trough wave done" >> "$OUT/concurrency.log"