mats-sql-bundle / code /slurm_logs /eval_paper_selector.sbatch
thanhdath's picture
Push code: scripts, slurm sbatch, recipes, utils (v3 + selector series)
778d47d verified
Raw
History Blame Contribute Delete
1.77 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=80G
#SBATCH --time=02:00:00
#SBATCH --output=/weka/s225250685/mats-tist/slurm_logs/eval_paper_selector_%j.out
# Run selector v2 EX on the 3 paper-format K=8 rollouts.
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
AH=/weka/s225250685/mats-tist/alignment-handbook
SELECTOR=$AH/output/sft-selector-3B-griffith-v5
kill_vllm() { pkill -9 -f "vllm serve" 2>/dev/null || true; sleep 5; }
trap kill_vllm EXIT
wait_url() { for i in {1..120}; do curl --noproxy '*' -fs "$1" >/dev/null 2>&1 && return 0; sleep 5; done; }
$VLLM serve "$SELECTOR" --served-model-name selector --port 8103 \
--dtype bfloat16 --gpu-memory-utilization 0.85 \
--enforce-eager --max-model-len 4096 > /tmp/sel_$$ 2>&1 &
wait_url http://localhost:8103/v1/models
echo "[$(date)] selector ready"
for L in SFT_VF COLLAB_par INDEP_par; do
IN=eval_results/paper_${L}_passAt8_bird_dev.jsonl
[ -f "$IN" ] || { echo " skip $IN (missing)"; continue; }
n=$(wc -l < "$IN")
[ "$n" -lt 100 ] && { echo " skip $IN (only $n rows)"; continue; }
echo "[$(date)] selector EX on $IN (n=$n)..."
$PY scripts/compute_bestofn_with_selector.py \
"$IN" paper_${L}_selectorEX \
--selector_host http://localhost:8103 --row_preview
done
echo "[$(date)] ALL DONE"