-
Notifications
You must be signed in to change notification settings - Fork 8
/
submit_pm.sh
executable file
·41 lines (35 loc) · 1.1 KB
/
submit_pm.sh
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 -C gpu
#SBATCH -q shared
#SBATCH -A ntrain4
#SBATCH --cpus-per-task 32
#SBATCH --gpus-per-task 1
#SBATCH --gpu-bind none
#SBATCH --time=01:00:00
#SBATCH --image=nersc/pytorch:ngc-23.07-v0
#SBATCH --module=gpu,nccl-2.18
#SBATCH --reservation=sc23_dl_tutorial_1
#SBATCH -J vit-era5
#SBATCH -o %x-%j.out
DATADIR=/pscratch/sd/s/shas1693/data/sc23_tutorial_data/downsampled
LOGDIR=${SCRATCH}/sc23-dl-tutorial/logs
mkdir -p ${LOGDIR}
args="${@}"
export FI_MR_CACHE_MONITOR=userfaultfd
export HDF5_USE_FILE_LOCKING=FALSE
# Profiling
if [ "${ENABLE_PROFILING:-0}" -eq 1 ]; then
echo "Enabling profiling..."
NSYS_ARGS="--trace=cuda,cublas,nvtx --kill none -c cudaProfilerApi -f true"
NSYS_OUTPUT=${LOGDIR}/${PROFILE_OUTPUT:-"profile"}
export PROFILE_CMD="nsys profile $NSYS_ARGS -o $NSYS_OUTPUT"
fi
export MASTER_ADDR=$(hostname)
# Reversing order of GPUs to match default CPU affinities from Slurm
export CUDA_VISIBLE_DEVICES=3,2,1,0
set -x
srun -u shifter -V ${DATADIR}:/data -V ${LOGDIR}:/logs \
bash -c "
source export_DDP_vars.sh
${PROFILE_CMD} python train.py ${args}
"