From 7468253065c8339947c30c7c3dfd154aea1059a9 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Fri, 7 May 2021 12:49:53 +0800 Subject: [PATCH] model_benchmark (#32600) --- tools/test_model_benchmark.sh | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/tools/test_model_benchmark.sh b/tools/test_model_benchmark.sh index 720bb334790..5ec71ef8c11 100644 --- a/tools/test_model_benchmark.sh +++ b/tools/test_model_benchmark.sh @@ -15,6 +15,31 @@ # limitations under the License. +function check_whl { + bash -x paddle/scripts/paddle_build.sh build + [ $? -ne 0 ] && echo "build paddle failed." && exit 1 + pip uninstall -y paddlepaddle_gpu + pip install build/python/dist/*.whl + [ $? -ne 0 ] && echo "install paddle failed." && exit 1 + + mkdir -p /tmp/pr && mkdir -p /tmp/develop + unzip -q build/python/dist/*.whl -d /tmp/pr + + git checkout . + git checkout -b develop_base_pr upstream/$BRANCH + cd build + make -j `nproc` + unzip -q python/dist/*.whl -d /tmp/develop + + sed -i '/version.py/d' /tmp/pr/*/RECORD + sed -i '/version.py/d' /tmp/develop/*/RECORD + diff_whl=`diff /tmp/pr/*/RECORD /tmp/develop/*/RECORD|wc -l` + if [ ${diff_whl} -eq 0 ];then + echo "paddle whl does not diff in PR-CI-Model-benchmark, so skip this ci" + exit 0 + fi +} + function compile_install_paddle { export CUDA_ARCH_NAME=Auto export PY_VERSION=3.7 @@ -23,11 +48,7 @@ function compile_install_paddle { export WITH_TENSORRT=OFF export WITH_TESTING=OFF export WITH_UNITY_BUILD=ON - bash -x paddle/scripts/paddle_build.sh build - [ $? -ne 0 ] && echo "build paddle failed." && exit 1 - pip uninstall -y paddlepaddle_gpu - pip install build/python/dist/paddlepaddle_gpu-0.0.0-cp37-cp37m-linux_x86_64.whl - [ $? -ne 0 ] && echo "install paddle failed." && exit 1 + check_whl } function prepare_data { -- GitLab