dist_launch.sh 681 B

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