未验证 提交 00ea0b2f 编写于 作者: Z zyfncg 提交者: GitHub

Add CI check for script of auto code-gen (#47814)

* add ci check for code-gen script

* update
上级 8e65ac5d
...@@ -2411,7 +2411,6 @@ class DygraphForwardAndNodesGenerator(GeneratorBase): ...@@ -2411,7 +2411,6 @@ class DygraphForwardAndNodesGenerator(GeneratorBase):
def GenerateCode(self): def GenerateCode(self):
forward_api_list = self.forward_api_list forward_api_list = self.forward_api_list
grad_api_dict = self.grad_api_dict
forward_apis_dict = {} forward_apis_dict = {}
for api_item in forward_api_list: for api_item in forward_api_list:
forward_apis_dict[api_item['op']] = api_item forward_apis_dict[api_item['op']] = api_item
......
...@@ -90,6 +90,7 @@ def replace_compat_name(op_op_map, forward_op_dict, backward_op_dict): ...@@ -90,6 +90,7 @@ def replace_compat_name(op_op_map, forward_op_dict, backward_op_dict):
backward_op_item = backward_op_dict[forward_op_item['backward']] backward_op_item = backward_op_dict[forward_op_item['backward']]
if new_op_name != op_name: if new_op_name != op_name:
forward_op_item['op_name'] = op_name forward_op_item['op_name'] = op_name
if 'backward' in op_args and has_backward: if 'backward' in op_args and has_backward:
backward_op_list = op_args['backward'].split(',') backward_op_list = op_args['backward'].split(',')
_, bw_op_name = get_op_and_op_name(backward_op_list[0]) _, bw_op_name = get_op_and_op_name(backward_op_list[0])
......
...@@ -776,7 +776,7 @@ with redirect_stdout(): ...@@ -776,7 +776,7 @@ with redirect_stdout():
project_urls = { project_urls = {
'Homepage': 'https://www.paddlepaddle.org.cn/', 'Homepage': 'https://www.paddlepaddle.org.cn/',
'Downloads': 'https://github.com/paddlepaddle/paddle' 'Downloads': 'https://github.com/paddlepaddle/paddle'
}, },
license='Apache Software License', license='Apache Software License',
packages=packages, packages=packages,
install_requires=setup_requires, install_requires=setup_requires,
......
...@@ -272,6 +272,30 @@ if [ "${HAS_MODIFIED_API_COMPAT_YAML}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then ...@@ -272,6 +272,30 @@ if [ "${HAS_MODIFIED_API_COMPAT_YAML}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
check_approval 1 chenwhql zyfncg check_approval 1 chenwhql zyfncg
fi fi
HAS_MODIFIED_API_GENE=`git diff --name-only upstream/$BRANCH | grep "paddle/phi/api/yaml/generator" || true`
if [ "${HAS_MODIFIED_API_GENE}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
echo_line="You must have one RD (zyfncg, chenwhql, YuanRisheng, phlrain) approval for file changes in paddle/phi/api/yaml/generator, which manages the generated code for C++ API in paddle/phi/api/lib/api.cc.\n"
check_approval 1 zyfncg chenwhql YuanRisheng phlrain
fi
HAS_MODIFIED_EAGER_GENE=`git diff --name-only upstream/$BRANCH | grep "paddle/fluid/eager/auto_code_generator" || true`
if [ "${HAS_MODIFIED_EAGER_GENE}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
echo_line="You must have one RD (JiabinYang, chenwhql, zyfncg, phlrain) approval for file changes in paddle/fluid/eager/auto_code_generator, which manages the generated code for dygraph functions in paddle/fluid/eager/api/generated.\n"
check_approval 1 JiabinYang chenwhql zyfncg phlrain
fi
HAS_MODIFIED_OPERATOR_GENE=`git diff --name-only upstream/$BRANCH | grep "paddle/fluid/operators/generator" || true`
if [ "${HAS_MODIFIED_OPERATOR_GENE}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
echo_line="You must have one RD (zyfncg, chenwhql, iclementine, phlrain) approval for file changes in paddle/fluid/operators/generator, which manages the generated code for OpMaker in paddle/fluid/operators/(generated_op.cc | sparse_generated_op.cc)\n"
check_approval 1 zyfncg chenwhql iclementine phlrain
fi
HAS_MODIFIED_SETUP_IN=`git diff --name-only upstream/$BRANCH | grep "python/setup.py.in" || true`
if [ "${HAS_MODIFIED_SETUP_IN}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
echo_line="You must have one RD (chenwhql, zyfncg, YuanRisheng, phlrain) approval for file changes in python/setup.py.in, which manages the header files that can be used from outside of framework.\n"
check_approval 1 chenwhql zyfncg YuanRisheng phlrain
fi
ALL_PADDLE_ENFORCE=`git diff -U0 upstream/$BRANCH |grep "^+" |grep -zoE "PADDLE_ENFORCE\(.[^,\);]+.[^;]*\);\s" || true` ALL_PADDLE_ENFORCE=`git diff -U0 upstream/$BRANCH |grep "^+" |grep -zoE "PADDLE_ENFORCE\(.[^,\);]+.[^;]*\);\s" || true`
if [ "${ALL_PADDLE_ENFORCE}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then if [ "${ALL_PADDLE_ENFORCE}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then
echo_line="PADDLE_ENFORCE is not recommended. Please use PADDLE_ENFORCE_EQ/NE/GT/GE/LT/LE or PADDLE_ENFORCE_NOT_NULL or PADDLE_ENFORCE_GPU_SUCCESS instead, see [ https://github.com/PaddlePaddle/Paddle/wiki/PADDLE_ENFORCE-Rewriting-Specification ] for details.\nYou must have one RD (chenwhql (Recommend), luotao1 (Recommend) or lanxianghit) approval for the usage (either add or delete) of PADDLE_ENFORCE.\n${ALL_PADDLE_ENFORCE}\n" echo_line="PADDLE_ENFORCE is not recommended. Please use PADDLE_ENFORCE_EQ/NE/GT/GE/LT/LE or PADDLE_ENFORCE_NOT_NULL or PADDLE_ENFORCE_GPU_SUCCESS instead, see [ https://github.com/PaddlePaddle/Paddle/wiki/PADDLE_ENFORCE-Rewriting-Specification ] for details.\nYou must have one RD (chenwhql (Recommend), luotao1 (Recommend) or lanxianghit) approval for the usage (either add or delete) of PADDLE_ENFORCE.\n${ALL_PADDLE_ENFORCE}\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册