Urdatorn commited on
Commit
03cd9a8
·
verified ·
1 Parent(s): 7691a46

Add final training job (best search config, seeds 1-3)

Browse files
Files changed (1) hide show
  1. slurm/final.slurm +47 -0
slurm/final.slurm ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #SBATCH --job-name=macron-final
3
+ #SBATCH --account=naiss2026-3-353-gpu
4
+ #SBATCH --partition=gpu
5
+ #SBATCH --nodes=1
6
+ #SBATCH --ntasks=1
7
+ #SBATCH --cpus-per-task=8
8
+ #SBATCH --gpus=1
9
+ #SBATCH --mem=64G
10
+ #SBATCH --time=05:00:00
11
+ #SBATCH --array=1-3
12
+ #SBATCH --output=logs/%x-%A_%a.out
13
+ #SBATCH --error=logs/%x-%A_%a.out
14
+
15
+ # Final models: the best config of the Optuna search (runs/hpo/best.json, trial 12:
16
+ # lr 2.2273846302530813e-3, weight decay 0.1701622357313687, dropout 0.0), one model
17
+ # per seed (array index = seed 1, 2, 3). 30 epochs, one-cycle schedule, patience 8,
18
+ # checkpoint selection on Norma validation mixed accuracy. Each model is then scored
19
+ # on Norma test and validation.
20
+
21
+ set -Eeuo pipefail
22
+ trap 'status=$?; printf "[%s] ERROR line=%s command=%q status=%s\n" "$(date --iso-8601=seconds)" "$LINENO" "$BASH_COMMAND" "$status"; exit "$status"' ERR
23
+
24
+ repo=/nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code
25
+ seed=$SLURM_ARRAY_TASK_ID
26
+ out="$repo/runs/final/seed$seed"
27
+ cd "$repo"
28
+ mkdir -p logs "$out"
29
+ stamp() { printf '[%s] %s\n' "$(date --iso-8601=seconds)" "$*"; }
30
+
31
+ stamp "job_start array=${SLURM_ARRAY_JOB_ID}_${seed} host=$(hostname) out=$out"
32
+ module purge
33
+ module load GPU/Python/3.13.5-bare-gcc-2025b-eb
34
+ nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
35
+ export PYTHONUNBUFFERED=1
36
+ export HF_HUB_CACHE="$repo/.cache/hf"
37
+ export HF_HUB_DISABLE_PROGRESS_BARS=1
38
+ py="$repo/.venv/bin/python"
39
+ [[ -f cache/oga-no-norma/meta.json ]] || { stamp "missing cache/oga-no-norma (run slurm/prepare.slurm)"; exit 1; }
40
+
41
+ "$py" train.py --cache cache/oga-no-norma --output_dir "$out" --seed "$seed" \
42
+ --lr 0.0022273846302530813 --weight_decay 0.1701622357313687 --dropout 0.0 \
43
+ --epochs 30 --patience 8 --select_metric norma_val_acc
44
+
45
+ stamp "scoring $out/best on Norma"
46
+ "$py" evaluate.py --models "$out/best" --splits test validation --out "$out/eval"
47
+ stamp "job_complete"