Skip to content

Commit

Permalink
Try to fix test_model.sh (#5361)
Browse files Browse the repository at this point in the history
Summary:
Trying to fix failures such as https://github.com/pytorch/executorch/actions/runs/10855583772/job/30128512970

For the time missing operator error is repro'ed on my Mac, I see cmake-out/ was not cleaned up and merged.yaml was missing linear.out because it was super old.

Now without deep understanding of how CI job workers cache previous runs, I'm refactoring `build_cmake_executor_runner` in test_model.sh to make sure it always build clean.

Pull Request resolved: #5361

Reviewed By: swolchok

Differential Revision: D62665029

Pulled By: larryliu0820

fbshipit-source-id: 9c15c6581079b544084ae53979c995bc83cc46f9
  • Loading branch information
larryliu0820 authored and facebook-github-bot committed Sep 13, 2024
1 parent 62024d8 commit bfce743
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .ci/scripts/test_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,21 @@ prepare_artifacts_upload() {

build_cmake_executor_runner() {
echo "Building executor_runner"
(rm -rf ${CMAKE_OUTPUT_DIR} \
&& mkdir ${CMAKE_OUTPUT_DIR} \
&& cd ${CMAKE_OUTPUT_DIR} \
&& retry cmake -DCMAKE_BUILD_TYPE=Release \
rm -rf ${CMAKE_OUTPUT_DIR}
cmake -DCMAKE_BUILD_TYPE=Debug \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-B${CMAKE_OUTPUT_DIR} .

cmake --build ${CMAKE_OUTPUT_DIR} -j4
cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug
}

run_portable_executor_runner() {
# Run test model
if [[ "${BUILD_TOOL}" == "buck2" ]]; then
buck2 run //examples/portable/executor_runner:executor_runner -- --model_path "./${MODEL_NAME}.pte"
elif [[ "${BUILD_TOOL}" == "cmake" ]]; then
if [[ ! -f ${CMAKE_OUTPUT_DIR}/executor_runner ]]; then
build_cmake_executor_runner
fi
build_cmake_executor_runner
./${CMAKE_OUTPUT_DIR}/executor_runner --model_path "./${MODEL_NAME}.pte"
else
echo "Invalid build tool ${BUILD_TOOL}. Only buck2 and cmake are supported atm"
Expand Down

0 comments on commit bfce743

Please sign in to comment.