From d34c286c9029dc2ae31dbefb55921a3b2de51b13 Mon Sep 17 00:00:00 2001 From: iducn Date: Wed, 7 Apr 2021 09:48:26 +0800 Subject: [PATCH 1/4] print build summary --- paddle/scripts/paddle_build.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 7516e4c99ea90f..d180f9c333ac8b 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -404,7 +404,7 @@ EOF tar -czf paddle_inference.tgz paddle_inference buildSize=$(du -h --max-depth=0 ${PADDLE_ROOT}/build/paddle_inference.tgz |awk '{print $1}') echo "Paddle_Inference Size: $buildSize" - echo "ipipe_log_param_Paddle_Inference_Size: $buildSize" + echo "ipipe_log_param_Paddle_Inference_Size: $buildSize" >> ${PADDLE_ROOT}/build/build_summary.txt else SYSTEM=`uname -s` if [ "$SYSTEM" == "Darwin" ]; then @@ -414,10 +414,10 @@ EOF fi buildSize=$($com ${PADDLE_ROOT}/build |awk '{print $1}') echo "Build Size: $buildSize" - echo "ipipe_log_param_Build_Size: $buildSize" + echo "ipipe_log_param_Build_Size: $buildSize" >> ${PADDLE_ROOT}/build/build_summary.txt PR_whlSize=$($com ${PADDLE_ROOT}/build/python/dist |awk '{print $1}') echo "PR whl Size: $PR_whlSize" - echo "ipipe_log_param_PR_whl_Size: $PR_whlSize" + echo "ipipe_log_param_PR_whl_Size: $PR_whlSize" >> ${PADDLE_ROOT}/build/build_summary.txt fi } @@ -442,7 +442,7 @@ function cmake_gen_and_build() { build $2 endTime_s=`date +%s` echo "Build Time: $[ $endTime_s - $startTime_s ]s" - echo "ipipe_log_param_Build_Time: $[ $endTime_s - $startTime_s ]s" + echo "ipipe_log_param_Build_Time: $[ $endTime_s - $startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt } function build_mac() { @@ -480,7 +480,7 @@ function cmake_gen_and_build_mac() { build_mac endTime_s=`date +%s` echo "Build Time: $[ $endTime_s - $startTime_s ]s" - echo "ipipe_log_param_Build_Time: $[ $endTime_s - $startTime_s ]s" + echo "ipipe_log_param_Build_Time: $[ $endTime_s - $startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt } function run_test() { @@ -684,7 +684,7 @@ EOF #mactest_error=$? ut_endTime_s=`date +%s` echo "Mac testCase Time: $[ $ut_endTime_s - $ut_startTime_s ]s" - echo "ipipe_log_param_Mac_TestCases_Time: $[ $ut_endTime_s - $ut_startTime_s ]s" + echo "ipipe_log_param_Mac_TestCases_Time: $[ $ut_endTime_s - $ut_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt paddle version # Recovery proxy to avoid failure in later steps set +x @@ -993,10 +993,10 @@ EOF num=$(echo $testcases|grep -o '\^'|wc -l) if (( $2 == -1 )); then echo "exclusive TestCases count is $num" - echo "ipipe_log_param_Exclusive_TestCases_Count: $num" + echo "ipipe_log_param_Exclusive_TestCases_Count: $num" >> ${PADDLE_ROOT}/build/build_summary.txt else echo "$2 card TestCases count is $num" - echo "ipipe_log_param_${2}_Cards_TestCases_Count: $num" + echo "ipipe_log_param_${2}_Cards_TestCases_Count: $num" >> ${PADDLE_ROOT}/build/build_summary.txt fi } @@ -1098,10 +1098,10 @@ function card_test() { ut_endTime_s=`date +%s` if (( $2 == -1 )); then echo "exclusive TestCases Total Time: $[ $ut_endTime_s - $ut_startTime_s ]s" - echo "ipipe_log_param_Exclusive_TestCases_Total_Time: $[ $ut_endTime_s - $ut_startTime_s ]s" + echo "ipipe_log_param_Exclusive_TestCases_Total_Time: $[ $ut_endTime_s - $ut_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt else echo "$2 card TestCases Total Time: $[ $ut_endTime_s - $ut_startTime_s ]s" - echo "ipipe_log_param_${2}_Cards_TestCases_Total_Time: $[ $ut_endTime_s - $ut_startTime_s ]s" + echo "ipipe_log_param_${2}_Cards_TestCases_Total_Time: $[ $ut_endTime_s - $ut_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt fi set +m } @@ -1448,7 +1448,7 @@ function parallel_test() { fi ut_total_endTime_s=`date +%s` echo "TestCases Total Time: $[ $ut_total_endTime_s - $ut_total_startTime_s ]s" - echo "ipipe_log_param_TestCases_Total_Time: $[ $ut_total_endTime_s - $ut_total_startTime_s ]s" + echo "ipipe_log_param_TestCases_Total_Time: $[ $ut_total_endTime_s - $ut_total_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt } function enable_unused_var_check() { @@ -1728,7 +1728,7 @@ EOF fi endTime_s=`date +%s` echo "Build Time: $[ $endTime_s - $startTime_s ]s" - echo "ipipe_log_param_Build_Time: $[ $endTime_s - $startTime_s ]s" + echo "ipipe_log_param_Build_Time: $[ $endTime_s - $startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt build_size "paddle_inference" } @@ -1760,7 +1760,7 @@ EOF EXIT_CODE=$? fluid_endTime_s=`date +%s` echo "test_fluid_lib Total Time: $[ $fluid_endTime_s - $fluid_startTime_s ]s" - echo "ipipe_log_param_Test_Fluid_Lib_Total_Time: $[ $fluid_endTime_s - $fluid_startTime_s ]s" + echo "ipipe_log_param_Test_Fluid_Lib_Total_Time: $[ $fluid_endTime_s - $fluid_startTime_s ]s" >> ${PADDLE_ROOT}/build/build_summary.txt ./clean.sh if [[ "$EXIT_CODE" != "0" ]]; then exit 8; @@ -1807,7 +1807,7 @@ function example() { function collect_ccache_hits() { rate=$(ccache -s | grep 'cache hit rate' | awk '{print $4}') echo "ccache hit rate: ${rate}%" - echo "ipipe_log_param_Ccache_Hit_Rate: ${rate}%" + echo "ipipe_log_param_Ccache_Hit_Rate: ${rate}%" >> ${PADDLE_ROOT}/build/build_summary.txt } From e3917ee0ac25dbd37743fc6fd7797ba8e501d7fd Mon Sep 17 00:00:00 2001 From: iducn Date: Wed, 7 Apr 2021 09:55:38 +0800 Subject: [PATCH 2/4] print build summary --- paddle/scripts/paddle_build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index d180f9c333ac8b..343d2e88da6e05 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2029,6 +2029,7 @@ function main() { exit 1 ;; esac + cat ${PADDLE_ROOT}/build/build_summary.txt echo "paddle_build script finished as expected" } From 3230dba4cd8cb952022c44dda390c3f3558fac3d Mon Sep 17 00:00:00 2001 From: iducn Date: Wed, 7 Apr 2021 10:16:08 +0800 Subject: [PATCH 3/4] print build summary --- paddle/scripts/paddle_build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 343d2e88da6e05..6fea69372bf2dd 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2029,7 +2029,10 @@ function main() { exit 1 ;; esac + set +x + echo "=====================build summary======================" cat ${PADDLE_ROOT}/build/build_summary.txt + echo "========================================================" echo "paddle_build script finished as expected" } From 9efcb6c87b4ce8a1e481d3ccb58e33c815377123 Mon Sep 17 00:00:00 2001 From: iducn Date: Wed, 7 Apr 2021 10:28:55 +0800 Subject: [PATCH 4/4] print build summary --- paddle/scripts/paddle_build.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 6fea69372bf2dd..2df9e0198ee49f 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2030,9 +2030,11 @@ function main() { ;; esac set +x - echo "=====================build summary======================" - cat ${PADDLE_ROOT}/build/build_summary.txt - echo "========================================================" + if [[ -f ${PADDLE_ROOT}/build/build_summary.txt ]];then + echo "=====================build summary======================" + cat ${PADDLE_ROOT}/build/build_summary.txt + echo "========================================================" + fi echo "paddle_build script finished as expected" }