slurm_test_mgpu.sh 432 Bytes
Newer Older
Gus-Guo's avatar
Gus-Guo committed
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash

set -x

PARTITION=$1
GPUS=$2
GPUS_PER_NODE=$GPUS
PY_ARGS=${@:3}
JOB_NAME=eval
SRUN_ARGS=${SRUN_ARGS:-""}

12
13
PORT=$(( ( RANDOM % 10000 )  + 10000 ))

Gus-Guo's avatar
Gus-Guo committed
14
15
16
17
18
19
20
srun -p ${PARTITION} \
    --job-name=${JOB_NAME} \
    --gres=gpu:${GPUS_PER_NODE} \
    --ntasks=${GPUS} \
    --ntasks-per-node=${GPUS_PER_NODE} \
    --kill-on-bad-exit=1 \
    ${SRUN_ARGS} \
21
    python -u test.py --launcher slurm ${PY_ARGS} --tcp_port $PORT
Gus-Guo's avatar
Gus-Guo committed
22