Skip to content

Compile_vs_Runtime Check Specification(English)

huzhiqiang edited this page Feb 6, 2020 · 3 revisions

OP Test Specification:Compile_vs_runtime Check is required for Op test


单测规范:Op单测必须通过“编译时/运行时一致性检查”


Specification summary::

  • Section 1, Background
  • Section 2, Details of The Specification
  • Section 3, Instructions of CI
  • Section 4, Suggestions Of Check Failure
  • Section 5, Verify Meeting the Specification

Supplementary Note:

You may find some aspects that are not taken into account in the existing specifications, which need to be continuously supplemented and improved during the implementation process. Please feel free to give your feedback.

1. Background

Each op will execute infershape() twice in compile time and runtime. In order to ensure the consistency of information, the compile_vs_runtime check method is added to the op test in this specification. At present, it mainly checks whether the lod_level of compile time and runtime is consistent when the output is lodsensor. In this specification, incremental check is added to CI. Except for special cases, each op’s unit test can not skip compile_vs_runtime check.

2. Details of The Specification

In Op's unit test, all cases that inherit OpTest need to call the compile_vs_runtime check method automatically.

special cases

You can exempt it by describing the reason for skipping compile_vs_runtime check and add it to whitelist COMPILE_RUN_OP_WHITE_LIST. White list location: python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py

3. Instructions of CI

  • When the white list file compile_vs_runtime_white_list.py is modified, CI incremental detection will be triggered, you need to describe the reason for skipping compile_vs_runtime check and ask for specific personnel to review

4. Suggestions Of Check Failure

When the check fails, you can modify unit test by referring to the following suggestions:

  • Lod level need to be set in Op->InferShape().Please refer to pr.

5. Verify Meeting the Specification

If you encounter other problems, please contact @DannyIsFunny

Clone this wiki locally