Skip to content

Commit 9e8674c

Browse files
authored
[Backend Tester] Add nightly CI job for XNNPACK (#13390)
Set up a nightly CI job to run the backend model and operator tests for xnnpack (unquantized and static int8 per channel). This is the first step in setting up continuous coverage using the new suite. I've chosen nightly as the initial run cadence as some of the larger test suites are very long. In the medium-term, I'd like to run a subset of these tests on pull or trunk, but we can start with this.
1 parent 9168302 commit 9e8674c

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.ci/scripts/setup-linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set -exu
1111
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1212

1313
read -r BUILD_TOOL BUILD_MODE EDITABLE < <(parse_args "$@")
14+
echo "Build tool: $BUILD_TOOL, Mode: $BUILD_MODE"
1415

1516
# As Linux job is running inside a Docker container, all of its dependencies
1617
# have already been installed, so we use PyTorch build from source here instead

.ci/scripts/test_backend_linux.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
set -eux
8+
9+
SUITE=$1
10+
FLOW=$2
11+
ARTIFACT_DIR=$3
12+
13+
echo "Running backend test job for suite $SUITE, flow $FLOW."
14+
echo "Saving job artifacts to $ARTIFACT_DIR."
15+
16+
# The generic Linux job chooses to use base env, not the one setup by the image
17+
eval "$(conda shell.bash hook)"
18+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
19+
conda activate "${CONDA_ENV}"
20+
21+
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
22+
#source .ci/scripts/setup-vulkan-linux-deps.sh
23+
24+
# We need the runner to test the built library.
25+
PYTHON_EXECUTABLE=python .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release
26+
27+
python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$ARTIFACT_DIR/test_results.csv"

.github/workflows/nightly.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,25 @@ jobs:
3636
uses: ./.github/workflows/_link_check.yml
3737
with:
3838
ref: ${{ github.sha }}
39+
40+
backend-test-linux:
41+
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
flow: [xnnpack, xnnpack_static_int8_per_channel]
46+
suite: [models, operators]
47+
with:
48+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
49+
runner: linux.4xlarge.memory
50+
docker-image: ci-image:executorch-ubuntu-22.04-clang12
51+
submodules: recursive
52+
timeout: 120
53+
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
54+
script: |
55+
set -eux
56+
# Intentionally suppressing exit code for now.
57+
# TODO (gjcomer) Remove this when jobs are stable.
58+
EXIT_CODE=0
59+
.ci/scripts/test_backend_linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}" || EXIT_CODE=$?
60+
echo "Test run complete with exit code $EXIT_CODE."

0 commit comments

Comments
 (0)