dist_launch.sh 652 B

123456789101112131415161718192021
  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. GPUS=$3
  14. PORT=${PORT:-29500}
  15. PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \
  16. python -m torch.distributed.launch --nproc_per_node=$GPUS --master_port=$PORT \
  17. $SCRIPT --cfg $CONFIG ${@:4}