From 0316223a14df62e34a1b0e25220172d279018fd5 Mon Sep 17 00:00:00 2001 From: GaoWei8 <53294385+GaoWei8@users.noreply.github.com> Date: Thu, 12 Dec 2019 16:00:41 +0800 Subject: [PATCH] ci check for op test accuracy (#21508) * ci_check test=develop test=document_fix * test error test=develop test=document_fix * check another op accuracy ci test=develop test=document_fix * converge to one if test=develop test=document_fix * remove test case test=develop test=document_fix * simplify ci check test=develop test=document_fix * remove test case test=develop test=document_fix * optimize ci check test=develop test=document_fix * optimize ci check test=develop test=document_fix * remove test case test=develop test=document_fix --- tools/check_api_approvals.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/check_api_approvals.sh b/tools/check_api_approvals.sh index 340d81c218f..7ece89e912e 100644 --- a/tools/check_api_approvals.sh +++ b/tools/check_api_approvals.sh @@ -163,6 +163,21 @@ if [ "${HAS_INPLACE_TESTS}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then check_approval 1 46782768 47554610 43953930 6836917 fi +NEW_OP_TEST_ADDED=`git diff --name-only --diff-filter=AMR upstream/$BRANCH |grep -oE "test_.*.\.py" || true` +if [ "${NEW_OP_TEST_ADDED}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then + CHECK_OUTPUT=`git diff -U5 --diff-filter=AMR upstream/$BRANCH |grep "self\.check_output(a*t*o*l*=*[0-9]"|grep "+" || true` + CHECK_OUTPUT_WITH_PLACE=`git diff -U5 --diff-filter=AMR upstream/$BRANCH |grep -A2 "self\.check_output_with_place" |grep "[a-z]*, [0-9e]*"|grep "+" || true` + CHECK_GRAD=`git diff -U5 --diff-filter=AMR upstream/$BRANCH |grep -A5 -E "self\.check_grad|self\.check_grad_with_place"|grep "max_relative_error=" |grep "+" || true` + CHECK_GRAD_CHECK=`git diff -U5 --diff-filter=AMR upstream/$BRANCH |grep -A2 -E "checker\.double_grad_check"|grep "eps=|atol=|rtol=" |grep "+" || true` + CHECK_WHOLE=$CHECK_OUTPUT$CHECK_OUTPUT_WITH_PLACE$CHECK_GRAD$CHECK_GRAD_CHECK + if [ "${CHECK_WHOLE}" != "" ] ; then + CHECK_OP=${CHECK_WHOLE//+/'\n+'} + echo_line="Please use the default precision parameters of 'atol, rtol, eps, max_relative_error'. If you don't use the default value, you must have one RD (Xreki (Recommend), luotao1, lanxianghit or phlrain) approval for the usage of other values. The detailed information is in the link: https://github.cor/PaddlePaddle/Paddle/wiki/OP-test-accuracy-requirements. The error line is ${CHECK_OP}\n" + check_approval 1 6836917 47554610 12538138 43953930 + fi +fi + + if [ -n "${echo_list}" ];then echo "****************" echo -e "${echo_list[@]}" -- GitLab