mats-sql-bundle / code /slurm_logs /apply_selector_v3.sbatch
thanhdath's picture
Push code: scripts, slurm sbatch, recipes, utils (v3 + selector series)
778d47d verified
Raw
History Blame Contribute Delete
2.23 kB
#!/bin/bash
#SBATCH --job-name=vl
#SBATCH --partition=gpu-large
#SBATCH --qos=batch-long
#SBATCH --gres=gpu:1
#SBATCH --cpus-per-task=2
#SBATCH --mem=64G
#SBATCH --time=02:00:00
#SBATCH --output=/weka/s225250685/mats-tist/slurm_logs/applyv3_%j.out
set -u
cd /weka/s225250685/mats-tist
export HF_HOME=/weka/s225250685/Huggingface
export HF_HUB_CACHE=/weka/s225250685/Huggingface/hub
export PYTHONNOUSERSITE=1
export DB_EXEC_API_DISABLE=1
export NO_PROXY=localhost,127.0.0.1
export PYTHONPATH=/weka/s225250685/mats-tist
PY=/weka/s225250685/conda-envs/handbook/bin/python
VLLM=/weka/s225250685/conda-envs/handbook/bin/vllm
SEL_V3=/weka/s225250685/mats-tist/alignment-handbook/output/selector-3B-v3-rich
LOG=/weka/s225250685/mats-tist/slurm_logs/applyv3_${SLURM_JOB_ID}.log
: > "$LOG"
kill_vllm() {
pkill -9 -f "vllm serve" 2>/dev/null || true
pkill -9 -f "VLLM::EngineCore" 2>/dev/null || true
sleep 4
}
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
return 1
}
echo "==== launching selector v3 vLLM ====" | tee -a "$LOG"
$VLLM serve "$SEL_V3" \
--served-model-name selector --port 8103 --dtype bfloat16 \
--gpu-memory-utilization 0.85 --enforce-eager --max-model-len 8192 \
> "${LOG}.serve" 2>&1 &
wait_url http://localhost:8103/v1/models && echo "selector v3 READY" | tee -a "$LOG"
# Apply to all 3 existing K=8 JSONLs + wider mixed-temp (if exists)
for f in \
eval_results/scaleup_BoN8_d_K8_1stage_planner_iter2_mixedtemp_bird_dev.jsonl \
eval_results/scaleup_BoN8_d_K8_3stage_planner_iter2_mixedtemp_vsel_vcond_fixer_orpo_bird_dev.jsonl \
eval_results/scaleup_BoN8_d_K8_3stage_planner_iter2_mixedtemp_vsel05_vcond06_replanner05_bird_dev.jsonl \
eval_results/scaleup_BoN8_d_K8_1stage_planner_iter2_widertemp_bird_dev.jsonl; do
if [ -f "$f" ]; then
label="$(basename $f .jsonl)_selectorV3rich"
echo "==== $label ====" | tee -a "$LOG"
$PY scripts/compute_bestofn_with_selector_v3.py \
"$f" "$label" --selector_host http://localhost:8103 --n_threads 8 \
2>&1 | tee -a "$LOG"
fi
done
echo "==== ALL_DONE ====" | tee -a "$LOG"