Created by: liym27
https://github.com/PaddlePaddle/Paddle/pull/21522
used for CI check
1. add interface to get default value of attributes
m.def("get_op_attrs_default_value", [](py::bytes byte_name)
-> paddle::framework::AttributeMap{...}
2. add file check_op_desc.py to print op desc information and compare op desc
https://github.com/PaddlePaddle/Paddle/pull/21613 move get_all_ops_desc from check_op_desc.py to print_op_desc.py
(1) Print all ops desc in dict
run
python check_op_desc.py > OP_DESC_DEV.spec
to get ops desc of branch developrun python check_op_desc.py > OP_DESC_PR.spec
to get ops desc of branch PR
after #21613 :
run python print_op_desc.py > OP_DESC_DEV.spec
to get ops desc of branch develop~~
run python print_op_desc.py > OP_DESC_PR.spec
to get ops desc of branch PR~~
(2) Compare op_desc files generated by branch develop and branch PR and print error message.
run python check_op_desc.py OP_DESC_DEV.spec OP_DESC_PR.spec > error_message
after #21613 :
run python print_op_desc.py OP_DESC_DEV.spec OP_DESC_PR.spec
3. The following are non conformances
If the modification of op from branch PR conforms to the specification, the error_message is empty. The modification of Ops will cause that the new version inference fails to load model trained by the old version.
-
for ops changed in branch PR:
- add Input/Output but it's not dispensable
- delele Input/Output
- modify Input/Output including duplicable, intermediate or dispensable
- add Attr but its default value is not set
- delele Attr
- modify Attr including the type, default value or generated
-
for ops deleted in branch PR:
- No comparison
-
for new ops only added in branch PR:
- No comparison