Skip to content

Commit

Permalink
Add CI for checking registered data_type of new Op (PaddlePaddle#21488)
Browse files Browse the repository at this point in the history
* add data_type register CI test=develop

* add op add test case test=develop

* add test case for register op kernel test=develop

* fix shell script bug test=develop

* fix checkout branch test=develop

* remove test case code test=develop

* fix op_type.spec name test=develop
  • Loading branch information
Aurelius84 authored and seiriosPlus committed Dec 9, 2019
1 parent 4f0b131 commit 42c97a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion paddle/scripts/paddle_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,11 @@ function generate_api_spec() {
source .${spec_kind}_env/bin/activate
pip install ${PADDLE_ROOT}/build/python/dist/*whl

spec_path=${PADDLE_ROOT}/paddle/fluid/API_${spec_kind}.spec
spec_path=${PADDLE_ROOT}/paddle/fluid/API_${spec_kind}.spec
python ${PADDLE_ROOT}/tools/print_signatures.py paddle.fluid > $spec_path
# used to log op_register data_type
op_type_path=${PADDLE_ROOT}/paddle/fluid/OP_TYPE_${spec_kind}.spec
python ${PADDLE_ROOT}/tools/check_op_register_type.py > $op_type_path
awk -F '(' '{print $NF}' $spec_path >${spec_path}.doc
awk -F '(' '{$NF="";print $0}' $spec_path >${spec_path}.api
if [ "$1" == "cp35-cp35m" ] || [ "$1" == "cp36-cp36m" ] || [ "$1" == "cp37-cp37m" ]; then
Expand Down
10 changes: 8 additions & 2 deletions tools/check_api_approvals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,18 @@ if [ "$api_doc_spec_diff" != "" ]; then
check_approval 1 31623103 2870059
fi

op_type_spec_diff=`python ${PADDLE_ROOT}/tools/check_op_register_type.py ${PADDLE_ROOT}/paddle/fluid/OP_TYPE_DEV.spec ${PADDLE_ROOT}/paddle/fluid/OP_TYPE_PR.spec`
if [ "$op_type_spec_diff" != "" ]; then
echo_line="More data_type of new operator should be regitered in your PR. Please make sure that both float/double (or int/int64_t) have been regitered. You must have one RD (Aurelius84 or liym27 or zhhsplendid)approval for the data_type registration of new operator.\n"
check_approval 1 9301846 33742067 7913861
fi

for API_FILE in ${API_FILES[*]}; do
API_CHANGE=`git diff --name-only upstream/$BRANCH | grep "${API_FILE}" | grep -v "/CMakeLists.txt" || true`
echo "checking ${API_FILE} change, PR: ${GIT_PR_ID}, changes: ${API_CHANGE}"
if [ "${API_CHANGE}" ] && [ "${GIT_PR_ID}" != "" ]; then
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.
# 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.
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.q
# 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, Aurelius84 9301846, liym27 33742067, zhhsplendid 7913861.
if [ "${API_FILE}" == "paddle/fluid/op_use_default_grad_op_maker.spec" ];then
echo_line="You must have one RD (sneaxiy (Recommend) or luotao1) approval for op_use_default_grad_op_maker.spec, which manages the grad_op memory optimization.\n"
check_approval 1 32832641 6836917
Expand Down Expand Up @@ -150,6 +155,7 @@ if [ -n "${echo_list}" ];then
fi

python ${PADDLE_ROOT}/tools/diff_api.py ${PADDLE_ROOT}/paddle/fluid/API_DEV.spec ${PADDLE_ROOT}/paddle/fluid/API_PR.spec
python ${PADDLE_ROOT}/tools/check_op_register_type.py ${PADDLE_ROOT}/paddle/fluid/OP_TYPE_DEV.spec ${PADDLE_ROOT}/paddle/fluid/OP_TYPE_PR.spec

if [ -n "${echo_list}" ]; then
exit 1
Expand Down

0 comments on commit 42c97a4

Please sign in to comment.