Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multi-node to the training process to both dist_train.sh and slurm_train.sh #273

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion segmentation/dist_train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

CONFIG=$1
GPUS=$2
NODES=$3
PORT=${PORT:-29300}

PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \
python -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT \
python -m torch.distributed.launch --nproc_per_node=$GPUS --nnodes=$NODES --master_port=$PORT \
$(dirname "$0")/train.py $CONFIG --launcher pytorch ${@:3}
2 changes: 2 additions & 0 deletions segmentation/slurm_train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ PARTITION=$1
JOB_NAME=$2
CONFIG=$3
GPUS=${GPUS:-8}
NUM_NODE=$4
GPUS_PER_NODE=${GPUS_PER_NODE:-8}
CPUS_PER_TASK=${CPUS_PER_TASK:-5}
SRUN_ARGS=${SRUN_ARGS:-""}
Expand All @@ -16,6 +17,7 @@ srun -p ${PARTITION} \
--job-name=${JOB_NAME} \
--gres=gpu:${GPUS_PER_NODE} \
--ntasks=${GPUS} \
--nnodes=${NUM_NODE}
--ntasks-per-node=${GPUS_PER_NODE} \
--cpus-per-task=${CPUS_PER_TASK} \
--quotatype=spot \
Expand Down