This commit is contained in:
wassname
2026-05-05 09:11:06 +08:00
parent 45b7123cf5
commit 0bd7a11d2d
3 changed files with 59 additions and 1 deletions
+1
View File
@@ -10,3 +10,4 @@ outputs/*.tsv
outputs/*.png
outputs/*.md
!outputs/.gitkeep
outputs/
+10 -1
View File
@@ -15,10 +15,19 @@ cell model="Qwen/Qwen2.5-0.5B-Instruct" method="mean_diff" seed="0" window="50":
uv run --extra all python scripts/run_cell.py \
--model {{model}} --method {{method}} --seed {{seed}} --window {{window}}
# Sweep model x method x seed x window cells.
# Sweep model x method x seed x window cells (sequential bash).
sweep:
bash scripts/sweep.sh
# Queue all sweep cells via pueue (one job per cell, priority: small models first).
queue:
bash scripts/queue_sweep.sh
# Show pueue status and a tail of each running job.
queue-status:
pueue status
pueue log -l 15
# Aggregate all outputs/<run_id>/ into figs/figure1.png + figs/table.md.
aggregate:
uv run --extra all python scripts/aggregate.py --runs-root outputs --out figs
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# Queue all sweep cells via pueue. Each cell gets its own job with why/resolve.
set -euo pipefail
cd "$(dirname "$0")/.."
ROOT="$PWD"
MODELS=(
"Qwen/Qwen2.5-0.5B-Instruct"
"meta-llama/Llama-3.2-1B-Instruct"
"Qwen/Qwen3-4B-Instruct-2507"
)
METHODS=("mean_diff" "directional_ablation" "pca")
SEEDS=(0 1 2)
WINDOWS=(20 50)
# Priority: small models first so the figure starts populating; 4B last.
prio_for_model() {
case "$1" in
*0.5B*) echo 30 ;;
*1B*) echo 20 ;;
*4B*) echo 10 ;;
*) echo 5 ;;
esac
}
n=0
for model in "${MODELS[@]}"; do
prio=$(prio_for_model "$model")
for method in "${METHODS[@]}"; do
for seed in "${SEEDS[@]}"; do
for window in "${WINDOWS[@]}"; do
run_id="$(basename "$model")_${method}_s${seed}_w${window}"
if [ -f "outputs/${run_id}/calib.json" ]; then
echo "skip ${run_id} (already done)"; continue
fi
label="why: stability of iso-KL calib for ${method} on ${model} (seed ${seed}, T=${window}); resolve: include cell in figure1 if it converges, else flag as bracket-pinned"
pueue add -w "$ROOT" -o "$prio" -l "$label" -- \
uv run --extra all python scripts/run_cell.py \
--model "$model" --method "$method" --seed "$seed" --window "$window" \
--run-id "$run_id"
n=$((n+1))
done
done
done
done
echo "queued ${n} jobs"
echo "monitor: pueue status | head -40"
echo "aggregate after queue drains: just aggregate"