mats-sql-bundle / code /slurm_logs /gen_planner_preds.sbatch
thanhdath's picture
Push code: scripts, slurm sbatch, recipes, utils (v3 + selector series)
778d47d verified
Raw
History Blame Contribute Delete
1.35 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=02:00:00
#SBATCH --output=/weka/s225250685/mats-tist/slurm_logs/gen_planner_preds_%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
AH=/weka/s225250685/mats-tist/alignment-handbook
PLANNER=$AH/output/sft-planner-3B-griffith-v4
kill_vllm() { pkill -9 -f "vllm serve" 2>/dev/null || true; sleep 3; }
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 "$PLANNER" --served-model-name planner --port 8100 \
--dtype bfloat16 --gpu-memory-utilization 0.85 \
--enforce-eager --max-model-len 8192 > /tmp/vllm_p_$$ 2>&1 &
wait_url http://localhost:8100/v1/models
$PY scripts/gen_planner_preds_for_validator.py \
--planner_host http://localhost:8100 \
--out data/planner_3B_greedy_bird_train.jsonl
echo "DONE"