mats-sql-bundle / code /slurm_logs /apply_v2_all.sbatch
thanhdath's picture
Push code: scripts, slurm sbatch, recipes, utils (v3 + selector series)
778d47d verified
Raw
History Blame Contribute Delete
2.49 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=03:00:00
#SBATCH --output=/weka/s225250685/mats-tist/slurm_logs/applyv2all_%j.out
set -u
cd /weka/s225250685/mats-tist
export HF_HOME=/weka/s225250685/Huggingface
export HF_HUB_CACHE=/weka/s225250685/Huggingface/hub
export DB_EXEC_API_DISABLE=1
export PYTHONNOUSERSITE=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_V2=/weka/s225250685/mats-tist/alignment-handbook/output/selector-3B-v2-rows
LOG=/weka/s225250685/mats-tist/slurm_logs/applyv2all_${SLURM_JOB_ID}.log
: > "$LOG"
nvidia-smi --query-gpu=name,memory.total --format=csv,noheader | tee -a "$LOG"
kill_vllm() {
pkill -9 -f "vllm serve" 2>/dev/null || true
pkill -9 -f "VLLM::EngineCore" 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
return 1
}
echo "==== launching selector v2-rows ====" | tee -a "$LOG"
$VLLM serve "$SEL_V2" \
--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 v2 READY" | tee -a "$LOG"
# Apply to ALL available K=8 JSONLs (incl. any produced by other jobs)
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 \
eval_results/scaleup_BoN8_d_K8_1stage_planner_iter2_extrawidetemp_bird_dev.jsonl \
eval_results/scaleup_BoN8_d_K8_3stage_planner_iter2_widertemp_gatedfixer_bird_dev.jsonl; do
if [ -f "$f" ]; then
label="$(basename $f .jsonl)_selectorV2rows"
echo "==== $label ====" | tee -a "$LOG"
$PY scripts/compute_bestofn_with_selector.py \
"$f" "$label" --selector_host http://localhost:8103 --row_preview 2>&1 | tee -a "$LOG"
fi
done
echo "==== ALL_DONE ====" | tee -a "$LOG"