@@ -18,8 +18,8 @@ concurrency:
18
18
cancel-in-progress : true
19
19
20
20
jobs :
21
- test-models-macos :
22
- name : test-models-macos
21
+ test-models-macos-cpu :
22
+ name : test-models-macos-cpu
23
23
uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
24
24
strategy :
25
25
matrix :
@@ -568,10 +568,12 @@ jobs:
568
568
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
569
569
PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh ${{ matrix.model }} "cmake" "qnn"
570
570
571
- test-apple-model :
572
- name : test-apple-model
571
+ test-models-macos-coreml :
572
+ name : test-models-macos-coreml
573
573
uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
574
574
strategy :
575
+ matrix :
576
+ model : [dl3, edsr, efficient_sam, emformer_join, emformer_transcribe, ic3, ic4, mobilebert, mv2, mv3, resnet50, vit, w2l]
575
577
fail-fast : false
576
578
with :
577
579
runner : macos-m1-stable
@@ -580,7 +582,16 @@ jobs:
580
582
ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
581
583
timeout : 90
582
584
script : |
585
+ MODEL_NAME=${{ matrix.model }}
583
586
BUILD_TOOL=cmake
587
+ BACKEND="coreml-pybind"
588
+
589
+
590
+ # Set model specific overrides
591
+ if [[ "${MODEL_NAME}" == "mobilebert" ]]; then
592
+ # mobilebert has nan output on FP16, and high MSE on fp32, so we disable runtime test now
593
+ BACKEND="coreml-pybind-float32"
594
+ fi
584
595
585
596
bash .ci/scripts/setup-conda.sh
586
597
@@ -589,18 +600,25 @@ jobs:
589
600
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash backends/apple/coreml/scripts/install_requirements.sh
590
601
echo "Finishing installing coreml."
591
602
592
- # Build and test coreml model
593
- for MODEL_NAME in dl3 edsr emformer_join ic3 ic4 mobilebert mv2 mv3 resnet50 vit w2l; do
594
- echo "::group::Exporting coreml model: $MODEL_NAME"
595
- if [[ "${MODEL_NAME}" == "mobilebert" ]]; then
596
- # mobilebert has nan output on FP16
597
- BACKEND="coreml"
598
- else
599
- BACKEND="coreml-pybind"
600
- fi
601
- PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
602
- echo "::endgroup::"
603
- done
603
+ PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
604
+
605
+ test-models-macos-mps :
606
+ name : test-models-macos-mps
607
+ uses : pytorch/test-infra/.github/workflows/macos_job.yml@main
608
+ strategy :
609
+ fail-fast : false
610
+ with :
611
+ runner : macos-m1-stable
612
+ python-version : ' 3.11'
613
+ submodules : ' recursive'
614
+ ref : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
615
+ timeout : 90
616
+ script : |
617
+ BUILD_TOOL=cmake
618
+ bash .ci/scripts/setup-conda.sh
619
+
620
+ # Setup MacOS dependencies as there is no Docker support on MacOS atm
621
+ PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/setup-macos.sh --build-tool "${BUILD_TOOL}"
604
622
605
623
# Build and test mps model
606
624
for MODEL_NAME in mv3 ic4 resnet50 edsr mobilebert w2l; do
0 commit comments