File size: 1,635 Bytes
23c39b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#SBATCH --job-name=hrm-eval-bench
#SBATCH --account=nemotron_agents_dev
#SBATCH --partition=interactive
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --gpus-per-node=8
#SBATCH --time=04:00:00
#SBATCH --output=/lustre/fsw/portfolios/nemotron/users/hengyuf/HRM-Text/slurm/logs/%x_%j.out

# Non-blocking (sbatch) form of slurm/eval.sh, so that a watcher can fire
# benchmark evaluations without holding a foreground srun.
#
#   CKPT=checkpoints/HRM-Text/<run> [CKPT_EPOCH=N] [RUN_ONLY=[GSM8k]] \
#     sbatch --export=ALL slurm/eval_bench.sbatch
#
# Cluster quirks (do not simplify): NVIDIA_VISIBLE_DEVICES must be set OUTSIDE
# srun (enroot injects the driver at container creation) and HF_HOME must be
# re-exported INSIDE the container (an enroot hook overwrites it).
set -euo pipefail

BASE=/lustre/fsw/portfolios/nemotron/users/hengyuf
HRM_DIR=$BASE/HRM-Text
CKPT=${CKPT:?set CKPT=checkpoints/HRM-Text/<run>}
GPUS=${GPUS:-8}

ARGS="ckpt_path=$CKPT"
if [ -n "${CKPT_EPOCH:-}" ]; then ARGS="$ARGS ckpt_epoch=$CKPT_EPOCH"; fi
if [ -n "${RUN_ONLY:-}" ]; then ARGS="$ARGS run_only=$RUN_ONLY"; fi
if [ -n "${SAVE_GENERATIONS:-}" ]; then ARGS="$ARGS save_generations=true"; fi
ARGS="$ARGS ${EXTRA:-}"

export NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all}
echo "benchmark eval: $ARGS"

srun --container-image="$BASE/hrm_env/hrm-text.sqsh" \
     --container-mounts=/lustre:/lustre \
     --container-workdir="$HRM_DIR" \
     bash -c "export HF_HOME=$BASE/.cache/huggingface HF_HUB_ENABLE_HF_TRANSFER=0 OMP_NUM_THREADS=1
              torchrun --standalone --nproc_per_node=$GPUS slurm/eval_bench_multi.py $ARGS"