diff --git a/python/paddle/fluid/tests/unittests/op_test.py b/python/paddle/fluid/tests/unittests/op_test.py index 8ab0f9b825a520e3eda81afb40c89669980a44ee..5006a8cf3b8cd45bcc7f56dbe3d2d5d9649c77ee 100644 --- a/python/paddle/fluid/tests/unittests/op_test.py +++ b/python/paddle/fluid/tests/unittests/op_test.py @@ -1118,8 +1118,7 @@ class OpTest(unittest.TestCase): no_check_set=None, equal_nan=False, check_dygraph=True, - inplace_atol=None, - check_compile_vs_runtime=True): + inplace_atol=None): self.__class__.op_type = self.op_type if hasattr(self, "use_mkldnn"): self.__class__.use_mkldnn = self.use_mkldnn @@ -1131,9 +1130,7 @@ class OpTest(unittest.TestCase): outs, dygraph_outs, fetch_list = res else: outs, fetch_list = res - if check_compile_vs_runtime and ( - self.op_type not in - compile_vs_runtime_white_list.COMPILE_RUN_OP_WHITE_LIST): + if self.op_type not in compile_vs_runtime_white_list.COMPILE_RUN_OP_WHITE_LIST: self.check_compile_vs_runtime(fetch_list, outs) def check_output_customized(self, checker): diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_pad_op.py b/python/paddle/fluid/tests/unittests/sequence/test_sequence_pad_op.py index a710fc5ce8b28e869c83c3bc8fe7733e51ae0e59..83c28edd23509714cc31fa5d5eff48ce28613e37 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_pad_op.py +++ b/python/paddle/fluid/tests/unittests/sequence/test_sequence_pad_op.py @@ -74,7 +74,7 @@ class TestSequencePadOp(OpTest): self.compute() def test_check_output(self): - self.check_output(check_compile_vs_runtime=True, check_dygraph=False) + self.check_output(check_dygraph=False) def test_check_grad(self): self.check_grad(["X"], "Out", check_dygraph=False) diff --git a/python/paddle/fluid/tests/unittests/sequence/test_sequence_unpad_op.py b/python/paddle/fluid/tests/unittests/sequence/test_sequence_unpad_op.py index a37f7b58ee50ff08e93f1a7a3ddc8f1fbf0ac6c0..458088b4f5bf44431d2271b20dd1c94d5a16c109 100644 --- a/python/paddle/fluid/tests/unittests/sequence/test_sequence_unpad_op.py +++ b/python/paddle/fluid/tests/unittests/sequence/test_sequence_unpad_op.py @@ -50,7 +50,7 @@ class TestSequenceUnpadOp(OpTest): self.compute() def test_check_output(self): - self.check_output(check_compile_vs_runtime=True, check_dygraph=False) + self.check_output(check_dygraph=False) def test_check_grad(self): self.check_grad(["X"], "Out", check_dygraph=False) diff --git a/python/paddle/fluid/tests/unittests/test_match_matrix_tensor_op.py b/python/paddle/fluid/tests/unittests/test_match_matrix_tensor_op.py index e8acd1cd3ba56c058bab65b5ab9bd69542124f76..9306b76689887acb5accc6df93e40bf98f5d00ca 100644 --- a/python/paddle/fluid/tests/unittests/test_match_matrix_tensor_op.py +++ b/python/paddle/fluid/tests/unittests/test_match_matrix_tensor_op.py @@ -71,7 +71,7 @@ class TestMatchMatrixTensorOp(OpTest): self.outputs = {'Out': (out, out_lod), 'Tmp': tmp} def test_check_output(self): - self.check_output(check_compile_vs_runtime=True, check_dygraph=False) + self.check_output(check_dygraph=False) def test_check_grad(self): self.check_grad(['X', 'Y'], 'Out', check_dygraph=False) diff --git a/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py b/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py index c7184633f1dba80937e443d48745ddcdcf2a3e0b..1958e90ad129626e7fe8b7424871e4000ca8ac80 100644 --- a/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py +++ b/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py @@ -15,7 +15,9 @@ # If the output after infershape() is a lod_tensor, commenly its lod_level # should be equal during compile time and run time. # For ops in this whitelist, the equality check of lod_level between -# compiletime&runtime will not be required. +# compiletime&runtime will be skipped. Ops in this whitelist need to declear +# reasons for skipping compile_vs_runtime test or be fixed later. + COMPILE_RUN_OP_WHITE_LIST = [ 'lod_reset', 'sequence_pool', 'sequence_slice', 'generate_mask_labels', 'sequence_reshape', 'generate_proposals', 'mine_hard_examples', diff --git a/tools/check_api_approvals.sh b/tools/check_api_approvals.sh index d78950970a1567dbca0a519c0276008946572a39..49db061700d0e680beb27f87b89b97c5251fcd04 100644 --- a/tools/check_api_approvals.sh +++ b/tools/check_api_approvals.sh @@ -29,6 +29,7 @@ API_FILES=("CMakeLists.txt" "paddle/fluid/framework/unused_var_check.cc" "python/paddle/fluid/tests/unittests/white_list/check_shape_white_list.py" "python/paddle/fluid/tests/unittests/white_list/op_accuracy_white_list.py" + "python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py" "python/paddle/fluid/tests/unittests/white_list/no_check_set_white_list.py" ) @@ -115,6 +116,9 @@ for API_FILE in ${API_FILES[*]}; do elif [ "${API_FILE}" == "python/paddle/fluid/tests/unittests/white_list/op_accuracy_white_list.py" ];then echo_line="You must have one RD (juncaipeng (Recommend), zhangting2020 (Recommend) or luotao1) approval for the python/paddle/fluid/tests/unittests/white_list/op_accuracy_white_list.py, which manages the white list of upgrading the precision of op test to float64. For more information, please refer to: https://github.com/PaddlePaddle/Paddle/wiki/Upgrade-OP-Precision-to-Float64. \n" check_approval 1 52520497 26615455 6836917 + elif [ "${API_FILE}" == "python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py" ];then + echo_line="You must have one RD (DannyIsFunny (Recommend), luotao1, phlrain) approval for the python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py, which manages the white list of compile&runtime lod-level check. For more information, please refer to: https://github.com/PaddlePaddle/Paddle/wiki/Compile_vs_Runtime-Check-Specification. \n" + check_approval 1 45189361 6836917 43953930 elif [ "${API_FILE}" == "python/paddle/fluid/tests/unittests/white_list/no_check_set_white_list.py" ];then echo_line="You must have one RD (cryoco (Recommend), luotao1 or phlrain) approval for the python/paddle/fluid/tests/unittests/white_list/no_check_set_white_list.py, which manages the white list of setting no_check_set of check_output. \n" check_approval 1 12407750 26615455 6836917 @@ -179,13 +183,6 @@ if [ "${HAS_INPLACE_TESTS}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then check_approval 1 46782768 47554610 43953930 6836917 fi -HAS_COMPILERUNTIME_NOT_TEST=`git diff -U0 --diff-filter=A upstream/$BRANCH |grep "+" |grep -E "check_output[(]*check_compile_vs_runtime=False" || true` -if [ "${HAS_COMPILERUNTIME_NOT_TEST}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then - echo_line="If the operator's output after infershape() is a LodTensor, the output's Lod-Level during compile-time and runtime must be equal. Please set check_compile_vs_runtime=True in op_test.check_output function to enable compile&runtime lod-level check.\n -If you do not need check_compile_vs_runtime, you must have one RD (lanxianghit, phlrain, luotao1) approval.\nThe corresponding lines are as follows:\n${HAS_COMPILERUNTIME_NOT_TEST}\n" - check_approval 1 47554610 43953930 6836917 -fi - OP_FILE_CHANGED=`git diff --name-only --diff-filter=AMR upstream/$BRANCH |grep -oE ".+_op..*" || true` if [ "${OP_FILE_CHANGED}" != "" ] && [ "${GIT_PR_ID}" != "" ]; then for OP_FILE in ${OP_FILE_CHANGED};