Skip to content

Commit e69b905

Browse files
committed
add CI check for white list, test=develop
1 parent 7aff856 commit e69b905

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

paddle/fluid/framework/unused_var_check.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void CheckUnusedVar(const OperatorBase &op) {
6464
err_msg += ", ";
6565
}
6666
err_msg += "please remove it from inputs or register NoNeedBufferVars!";
67-
LOG(ERROR) << err_msg;
67+
VLOG(1) << err_msg;
6868
}
6969
}
7070

paddle/scripts/paddle_build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,11 @@ EOF
436436
fi
437437

438438
# TODO: jiabin need to refine this part when these tests fixed on mac
439-
ctest --output-on-failure -j $2
440-
439+
# ctest --output-on-failure -j $2
440+
# NOTE(cql): output logs of LOG(ERROR) to check unused vars.
441+
export FLAGS_enable_unused_var_check=1
442+
export GLOG_vmodule=unused_var_check=2
443+
ctest -VV -j $2 -O log.txt
441444
paddle version
442445
fi
443446
}

tools/check_api_approvals.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ API_FILES=("CMakeLists.txt"
2525
"python/paddle/fluid/parallel_executor.py"
2626
"python/paddle/fluid/framework.py"
2727
"python/paddle/fluid/backward.py"
28-
"paddle/fluid/operators/distributed/send_recv.proto.in")
28+
"paddle/fluid/operators/distributed/send_recv.proto.in"
29+
"tools/generate_op_use_unused_inputs_white_list.py")
2930

3031
approval_line=`curl -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/PaddlePaddle/Paddle/pulls/${GIT_PR_ID}/reviews?per_page=10000`
3132
git_files=`git diff --numstat upstream/$BRANCH| wc -l`
@@ -67,7 +68,7 @@ for API_FILE in ${API_FILES[*]}; do
6768
echo "checking ${API_FILE} change, PR: ${GIT_PR_ID}, changes: ${API_CHANGE}"
6869
if [ "${API_CHANGE}" ] && [ "${GIT_PR_ID}" != "" ]; then
6970
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.
70-
# approval_user_list: XiaoguangHu01 46782768,Xreki 12538138,luotao1 6836917,sneaxiy 32832641,qingqing01 7845005,guoshengCS 14105589,heavengate 12605721,kuke 3064195,Superjomn 328693,lanxianghit 47554610,cyj1986 39645414,hutuxian 11195205,frankwhzhang 20274488,nepeplwu 45024560,Dianhai 38231817,JiabinYang 22361972,chenwhql 22561442,seiriosPlus 5442383,gongweibao 10721757,saxon-zh 2870059,Boyan-Liu 2870059.
71+
# approval_user_list: XiaoguangHu01 46782768,Xreki 12538138,luotao1 6836917,sneaxiy 32832641,qingqing01 7845005,guoshengCS 14105589,heavengate 12605721,kuke 3064195,Superjomn 328693,lanxianghit 47554610,cyj1986 39645414,hutuxian 11195205,frankwhzhang 20274488,nepeplwu 45024560,Dianhai 38231817,JiabinYang 22361972,chenwhql 22561442,zhiqiu 6888866,seiriosPlus 5442383,gongweibao 10721757,saxon-zh 2870059,Boyan-Liu 2870059.
7172
if [ "${API_FILE}" == "paddle/fluid/op_use_default_grad_op_maker.spec" ];then
7273
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 32832641 6836917`
7374
elif [ "${API_FILE}" == "CMakeLists.txt" ];then
@@ -78,6 +79,8 @@ for API_FILE in ${API_FILES[*]}; do
7879
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 6836917 22361972`
7980
elif [ "${API_FILE}" == "paddle/fluid/operators/distributed/send_recv.proto.in" ];then
8081
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 10721757 5442383`
82+
elif [ "${API_FILE}" == "tools/generate_op_use_unused_inputs_white_list.py" ];then
83+
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 6888866 32832641 6836917`
8184
else
8285
APPROVALS=`echo ${approval_line}|python ${PADDLE_ROOT}/tools/check_pr_approval.py 1 3048612 46782768 12538138 6836917 32832641`
8386
fi
@@ -103,6 +106,10 @@ for API_FILE in ${API_FILES[*]}; do
103106
failed_num=`expr $failed_num + 1`
104107
echo_line="You must have one RD (gongweibao or seiriosPlus) approval for the paddle/fluid/operators/distributed/send_recv.proto.in, which manages the environment variables.\n"
105108
echo_list=(${echo_list[@]}$failed_num "." $echo_line)
109+
elif [ "${API_FILE}" == "tools/generate_op_use_unused_inputs_white_list.py" ];then
110+
failed_num=`expr $failed_num + 1`
111+
echo_line="You must have one RD (zhiqiu (Recommend) , sneaxiy or luotao1) approval for the tools/generate_op_use_unused_inputs_white_list.py, which manages the white list of oerators that have unused input variables.\n"
112+
echo_list=(${echo_list[@]}$failed_num "." $echo_line)
106113
else
107114
failed_num=`expr $failed_num + 1`
108115
echo_line="You must have one RD (XiaoguangHu01,Xreki,luotao1,sneaxiy) approval for ${API_FILE}, which manages the underlying code for fluid.\n"

0 commit comments

Comments
 (0)