From 9c624b16d5aa4c938fc7bd81a3e51d5f76f5226b Mon Sep 17 00:00:00 2001 From: gongweibao Date: Tue, 16 Mar 2021 11:24:53 +0800 Subject: [PATCH] Extend unittest time of (#31570) --- python/paddle/fluid/tests/book/CMakeLists.txt | 2 +- .../tests/unittests/test_fleet_launch_ps.sh | 36 +++++++++---------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/python/paddle/fluid/tests/book/CMakeLists.txt b/python/paddle/fluid/tests/book/CMakeLists.txt index 6f71730246..09c650f16e 100644 --- a/python/paddle/fluid/tests/book/CMakeLists.txt +++ b/python/paddle/fluid/tests/book/CMakeLists.txt @@ -9,7 +9,7 @@ endforeach() set_tests_properties(test_word2vec_book PROPERTIES TIMEOUT 120) set_tests_properties(test_recognize_digits PROPERTIES TIMEOUT 120) set_tests_properties(test_image_classification PROPERTIES TIMEOUT 200) -set_tests_properties(test_label_semantic_roles PROPERTIES TIMEOUT 120) +set_tests_properties(test_label_semantic_roles PROPERTIES TIMEOUT 240) set_tests_properties(test_machine_translation PROPERTIES TIMEOUT 120) set_tests_properties(test_rnn_encoder_decoder PROPERTIES TIMEOUT 120) set_tests_properties(test_fit_a_line PROPERTIES TIMEOUT 120) diff --git a/python/paddle/fluid/tests/unittests/test_fleet_launch_ps.sh b/python/paddle/fluid/tests/unittests/test_fleet_launch_ps.sh index 21875851bf..67a8d7e575 100644 --- a/python/paddle/fluid/tests/unittests/test_fleet_launch_ps.sh +++ b/python/paddle/fluid/tests/unittests/test_fleet_launch_ps.sh @@ -16,27 +16,19 @@ set -e -function test_launch_ps(){ - server_port_0=${PADDLE_DIST_UT_PORT} - server_port_1=$(( PADDLE_DIST_UT_PORT + 1 )) - echo "server_port_0:${server_port_0} server_port_1=${server_port_1}" - python -m paddle.distributed.fleet.launch --server_num=2 --worker_num=2 fleet_ps_training.py 2> ut.elog - if grep -q "server are killed" ut.elog; then - echo "test pserver launch succeed" - else - echo "test pserver launch failed" - exit -1 - fi +server_port_0=${PADDLE_DIST_UT_PORT} +server_port_1=$(( PADDLE_DIST_UT_PORT + 1 )) +worker_port_0=$(( PADDLE_DIST_UT_PORT + 2 )) +worker_port_1=$(( PADDLE_DIST_UT_PORT + 3 )) +heter_worker_port_0=$(( PADDLE_DIST_UT_PORT + 4 )) +heter_worker_port_1=$(( PADDLE_DIST_UT_PORT + 5 )) - python -m paddle.distributed.fleet.launch --servers="127.0.0.1:${server_port_0},127.0.0.1:${server_port_1}" --workers="127.0.0.1:6782,127.0.0.1:6783" fleet_ps_training.py 2> ut.elog - if grep -q "server are killed" ut.elog; then - echo "test pserver launch succeed" - else - echo "test pserver launch failed" - exit -1 - fi +function test_launch_ps(){ - python -m paddle.distributed.fleet.launch --servers="127.0.0.1:${server_port_0},127.0.0.1:${server_port_1}" --workers="127.0.0.1,127.0.0.1" fleet_ps_training.py 2> ut.elog + python -m paddle.distributed.fleet.launch \ + --servers="127.0.0.1:${server_port_0},127.0.0.1:${server_port_1}" \ + --workers="127.0.0.1:${worker_port_0},127.0.0.1:${worker_port_1}" \ + fleet_ps_training.py 2> ut.elog if grep -q "server are killed" ut.elog; then echo "test pserver launch succeed" else @@ -46,7 +38,11 @@ function test_launch_ps(){ } function test_launch_ps_heter(){ - python -m paddle.distributed.fleet.launch --server_num=2 --worker_num=2 --heter_worker_num=2 fleet_ps_training.py 2> ut.elog + python -m paddle.distributed.fleet.launch \ + --servers="127.0.0.1:${server_port_0},127.0.0.1:${server_port_1}" \ + --workers="127.0.0.1:${worker_port_0},127.0.0.1:${worker_port_1}" \ + --heter_workers="127.0.0.1:${heter_worker_port_0},127.0.0.1:${heter_worker_port_1}" \ + fleet_ps_training.py 2> ut.elog if grep -q "server are killed" ut.elog; then echo "test heter pserver launch succeed" else -- GitLab