@@ -18,8 +18,8 @@ concurrency:
1818 cancel-in-progress : true
1919
2020jobs :
21- test-models-macos :
22- name : test-models-macos
21+ test-models-macos-cpu :
22+ name : test-models-macos-cpu
2323 uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
2424 strategy :
2525 matrix :
@@ -242,12 +242,12 @@ jobs:
242242 setup_script_args=""
243243 if [[ ${{ matrix.os}} == "bare_metal" ]]; then
244244 toolchain_prefix=arm-none-eabi-
245- threshold="104000" # should be ~103.7KB, set threshold to 104KB.
245+ threshold="109000"
246246 toolchain_cmake=examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
247247 elif [[ ${{ matrix.os}} == "zephyr-preset" ]]; then
248248 setup_script_args="--target-toolchain zephyr"
249249 toolchain_prefix=arm-zephyr-eabi-
250- threshold="133120" # should be ~125KB, set threshold to 130KB
250+ threshold="135000"
251251 toolchain_cmake=examples/zephyr/x86_64-linux-arm-zephyr-eabi-gcc.cmake
252252 else
253253 echo "Fail unsupport OS selection ${{ matrix.os }}"
@@ -568,10 +568,12 @@ jobs:
568568 PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
569569 PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh ${{ matrix.model }} "cmake" "qnn"
570570
571- test-apple-model :
572- name : test-apple-model
571+ test-models-macos-coreml :
572+ name : test-models-macos-coreml
573573 uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
574574 strategy :
575+ matrix :
576+ model : [dl3, edsr, efficient_sam, emformer_join, emformer_transcribe, ic3, ic4, mobilebert, mv2, mv3, resnet50, vit, w2l]
575577 fail-fast : false
576578 with :
577579 runner : macos-m1-stable
@@ -580,7 +582,23 @@ jobs:
580582 ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
581583 timeout : 90
582584 script : |
585+ MODEL_NAME=${{ matrix.model }}
583586 BUILD_TOOL=cmake
587+ BACKEND="coreml-pybind"
588+
589+
590+ # Set model specific overrides
591+ if [[ "${MODEL_NAME}" == "mobilebert" ]]; then
592+ # See https://github.com/pytorch/executorch/issues/12907
593+ # mobilebert has nan output on FP16, and high MSE on fp32, so we disable runtime test now
594+ BACKEND="coreml"
595+ fi
596+
597+ if [[ "${MODEL_NAME}" == "efficient_sam" ]]; then
598+ # See https://github.com/pytorch/executorch/issues/12906
599+ # efficient_sam fails to run on CoreML
600+ BACKEND="coreml"
601+ fi
584602
585603 bash .ci/scripts/setup-conda.sh
586604
@@ -589,13 +607,28 @@ jobs:
589607 PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/install_requirements.sh
590608 echo "Finishing installing coreml."
591609
592- # Build and test coreml model
593- MODELS=(mv3 ic4 resnet50 edsr mobilebert w2l)
594- for MODEL_NAME in "${MODELS[@]}"; do
595- echo "::group::Exporting coreml model: $MODEL_NAME"
596- PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "coreml"
597- echo "::endgroup::"
610+ PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
611+
612+ test-models-macos-mps :
613+ name : test-models-macos-mps
614+ uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
615+ strategy :
616+ fail-fast : false
617+ with :
618+ runner : macos-m1-stable
619+ python-version : ' 3.11'
620+ submodules : ' recursive'
621+ ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
622+ timeout : 90
623+ script : |
624+ BUILD_TOOL=cmake
625+ bash .ci/scripts/setup-conda.sh
626+
627+ # Setup MacOS dependencies as there is no Docker support on MacOS atm
628+ PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
598629
630+ # Build and test mps model
631+ for MODEL_NAME in mv3 ic4 resnet50 edsr mobilebert w2l; do
599632 echo "::group::Exporting mps model: $MODEL_NAME"
600633 PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "mps"
601634 echo "::endgroup::"
0 commit comments