mats-sql-bundle / code /slurm_logs /eval_selector_v2.sbatch
thanhdath's picture
Push code: scripts, slurm sbatch, recipes, utils (v3 + selector series)
778d47d verified
Raw
History Blame Contribute Delete
2.2 kB
#!/bin/bash
#SBATCH --job-name=vl
#SBATCH --partition=gpu-large
#SBATCH --qos=batch-long
#SBATCH --gres=gpu:1
#SBATCH --cpus-per-task=4
#SBATCH --mem=60G
#SBATCH --time=03:00:00
#SBATCH --output=/weka/s225250685/mats-tist/slurm_logs/eval_selector_v2_%j.out
set -u; cd /weka/s225250685/mats-tist
set -a; source .env; set +a
export HF_HOME=/weka/s225250685/Huggingface HF_HUB_CACHE=/weka/s225250685/Huggingface/hub
export DB_EXEC_API_DISABLE=1 PYTHONNOUSERSITE=1 NO_PROXY=localhost,127.0.0.1
export PYTHONPATH=/weka/s225250685/mats-tist TOKENIZERS_PARALLELISM=false
PY=/weka/s225250685/conda-envs/handbook/bin/python
VLLM=/weka/s225250685/conda-envs/handbook/bin/vllm
SEL=/weka/s225250685/mats-tist/alignment-handbook/output/sft-selector-v2-3B
LOG=/weka/s225250685/mats-tist/slurm_logs/eval_selector_v2_${SLURM_JOB_ID}.log
kill_vllm() { pkill -9 -f "vllm serve" 2>/dev/null || true; sleep 5; }
trap kill_vllm EXIT
wait_url() { for i in {1..180}; do curl --noproxy '*' -fs "$1" >/dev/null 2>&1 && return 0; sleep 5; done; }
# Wait for selector v2
for i in {1..36}; do
[ -f "$SEL/config.json" ] && break
echo "waiting for selector v2 ($i*5min)" | tee -a "$LOG"; sleep 300
done
[ -f "$SEL/config.json" ] || { echo "SELECTOR v2 MISSING" | tee -a "$LOG"; exit 1; }
$VLLM serve "$SEL" --served-model-name selector --port 8103 \
--dtype bfloat16 --gpu-memory-utilization 0.85 --enforce-eager --max-model-len 4096 > "${LOG}.sel" 2>&1 &
wait_url http://localhost:8103/v1/models && echo "selector v2 READY" | tee -a "$LOG"
for L in COLLAB INDEP; do
F=eval_results/orpo1_${L}_passAt8_bird_dev.jsonl
[ -f "$F" ] && $PY scripts/compute_bestofn_with_selector.py "$F" "orpo1_${L}_selectorV2EX" \
--selector_host http://localhost:8103 --row_preview 2>&1 | tee -a "$LOG"
done
# Also re-eval the Phase 2 SFT pass@8-withVF rollout for comparison
$PY scripts/compute_bestofn_with_selector.py \
eval_results/sft_phase1_passAt8_withVF_bird_dev.jsonl sft_phase1_selectorV2EX \
--selector_host http://localhost:8103 --row_preview 2>&1 | tee -a "$LOG"
echo "==== FINAL TABLE ====" | tee -a "$LOG"
grep -E "selector|oracle|greedy" "$LOG" | tail -20
echo "ALL_DONE" | tee -a "$LOG"