Skip to content

Commit

Permalink
[cherry-pick] use the required instruction to determine if the envir…
Browse files Browse the repository at this point in the history
…onment fits the sample code's required. (#32766) (#33451)

1 put a instruction # required: gpu(for example) in the sample code
2 this piece of code will only run in the GPU-equipped CI pipelines, and be omitted in other pipelines.
3 the CI pipelines can specify its capacity by shell environment variable SAMPLE_CODE_TEST_CAPACITY

2.1 文档改版方案

see #32766 for more infomation
  • Loading branch information
wadefelix authored Jun 11, 2021
1 parent 61cae0d commit f57ae4d
Show file tree
Hide file tree
Showing 4 changed files with 661 additions and 745 deletions.
15 changes: 7 additions & 8 deletions tools/check_file_diff_approvals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ API_FILES=("CMakeLists.txt"
"python/paddle/fluid/tests/unittests/white_list/op_threshold_white_list.py"
"python/paddle/fluid/tests/unittests/white_list/check_op_sequence_batch_1_input_white_list.py"
"python/paddle/fluid/tests/unittests/white_list/no_grad_set_white_list.py"
"tools/wlist.json"
"tools/print_signatures.py"
"tools/sampcd_processor.py"
"paddle/scripts/paddle_build.bat"
"tools/windows/run_unittests.sh"
Expand Down Expand Up @@ -80,11 +80,10 @@ function add_failed(){
echo_list="${echo_list[@]}$1"
}

function run_test_sampcd_processor() {
function run_tools_test() {
CUR_PWD=$(pwd)
cd ${PADDLE_ROOT}/tools
python test_sampcd_processor.py
python test_print_signatures.py
python $1
cd ${CUR_PWD}
}

Expand Down Expand Up @@ -141,12 +140,12 @@ for API_FILE in ${API_FILES[*]}; do
elif [ "${API_FILE}" == "python/paddle/fluid/tests/unittests/white_list/no_grad_set_white_list.py" ];then
echo_line="You must have one RD (Shixiaowei02 (Recommend), luotao1 or phlrain) approval for the python/paddle/fluid/tests/unittests/white_list/no_grad_set_white_list.py, which manages the white list of no_grad_set without value in operators. For more information, please refer to[https://github.com/PaddlePaddle/Paddle/wiki/It's-recommend-to-set-no_grad_set-to-be-None].\n"
check_approval 1 39303645 6836917 43953930
elif [ "${API_FILE}" == "tools/wlist.json" ];then
echo_line="You must have one TPM (jzhang533) approval for the api whitelist for the tools/wlist.json.\n"
check_approval 1 29231
elif [ "${API_FILE}" == "tools/sampcd_processor.py" ];then
echo_line="test_sampcd_processor.py will be executed for changed sampcd_processor.py.\n"
run_test_sampcd_processor
run_tools_test test_sampcd_processor.py
elif [ "${API_FILE}" == "tools/print_signatures.py" ];then
echo_line="test_print_signatures.py will be executed for changed print_signatures.py.\n"
run_tools_test test_print_signatures.py
elif [ "${API_FILE}" == "python/paddle/distributed/fleet/__init__.py" ]; then
echo_line="You must have (fuyinno4 (Recommend), raindrops2sea) approval for ${API_FILE} changes"
check_approval 1 35824027 38231817
Expand Down
Loading

0 comments on commit f57ae4d

Please sign in to comment.