Download scripts/r5_vlma/leader_continue.sbatch from treoa/turkic-ocr-code: direct link, hf CLI and curl.
- Browser
- Download file 2.55 kB
-
https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_vlma/leader_continue.sbatch
- Command line
-
hf download hf://treoa/turkic-ocr-code/scripts/r5_vlma/leader_continue.sbatch
-
curl -L -o leader_continue.sbatch https://huggingface.co/treoa/turkic-ocr-code/resolve/main/scripts/r5_vlma/leader_continue.sbatch
2.55 kB
| #!/bin/bash | |
| #SBATCH --job-name=r5_leader | |
| #SBATCH --partition=H100 | |
| #SBATCH --qos=nu-h100 | |
| #SBATCH --gres=gpu:h100:1 | |
| #SBATCH --cpus-per-task=16 | |
| #SBATCH --mem=96G | |
| #SBATCH --time=11:00:00 | |
| #SBATCH --signal=B:TERM@300 | |
| #SBATCH --output=/path/to/TURKIC_OCR_DATA/logs/%x_%j.out | |
| # SUPERSEDED on 2026-11-21 ~00:05 UTC by amendment 3.3 D2 (two seeds per leader, equal P_lead): use leader_runner.py | |
| # (lead_V.sbatch on slot V; any other slot runs leader_runner.py with its own config). Kept only as a record. | |
| # R5 leader continuation (amendment 3.2 C4) for ONE natively loadable VLM arm on any slot, outside the slot V runner. | |
| # Continues from DATA/checkpoints/r5/<arm>/short_state (weights and AdamW moments), sequence rows from 150,000 on | |
| # (identical data for both leaders), new 3% warm-up + cosine over EXTRA samples at the arm's own LR, then validation. | |
| # usage: sbatch --time=HH:MM:00 leader_continue.sbatch SHORT ARM EXTRA_SAMPLES TRAIN_DEADLINE_UTC EVAL_DEADLINE_UTC | |
| # e.g. sbatch --time=10:30:00 leader_continue.sbatch glm_ocr glm_ocr 600000 2026-11-22T18:10:00Z 2026-11-22T18:55:00Z | |
| # Set --time so the job ends before 22 Nov 19:00 UTC; the deadlines stop training and validation in any case. | |
| set -u | |
| SHORT=$1; ARM=$2; N=$3; TDL=$4; EDL=$5 | |
| CODE=/path/to/TURKIC_OCR_CODE | |
| DATA=/path/to/TURKIC_OCR_DATA | |
| S=$CODE/scripts/r5_vlma | |
| export HF_HUB_OFFLINE=1 TOKENIZERS_PARALLELISM=false | |
| unset HF_TOKEN HUGGING_FACE_HUB_TOKEN || true | |
| PY="$CODE/.venv_vlm/bin/python -I" | |
| SEQ=$DATA/data/processed/r5/seq/mix_v1_seq.tsv | |
| echo "job $SLURM_JOB_ID on $(hostname) $(date -u +%FT%TZ) leader $ARM ($SHORT) extra $N train until $TDL" | |
| nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv | |
| [ -f $SEQ.done ] || { echo "sequence not ready"; exit 2; } | |
| [ -d $DATA/checkpoints/r5/$ARM/short_state ] || { echo "no short state for $ARM"; exit 2; } | |
| $PY $S/train_vlm.py --short $SHORT --arm $ARM --registry $S/models_r5.tsv --models-dir $DATA/hf_cache/j2_models \ | |
| --seq $SEQ --ckpt-root $DATA/checkpoints/r5 --out-root $DATA/outputs/r5/vlma/runs --phase long --start-row 150000 \ | |
| --n-samples $N --init-state $DATA/checkpoints/r5/$ARM/short_state --init-optimizer --cap-hours 100 --deadline-utc $TDL & | |
| PID=$! | |
| trap 'kill -TERM $PID; wait $PID' TERM | |
| wait $PID | |
| $PY $S/eval_vlm.py --short $SHORT --arm $ARM --ckpt long --model-dir $DATA/checkpoints/r5/$ARM/long --registry $S/models_r5.tsv \ | |
| --evalsets $DATA/data/processed/r5/evalsets.json --preds-root $DATA/outputs/r5/preds --batch 16 --deadline-utc $EDL & | |
| PID=$! | |
| wait $PID | |
| echo "[r5_leader] end $(date -u +%FT%TZ)" | |