test_launch.sh 870 字节
Newer Older
G
gongweibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#!/bin/bash
set -e

# use default values
python -m paddle.distributed.launch multi_process.py

# use specified values
cluster_node_ips="127.0.0.1"
node_ip="127.0.0.1"

distributed_args="--cluster_node_ips ${cluster_node_ips} --node_ip ${node_ip} --selected_gpus=0,1"
python -m paddle.distributed.launch ${distributed_args} multi_process.py

str1="selected_gpus:0 worker_endpoints:['127.0.0.1:6170', '127.0.0.1:6171'] trainers_num:2 current_endpoint:127.0.0.1:6170 trainer_id:0"
str2="selected_gpus:1 worker_endpoints:['127.0.0.1:6170', '127.0.0.1:6171'] trainers_num:2 current_endpoint:127.0.0.1:6171 trainer_id:1"
file="multi_process.check.log"

if ! grep -q "$str1" "$file"; then
    echo "find trainer 0"
else
    echo "not find trainer 0"
    exit -1
fi

if ! grep -q "$str2" "$file"; then
    echo "find trainer 1"
else
    echo "not find trainer 0"
    exit -1
fi