From 5eefc8c7a71ef615320fb2e9ff969d2aa433cf50 Mon Sep 17 00:00:00 2001 From: Qi Li Date: Wed, 1 Sep 2021 15:24:46 +0800 Subject: [PATCH] [NPU] skip NPU UT if no npu files changed, test=develop (#35338) --- paddle/scripts/paddle_build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 9e8fcd3ae82..05635630443 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -1702,6 +1702,15 @@ set -x } function parallel_test_base_npu() { + # skipping if no NPU related files changed + if [ ${SKIL_NPU_TEST:-ON} == "ON" ] ; then + npu_cc_files=$(git diff --name-only ${BRANCH} | grep "op_npu.cc" | wc -l) + npu_py_files=$(git diff --name-only ${BRANCH} | grep "python/paddle/fluid/tests/unittests/npu" | wc -l) + if [ "${npu_cc_files}" -eq 0 ] && [ "${npu_py_files}" -eq 0 ] ; then + echo "NO NPU operators files changed, skip NPU unit tests" + exit 0 + fi + fi mkdir -p ${PADDLE_ROOT}/build cd ${PADDLE_ROOT}/build/python/paddle/fluid/tests/unittests/npu if [ ${WITH_TESTING:-ON} == "ON" ] ; then -- GitLab