| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
|
|
| set -u; cd /weka/s225250685/mats-tist |
| set -a; source /weka/s225250685/mats-tist/.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 |
| VAL_SEL=$AH/output/sft-validator-sel-llama1b-paper-v1 |
| VAL_COND=$AH/output/sft-validator-cond-llama1b-paper-v1 |
|
|
| LOG=/weka/s225250685/mats-tist/slurm_logs/build_fixer_data_v6_gpu_${SLURM_JOB_ID}.log |
| : > "$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; return 1; } |
|
|
| |
| if [ -d data/hf_fixer_critique_aware_v6 ] && [ -f data/hf_fixer_critique_aware_v6/dataset_info.json ]; then |
| echo "[$(date)] data/hf_fixer_critique_aware_v6 already exists; the gpu-large submission produced it. Exiting." |
| exit 0 |
| fi |
|
|
| echo "[$(date)] Booting planner + val-sel + val-cond on 1 A100..." | tee -a "$LOG" |
|
|
| $VLLM serve "$PLANNER" --served-model-name planner --port 8100 \ |
| --dtype bfloat16 --gpu-memory-utilization 0.30 \ |
| --enforce-eager --max-model-len 8192 > "${LOG}.p" 2>&1 & |
| wait_url http://localhost:8100/v1/models && echo "[$(date)] planner ready" | tee -a "$LOG" |
|
|
| $VLLM serve "$VAL_SEL" --served-model-name validator --port 8101 \ |
| --dtype bfloat16 --gpu-memory-utilization 0.10 \ |
| --enforce-eager --max-model-len 6144 > "${LOG}.vs" 2>&1 & |
| wait_url http://localhost:8101/v1/models && echo "[$(date)] val-sel ready" | tee -a "$LOG" |
|
|
| $VLLM serve "$VAL_COND" --served-model-name validator --port 8104 \ |
| --dtype bfloat16 --gpu-memory-utilization 0.10 \ |
| --enforce-eager --max-model-len 6144 > "${LOG}.vc" 2>&1 & |
| wait_url http://localhost:8104/v1/models && echo "[$(date)] val-cond ready" | tee -a "$LOG" |
|
|
| echo "[$(date)] === Building critique-aware fixer SFT data ===" | tee -a "$LOG" |
| $PY scripts/build_fixer_critique_aware_v6.py \ |
| --planner_host http://localhost:8100 \ |
| --val_sel_host http://localhost:8101 \ |
| --val_cond_host http://localhost:8104 \ |
| --K 8 --temperature 1.0 --max_questions -1 --seed 42 \ |
| --out data/hf_fixer_critique_aware_v6 \ |
| 2>&1 | tee -a "$LOG.build" |
|
|
| echo "[$(date)] === DONE ===" | tee -a "$LOG" |
| ls -la data/hf_fixer_critique_aware_v6/ 2>&1 | tee -a "$LOG" |
| kill_vllm |
|
|