Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOT][ci] add check file run #58051

Merged
merged 22 commits into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions paddle/scripts/paddle_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,53 @@ set -ex
fi
}

function check_run_sot_ci() {
set +x
# use "git commit -m 'message, test=sot'" to force ci to run
COMMIT_RUN_CI=$(git log -1 --pretty=format:"%s" | grep -w "test=sot" || true)
# check pr title
TITLE_RUN_CI=$(curl -s https://github.com/PaddlePaddle/Paddle/pull/${GIT_PR_ID} | grep "<title>" | grep -i "sot" || true)
if [[ ${COMMIT_RUN_CI} || ${TITLE_RUN_CI} ]]; then
set -x
return
fi

# git diff
SOT_FILE_LIST=(
paddle/fluid/operators/run_program_op.h
paddle/fluid/operators/run_program_op.cu
paddle/fluid/operators/run_program_op.cc
paddle/fluid/eager/to_static
paddle/fluid/pybind/
python/
test/sot
)

run_sot_ut="OFF"
for change_file in $(git diff --name-only upstream/develop);
do
for sot_file in ${SOT_FILE_LIST[@]};
do
if [[ ${change_file} =~ ^"${sot_file}".* ]]; then
echo "Detect change about SOT: "
echo "Changes related to the sot code were detected: " ${change_file}
run_sot_ut="ON"
break
fi
done
if [[ "ON" == ${run_sot_ut} ]]; then
break
fi
done

if [[ "OFF" == ${run_sot_ut} ]]; then
echo "No SOT-related changes were found"
echo "Skip SOT UT CI"
exit 0
fi
set -x
}

function run_sot_test() {
PY_VERSION=$1
PYTHON_WITH_SPECIFY_VERSION=python$PY_VERSION
Expand Down Expand Up @@ -4125,6 +4172,7 @@ function main() {
run_linux_cpu_test ${PYTHON_ABI:-""} ${PROC_RUN:-1}
;;
cicheck_sot)
check_run_sot_ci
export WITH_SHARED_PHI=ON
PYTHON_VERSIONS=(3.8 3.9 3.10 3.11)
for PY_VERSION in ${PYTHON_VERSIONS[@]}; do
Expand Down