File size: 1,192 Bytes
0cef53c
 
2f04f23
0cef53c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b40da9
 
0cef53c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Train CONFIG on one GPU, then evaluate its best epoch on the test split.
#   sbatch -A <account> --export=ALL,SEED=1 scripts/train.sh [key=value ...]
# The paper's ensembles vary only the seed (SEED=1..5). Prepare the event
# cache first: uv run gnn4colliders prepare configs/gamgam.yaml
#SBATCH -N 1
#SBATCH -C gpu
#SBATCH -q shared
#SBATCH -G 1
#SBATCH -c 32
#SBATCH -t 06:00:00
#SBATCH -o logs/train_%j.out

set -euo pipefail
cd "${SLURM_SUBMIT_DIR:-$(pwd)}"
CONFIG="${CONFIG:-configs/gamgam.yaml}"
SEED="${SEED:-42}"
RUN="${RUN:-outputs/$(basename "${CONFIG}" .yaml)/seed${SEED}}"
# PyTorch otherwise sizes CPU thread pools to every core on the node.
export OMP_NUM_THREADS="${OMP_NUM_THREADS:-8}"
# Home-directory file locks are unavailable on Perlmutter compute nodes.
export UV_CACHE_DIR="${UV_CACHE_DIR:-${SCRATCH:-${HOME}/.cache}/uv}"
# Hugging Face downloads (the Delphes samples are 52 GB) go to scratch too.
export HF_HOME="${HF_HOME:-${SCRATCH:-${HOME}/.cache}/huggingface}"
mkdir -p logs
args=("${CONFIG}" run_dir="${RUN}" train.seed="${SEED}" data.seed="${SEED}" "$@")
uv run gnn4colliders train "${args[@]}"
uv run gnn4colliders evaluate "${args[@]}" split=test