CausalGrok / code /scripts /run_m1_seq_new.sh
nileshsarkar-ai's picture
Upload code/scripts
42c0d23 verified
#!/usr/bin/env bash
# Sequential M1 driver for the 4 newly-trained 2026-05-08 runs.
set -e
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
LOG="logs/m1_seq_new.log"
mkdir -p logs
stamp() { date -u +"[%FT%TZ]"; }
echo "$(stamp) M1 sequential pipeline starting" | tee -a "$LOG"
for d in experiments/runs/20260508-*/; do
rid=$(basename "$d")
if [ -f "$d/mechinterp/m1_probe_data.json" ]; then
echo "$(stamp) skip $rid (already has m1_probe_data)" | tee -a "$LOG"
continue
fi
echo "$(stamp) ==== M1 on $rid ====" | tee -a "$LOG"
set +e
CUDA_VISIBLE_DEVICES=0 python3 -m experiments.mechinterp_m1 \
--run_dir "$d" --data_root data/wilds \
--device cuda --max_samples 600 >> "$LOG" 2>&1
rc=$?
set -e
echo "$(stamp) ==== $rid exit=$rc ====" | tee -a "$LOG"
done
echo "$(stamp) M1 sequential pipeline complete." | tee -a "$LOG"