2021-04-03 01:03:52 +08:00
|
|
|
|
2022-08-04 15:25:54 +08:00
|
|
|
#!/usr/bin/env bash
|
2021-04-03 01:03:52 +08:00
|
|
|
|
|
|
|
CONFIG=$1
|
2022-08-04 15:25:54 +08:00
|
|
|
GPUS=$2
|
2022-03-22 16:25:39 +08:00
|
|
|
NNODES=${NNODES:-1}
|
|
|
|
NODE_RANK=${NODE_RANK:-0}
|
2021-04-03 01:03:52 +08:00
|
|
|
PORT=${PORT:-29500}
|
2022-03-22 16:25:39 +08:00
|
|
|
MASTER_ADDR=${MASTER_ADDR:-"127.0.0.1"}
|
2021-04-03 01:03:52 +08:00
|
|
|
|
|
|
|
PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \
|
2022-08-04 15:25:54 +08:00
|
|
|
python -m torch.distributed.launch \
|
|
|
|
--nnodes=$NNODES \
|
|
|
|
--node_rank=$NODE_RANK \
|
|
|
|
--master_addr=$MASTER_ADDR \
|
|
|
|
--nproc_per_node=$GPUS \
|
|
|
|
--master_port=$PORT \
|
|
|
|
$(dirname "$0")/train.py \
|
|
|
|
$CONFIG \
|
|
|
|
--launcher pytorch ${@:3}
|