mirror of
https://github.com/wassname/isokl_steering_calibration.git
synced 2026-06-27 15:31:07 +08:00
wip
This commit is contained in:
@@ -10,3 +10,4 @@ outputs/*.tsv
|
|||||||
outputs/*.png
|
outputs/*.png
|
||||||
outputs/*.md
|
outputs/*.md
|
||||||
!outputs/.gitkeep
|
!outputs/.gitkeep
|
||||||
|
outputs/
|
||||||
|
|||||||
@@ -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 \
|
uv run --extra all python scripts/run_cell.py \
|
||||||
--model {{model}} --method {{method}} --seed {{seed}} --window {{window}}
|
--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:
|
sweep:
|
||||||
bash scripts/sweep.sh
|
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 all outputs/<run_id>/ into figs/figure1.png + figs/table.md.
|
||||||
aggregate:
|
aggregate:
|
||||||
uv run --extra all python scripts/aggregate.py --runs-root outputs --out figs
|
uv run --extra all python scripts/aggregate.py --runs-root outputs --out figs
|
||||||
|
|||||||
@@ -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"
|
||||||
Reference in New Issue
Block a user