diff --git a/.ci/scripts/test_backend_linux.sh b/.ci/scripts/test_backend_linux.sh index ac10f3b94b8..92f449b634a 100755 --- a/.ci/scripts/test_backend_linux.sh +++ b/.ci/scripts/test_backend_linux.sh @@ -19,9 +19,12 @@ CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]") conda activate "${CONDA_ENV}" # Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate -#source .ci/scripts/setup-vulkan-linux-deps.sh +source .ci/scripts/setup-vulkan-linux-deps.sh + +# CMake options to use, in addition to the defaults. +EXTRA_BUILD_ARGS="-DEXECUTORCH_BUILD_VULKAN=ON" # We need the runner to test the built library. -PYTHON_EXECUTABLE=python .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release +PYTHON_EXECUTABLE=python CMAKE_ARGS="$EXTRA_BUILD_ARGS" .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$ARTIFACT_DIR/test_results.csv" diff --git a/.ci/scripts/test_backend_macos.sh b/.ci/scripts/test_backend_macos.sh new file mode 100755 index 00000000000..08ac59809dd --- /dev/null +++ b/.ci/scripts/test_backend_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 3769309332f..4c40311d9a9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -42,7 +42,7 @@ jobs: strategy: fail-fast: false matrix: - flow: [xnnpack, xnnpack_static_int8_per_channel] + flow: [vulkan, xnnpack, xnnpack_static_int8_per_channel] suite: [models, operators] with: ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} @@ -58,3 +58,30 @@ jobs: EXIT_CODE=0 .ci/scripts/test_backend_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 + permissions: + id-token: write + contents: read + 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-m1-stable + python-version: 3.12 + submodules: recursive + timeout: 120 + 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/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}" || EXIT_CODE=$? + echo "Test run complete with exit code $EXIT_CODE." diff --git a/backends/test/suite/runner.py b/backends/test/suite/runner.py index 7a1fb64989a..3729d94cdf3 100644 --- a/backends/test/suite/runner.py +++ b/backends/test/suite/runner.py @@ -15,6 +15,7 @@ # Set of unsupported ops that should cause tests to be skipped UNSUPPORTED_PORTABLE_OPS = { "aten::_embedding_bag", + "aten::_adaptive_avg_pool2d", "aten::median", "aten::median.dim", "aten::round.decimals",