run.sh 461 字节
Newer Older
Z
Ziyan 已提交
1 2
#!/bin/bash

3 4
EXEC_PATH=$(pwd)
export MINDSPORE_HCCL_CONFIG_PATH=${EXEC_PATH}/rank_table.json
Z
Ziyan 已提交
5
export RANK_SIZE=8
6

Z
Ziyan 已提交
7 8 9 10
for((i=0;i<$RANK_SIZE;i++))
do
    rm -rf device$i
    mkdir device$i
11
    cp ./resnet50_distributed_training.py ./resnet.py ./device$i
Z
Ziyan 已提交
12 13
    cd ./device$i
    export DEVICE_ID=$i
14
    export RANK_ID=$i
Z
Ziyan 已提交
15 16 17 18 19
    echo "start training for device $i"
    env > env$i.log
    pytest -s -v ./resnet50_distributed_training.py > train.log$i 2>&1 &
    cd ../
done