forked from open-mmlab/OpenPCDet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfixed: solve the issue of blocking with dist_train.sh, automatical…
…ly search tcp ports (open-mmlab#815) * bugfixed: stuck when training with dist_train.sh, support tcp_port * bugfixed: solve the issue of blocking with dist_train.sh, automatically search tcp ports
- Loading branch information
1 parent
a5cf2a5
commit e1bfcec
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
NGPUS=$1 | ||
PY_ARGS=${@:2} | ||
|
||
while true | ||
do | ||
PORT=$(( ((RANDOM<<15)|RANDOM) % 49152 + 10000 )) | ||
status="$(nc -z 127.0.0.1 $PORT < /dev/null &>/dev/null; echo $?)" | ||
if [ "${status}" != "0" ]; then | ||
break; | ||
fi | ||
done | ||
echo $PORT | ||
|
||
torchrun --nproc_per_node=${NGPUS} --rdzv_endpoint=localhost:${PORT} train.py --launcher pytorch ${PY_ARGS} | ||
|