forensics-grpo / code /scripts /run_ablations.sh
sdzt's picture
Add source code
33569f9 verified
Raw
History Blame Contribute Delete
1.02 kB
#!/bin/bash
# Serial driver for v10_r2 ablations.
# AB1: w/o Hungarian (~7h)
# AB2: w/o ST-Aug (~7h)
# Halts on first failure (does NOT continue to next run).
set -e
set -u
set -o pipefail
cd "$(dirname "$0")/.."
mkdir -p logs
TS=$(date +%Y%m%d_%H%M%S)
SUMMARY="logs/ablations_summary_${TS}.log"
run_one() {
local id="$1"; local script="$2"
local log="logs/${id}_${TS}.log"
echo "[$(date '+%F %T')] >>> START ${id} (log: ${log})" | tee -a "$SUMMARY"
bash "$script" 2>&1 | tee "$log"
local rc=${PIPESTATUS[0]}
if [ "$rc" -ne 0 ]; then
echo "[$(date '+%F %T')] !!! FAIL ${id} (exit=${rc}) -- halting queue" | tee -a "$SUMMARY"
exit "$rc"
fi
echo "[$(date '+%F %T')] <<< DONE ${id}" | tee -a "$SUMMARY"
}
echo "=== ablation queue start ${TS} ===" | tee -a "$SUMMARY"
run_one ab_noHung scripts/run_grpo_forensics_ab_noHung.sh
run_one ab_noAug scripts/run_grpo_forensics_ab_noAug.sh
echo "=== ablation queue done $(date '+%F %T') ===" | tee -a "$SUMMARY"