diff --git a/tools/test_model_benchmark.sh b/tools/test_model_benchmark.sh index 720bb334790697d1b7dd56409a4b591354c6b4ef..5ec71ef8c114d35c4d41832221967298bc0c217f 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 {