#!/usr/bin/env bash # Copyright (c) OpenMMLab. All rights reserved. set -x PARTITION=$1 JOB_NAME=$2 CONFIG=$3 WORK_DIR=$4 GPUS=$5 GPUS_PER_NODE=$((${GPUS}<8?${GPUS}:8)) CPUS_PER_TASK=${CPUS_PER_TASK:-2} SRUN_ARGS=${SRUN_ARGS:-""} PY_ARGS=${@:6} PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \ srun -p ${PARTITION} \ --job-name=${JOB_NAME} \ --gres=gpu:${GPUS_PER_NODE} \ --ntasks=${GPUS} \ --ntasks-per-node=${GPUS_PER_NODE} \ --cpus-per-task=${CPUS_PER_TASK} \ --kill-on-bad-exit=1 \ -w SG-IDC2-10-51-5-49 \ ${SRUN_ARGS} \ python -u tools/train.py ${CONFIG} --work-dir=${WORK_DIR} --launcher="slurm" ${PY_ARGS}