dist_mn_launch.sh 798 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env bash
  2. # -------------------------------------------------------------------------
  3. # Copyright (c) 2021-2022, NVIDIA Corporation & Affiliates. All rights reserved.
  4. #
  5. # This work is made available under the Nvidia Source Code License.
  6. # To view a copy of this license, visit
  7. # https://github.com/NVlabs/GroupViT/blob/main/LICENSE
  8. #
  9. # Written by Jiarui Xu
  10. # -------------------------------------------------------------------------
  11. SCRIPT=$1
  12. CONFIG=$2
  13. NODE_RNAK=$3
  14. NODES=$4
  15. GPUS_PER_NODE=$5
  16. MASTER_ADDR=$6
  17. PORT=${PORT:-29500}
  18. PYTHONPATH="$(dirname $0)/..":$PYTHONPATH OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 \
  19. python -m torch.distributed.launch --nproc_per_node=$GPUS_PER_NODE \
  20. --nnodes=$NODES --node_rank=$NODE_RNAK \
  21. --master_addr=$MASTER_ADDR \
  22. $SCRIPT --cfg $CONFIG ${@:7}