Files
ML-Porosity/operations/p6_s1_watcher.sh
lamlvh f3c30517fa Add P6 benchmark code, locked protocol_bench, T2 study and lock inputs
- ml_porosity/benchmark/ runner, scripts 32-35, scripts/run_bench.sh;
  misspec= option in synth_d2 (default path reproduces P2r bit for bit).
- configs/protocol_bench.{yaml,sha256,lock.json} locked 29/10 14:39 UTC
  (sha256 aa763f0a...), configs/d2_synth_bench.yaml.
- The eight protocol_bench inputs force-added from outputs/ (warp prior,
  wavelets, horizon cache, budgets) so load_protocol() and summarize work
  after a fresh clone. The 102 P2r reference artifacts (1.4 GB of particle
  npz) are not in git; they are only checked by posterior/train stages.
- T2 mechanism declaration and results; operations/p6_supervisor.py.
- Docs, report and paper edits of 29/10.

Main S1 runs are still training at this commit; results follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 01:06:59 +00:00

28 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# P6 S1 launcher: waits for GPU headroom on the shared H200s, then starts the S1 drivers in tmux.
# Two disjoint regime groups (the runner does not claim jobs, so drivers must not overlap):
# A = R10 Rm5 R0 (protocol priority), B = R0h R10tb (cut first if late).
# A slot starts on a card only when free memory stays >= 2500 MiB + 2 workers x 1600 MiB on two
# readings one minute apart; workers = min(4, (free - 2500) / 1600). Never touches other jobs.
set -u
cd "$(dirname "$0")/.."
groups=("R10 Rm5 R0" "R0h R10tb"); names=(p6_s1a p6_s1b); next=0
log() { echo "$(date -u +%FT%TZ) $*"; }
free_mib() { nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits -i "$1" | tr -d ' '; }
log "watcher start"
while (( next < ${#groups[@]} )); do
for g in 0 1; do
(( next < ${#groups[@]} )) || break
f1=$(free_mib $g); (( f1 >= 5700 )) || continue
sleep 60; f2=$(free_mib $g); f=$(( f1 < f2 ? f1 : f2 )); (( f >= 5700 )) || continue
w=$(( (f - 2500) / 1600 )); (( w > 4 )) && w=4
n=${names[$next]}; r=${groups[$next]}
tmux new-session -d -s "$n" -c "$PWD" \
"env STUDIES=S1 REGIMES='$r' DEVICE=cuda:$g WORKERS=$w MEM_GB=2 scripts/run_bench.sh posterior train >> logs/bench_${n}_cuda$g.out 2>&1"
log "launched $n regimes=[$r] cuda:$g workers=$w (free ${f1}/${f2} MiB)"
next=$(( next + 1 )); sleep 300 # let the new workers allocate before the next reading
done
sleep 300
done
log "all S1 groups launched; watcher exits"