dist_mn_launch.sh 1010 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. # -------------------------------------------------------------------------
  3. # Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
  4. #
  5. # NVIDIA CORPORATION & AFFILIATES and its licensors retain all intellectual
  6. # property and proprietary rights in and to this software, related
  7. # documentation and any modifications thereto. Any use, reproduction,
  8. # disclosure or distribution of this software and related documentation
  9. # without an express license agreement from NVIDIA CORPORATION is strictly
  10. # prohibited.
  11. #
  12. # Written by Jiarui Xu
  13. # -------------------------------------------------------------------------
  14. SCRIPT=$1
  15. CONFIG=$2
  16. NODE_RNAK=$3
  17. NODES=$4
  18. GPUS_PER_NODE=$5
  19. MASTER_ADDR=$6
  20. PORT=${PORT:-29500}
  21. PYTHONPATH="$(dirname $0)/..":$PYTHONPATH OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 \
  22. python -m torch.distributed.launch --nproc_per_node=$GPUS_PER_NODE \
  23. --nnodes=$NODES --node_rank=$NODE_RNAK \
  24. --master_addr=$MASTER_ADDR \
  25. $SCRIPT --cfg $CONFIG ${@:7}