diff --git a/.ci/scripts/backend-test-macos.sh b/.ci/scripts/backend-test-macos.sh new file mode 100755 index 00000000000..08ac59809dd --- /dev/null +++ b/.ci/scripts/backend-test-macos.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. +set -eux + +SUITE=$1 +FLOW=$2 +ARTIFACT_DIR=$3 + +echo "Running backend test job for suite $SUITE, flow $FLOW." +echo "Saving job artifacts to $ARTIFACT_DIR." + +${CONDA_RUN} --no-capture-output pip install awscli==1.37.21 + +bash .ci/scripts/setup-conda.sh +eval "$(conda shell.bash hook)" + +PYTHON_EXECUTABLE=python +${CONDA_RUN} --no-capture-output .ci/scripts/setup-macos.sh --build-tool cmake --build-mode Release + +${CONDA_RUN} --no-capture-output python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$ARTIFACT_DIR/test_results.csv" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 17d07717cac..f9c58b5229c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -58,3 +58,27 @@ jobs: EXIT_CODE=0 .ci/scripts/backend-test-linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}" || EXIT_CODE=$? echo "Test run complete with exit code $EXIT_CODE." + + backend-test-macos: + uses: pytorch/test-infra/.github/workflows/macos_job.yml@main + strategy: + fail-fast: false + matrix: + flow: [coreml, coreml_static_int8] + suite: [models, operators] + with: + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + runner: macos-latest-xlarge + python-version: 3.12 + submodules: recursive + timeout: 90 + upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }} + script: | + set -eux + + # This is needed to get the prebuilt PyTorch wheel from S3 + ${CONDA_RUN} --no-capture-output pip install awscli==1.37.21 + + EXIT_CODE=0 + .ci/scripts/backend-test-macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}" || EXIT_CODE=$? + echo "Test run complete with exit code $EXIT_CODE."