-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Enhance] Add
dist_train_arm.sh
for ARM device and update NPU resul…
…ts. (#1218) * update npu results * add dist_train_arm.sh & updata docs * del content
- Loading branch information
1 parent
0eb3b61
commit 578c035
Showing
2 changed files
with
79 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
CONFIG=$1 | ||
GPUS=$2 | ||
NNODES=${NNODES:-1} | ||
NODE_RANK=${NODE_RANK:-0} | ||
PORT=${PORT:-29500} | ||
MASTER_ADDR=${MASTER_ADDR:-"127.0.0.1"} | ||
|
||
export PYTHONPATH="$(dirname $0)/..":$PYTHONPATH | ||
|
||
# launch core setting | ||
KERNEL_NUM=$(($(nproc)/GPUS)) | ||
|
||
# dist env setting | ||
export WORLD_SIZE=$((NNODES*GPUS)) | ||
export MASTER_ADDR=$MASTER_ADDR | ||
export MASTER_PORT=$PORT | ||
LOCAL_RANK_START=$((NODE_RANK*GPUS)) | ||
LOCAL_RANK_END=$((LOCAL_RANK_START+GPUS)) | ||
|
||
for((RANK_ID=LOCAL_RANK_START;RANK_ID<LOCAL_RANK_END;RANK_ID++)) | ||
do | ||
export RANK=$RANK_ID | ||
PID_START=$((KERNEL_NUM*(RANK_ID%GPUS))) | ||
PID_END=$((PID_START+KERNEL_NUM-1)) | ||
nohup taskset -c $PID_START-$PID_END \ | ||
python $(dirname "$0")/train.py \ | ||
$CONFIG \ | ||
--launcher pytorch ${@:3} \ | ||
& | ||
done |