|
| 1 | +#!/usr/bin/env bash |
| 2 | +# One-shot OVERNIGHT regeneration of all GATO paper data on a QUIET box (2026-07-07 queue). |
| 3 | +# Stages run SEQUENTIALLY (timing-sensitive first; a stage failure is logged and the chain |
| 4 | +# continues — nothing later depends on an earlier stage's success): |
| 5 | +# 1. fig3-fair : GATO NxB sweep (N in {8..128}, B up to 512) + BatchThneed B-sweep + |
| 6 | +# MPCGPU per-solve (N=64), then table/heatmap assembly. TIMING — must be first. |
| 7 | +# 2. gates : MPCGPU tools/run_gates.sh + GBD-PCG test/run_gates.sh. First execution of |
| 8 | +# the authored gate runners: REVIEW the log before committing those files. |
| 9 | +# 3. fig5 : disturbance sweep REGEN (all pre-2026-07-07 fig5 data is invalid — the sim |
| 10 | +# applied the world f_ext in the wrong frame; fixed in commit 6466349). |
| 11 | +# 4. fig4 : hparam sweep regen. |
| 12 | +# 5. fig7 : FULL 100-scenario pick-place sweep (~7 h — the long pole, so it goes last; |
| 13 | +# everything before it completes in the first ~2 h). |
| 14 | +# Total ~9-10 h. Per-stage logs + SUMMARY.txt in examples/paper-figures/overnight_logs/<stamp>/. |
| 15 | +# |
| 16 | +# Usage (from the GATO repo root): examples/paper-figures/run_all_overnight.sh |
| 17 | +# FORCE=1 skips the GPU-quiet preflight check. |
| 18 | +set -uo pipefail |
| 19 | +REPO=/home/plancher/Desktop/GATO |
| 20 | +MPCGPU=/home/plancher/Desktop/MPCGPU |
| 21 | +PY=/home/plancher/Desktop/GRiD/.venv/bin/python |
| 22 | +cd "$REPO" || exit 1 |
| 23 | + |
| 24 | +STAMP=$(date -u +%Y%m%d_%H%M%S) |
| 25 | +LOGDIR=$REPO/examples/paper-figures/overnight_logs/$STAMP |
| 26 | +mkdir -p "$LOGDIR" |
| 27 | +SUMMARY=$LOGDIR/SUMMARY.txt |
| 28 | +echo "overnight run $STAMP (UTC)" > "$SUMMARY" |
| 29 | + |
| 30 | +# ---- preflight: the box must be quiet (stage 1 is a timing run) ---- |
| 31 | +if [[ "${FORCE:-0}" != "1" ]]; then |
| 32 | + util=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | head -1) |
| 33 | + apps=$(nvidia-smi --query-compute-apps=pid --format=csv,noheader | wc -l) |
| 34 | + load=$(awk '{print int($1)}' /proc/loadavg) |
| 35 | + if (( util > 5 || apps > 0 || load > 2 )); then |
| 36 | + echo "ABORT: box not quiet (gpu_util=${util}% compute_apps=${apps} load=${load})." \ |
| 37 | + "Re-run with FORCE=1 to override." | tee -a "$SUMMARY" |
| 38 | + exit 1 |
| 39 | + fi |
| 40 | +fi |
| 41 | + |
| 42 | +stage() { # stage <name> <log> <cmd...> |
| 43 | + local name=$1 log=$2; shift 2 |
| 44 | + local t0=$SECONDS |
| 45 | + echo "==== [$name] $(date -u +%H:%M:%S) $*" | tee -a "$SUMMARY" |
| 46 | + if "$@" >"$log" 2>&1; then |
| 47 | + echo "[$name] PASS ($(( (SECONDS-t0)/60 )) min) log=$log" | tee -a "$SUMMARY" |
| 48 | + else |
| 49 | + echo "[$name] FAIL ($(( (SECONDS-t0)/60 )) min) log=$log <-- review" | tee -a "$SUMMARY" |
| 50 | + fi |
| 51 | +} |
| 52 | + |
| 53 | +# 1. fig3 fair data (timing: GATO grid, BT, MPCGPU — the orchestrator runs them sequentially) |
| 54 | +stage fig3 "$LOGDIR/fig3.log" \ |
| 55 | + "$PY" examples/paper-figures/reproduce_fig3_fair.py --run-gato --run-bt --run-mpcgpu |
| 56 | + |
| 57 | +# 2. correctness gate runners (authored 2026-07-07, first execution — review before committing) |
| 58 | +stage gates-mpcgpu "$LOGDIR/gates_mpcgpu.log" bash -c "cd $MPCGPU && bash tools/run_gates.sh" |
| 59 | +stage gates-gbdpcg "$LOGDIR/gates_gbdpcg.log" bash -c "cd $MPCGPU/GBD-PCG && bash test/run_gates.sh" |
| 60 | + |
| 61 | +# 3-5. figure regens (correctness/statistics, not timing) |
| 62 | +stage fig5 "$LOGDIR/fig5.log" "$PY" examples/paper-figures/reproduce_fig5_disturbance.py --regen |
| 63 | +stage fig4 "$LOGDIR/fig4.log" "$PY" examples/paper-figures/reproduce_fig4_hparam.py --regen |
| 64 | +stage fig7 "$LOGDIR/fig7.log" "$PY" examples/paper-figures/reproduce_fig7_pickplace.py --regen |
| 65 | + |
| 66 | +# ---- digest: pull the headline lines into the summary ---- |
| 67 | +{ |
| 68 | + echo; echo "---- key results ----" |
| 69 | + grep -E "GATOvsBT|GATOvsMPCGPU|=== Fig-3" -m 12 "$LOGDIR/fig3.log" 2>/dev/null | head -14 |
| 70 | + grep -E "PASS|FAIL" "$LOGDIR/gates_mpcgpu.log" 2>/dev/null | tail -8 |
| 71 | + grep -E "PASS|FAIL" "$LOGDIR/gates_gbdpcg.log" 2>/dev/null | tail -6 |
| 72 | + grep -E "TABLE I|^ *Batch|^ *[0-9]+ +[0-9.]+" "$LOGDIR/fig7.log" 2>/dev/null | tail -12 |
| 73 | +} >> "$SUMMARY" |
| 74 | +echo "DONE $(date -u +%H:%M:%S). Summary: $SUMMARY" |
| 75 | +cat "$SUMMARY" |
0 commit comments