Skip to content

Commit 6b7e747

Browse files
authored
Merge branch 'main' into order
2 parents 4d727f3 + 41730fa commit 6b7e747

File tree

450 files changed

+19896
-6481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

450 files changed

+19896
-6481
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
36e3dd54effb3f6d13d792029609292fdd5502bb
1+
40b02a2dc61bbf901a2df91719f47c98d65368ec
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6fc0ad22f0a07b6f38d138861c56a765d5a9bb02
1+
e7152ff8a6a929a0db7f3f4a72a5b6d471769cd3

.ci/scripts/test_backend_linux.sh

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ SUITE=$1
1010
FLOW=$2
1111
ARTIFACT_DIR=$3
1212

13+
REPORT_FILE="$ARTIFACT_DIR/test-report-$FLOW-$SUITE.csv"
14+
1315
echo "Running backend test job for suite $SUITE, flow $FLOW."
1416
echo "Saving job artifacts to $ARTIFACT_DIR."
1517

@@ -18,13 +20,38 @@ eval "$(conda shell.bash hook)"
1820
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
1921
conda activate "${CONDA_ENV}"
2022

21-
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
22-
source .ci/scripts/setup-vulkan-linux-deps.sh
23+
export PYTHON_EXECUTABLE=python
2324

2425
# CMake options to use, in addition to the defaults.
25-
EXTRA_BUILD_ARGS="-DEXECUTORCH_BUILD_VULKAN=ON"
26+
EXTRA_BUILD_ARGS=""
27+
28+
if [[ "$FLOW" == *qnn* ]]; then
29+
# Setup QNN sdk and deps - note that this is a bit hacky due to the nature of the
30+
# Qualcomm build. TODO (gjcomer) Clean this up once the QNN pybinding integration is
31+
# cleaned up.
32+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool cmake
33+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
34+
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
35+
QNN_X86_LIB_DIR=`realpath build-x86/lib/`
36+
QNN_SDK_ROOT="/tmp/qnn/2.28.0.241029"
37+
export LD_LIBRARY_PATH"=$QNN_X86_LIB_DIR:$QNN_SDK_ROOT/lib/x86_64-linux-clang/:${LD_LIBRARY_PATH:-}"
38+
39+
# TODO Get SDK root from install scripts
40+
EXTRA_BUILD_ARGS+=" -DEXECUTORCH_BUILD_QNN=ON -DQNN_SDK_ROOT=$QNN_SDK_ROOT"
41+
fi
42+
43+
if [[ "$FLOW" == *vulkan* ]]; then
44+
# Setup swiftshader and Vulkan SDK which are required to build the Vulkan delegate
45+
source .ci/scripts/setup-vulkan-linux-deps.sh
46+
47+
EXTRA_BUILD_ARGS+=" -DEXECUTORCH_BUILD_VULKAN=ON"
48+
fi
2649

2750
# We need the runner to test the built library.
28-
PYTHON_EXECUTABLE=python CMAKE_ARGS="$EXTRA_BUILD_ARGS" .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release
51+
PYTHON_EXECUTABLE=python CMAKE_ARGS="$EXTRA_BUILD_ARGS" .ci/scripts/setup-linux.sh --build-tool cmake --build-mode Release --editable true
52+
53+
EXIT_CODE=0
54+
python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$REPORT_FILE" || EXIT_CODE=$?
2955

30-
python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$ARTIFACT_DIR/test_results.csv"
56+
# Generate markdown summary.
57+
python -m executorch.backends.test.suite.generate_markdown_summary "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE

.ci/scripts/test_backend_macos.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ SUITE=$1
1010
FLOW=$2
1111
ARTIFACT_DIR=$3
1212

13+
REPORT_FILE="$ARTIFACT_DIR/test-report-$FLOW-$SUITE.csv"
14+
1315
echo "Running backend test job for suite $SUITE, flow $FLOW."
1416
echo "Saving job artifacts to $ARTIFACT_DIR."
1517

@@ -21,4 +23,8 @@ eval "$(conda shell.bash hook)"
2123
PYTHON_EXECUTABLE=python
2224
${CONDA_RUN} --no-capture-output .ci/scripts/setup-macos.sh --build-tool cmake --build-mode Release
2325

24-
${CONDA_RUN} --no-capture-output python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$ARTIFACT_DIR/test_results.csv"
26+
EXIT_CODE=0
27+
${CONDA_RUN} --no-capture-output python -m executorch.backends.test.suite.runner $SUITE --flow $FLOW --report "$REPORT_FILE" || EXIT_CODE=$?
28+
29+
# Generate markdown summary.
30+
${CONDA_RUN} --no-capture-output python -m executorch.backends.test.suite.generate_markdown_summary "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE

.ci/scripts/unittest-buck2.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ set -eux
1212
buck2 query "//backends/apple/... + //backends/example/... + \
1313
//backends/mediatek/... + //backends/transforms/... + \
1414
//backends/xnnpack/... + //configurations/... + //extension/flat_tensor: + \
15-
//kernels/aten/... + //kernels/optimized/... + //kernels/portable/... + \
16-
//kernels/quantized/... + //kernels/test/... + //runtime/... + //schema/... \
17-
+ //test/... + //util/..."
15+
//extension/llm/runner: + //kernels/aten/... + //kernels/optimized/... + \
16+
//kernels/portable/... + //kernels/quantized/... + //kernels/test/... + \
17+
//runtime/... + //schema/... + //test/... + //util/..."
1818

1919
# TODO: optimized ops are unbuildable because they now use ATen; put
2020
# them back after we can use PyTorch in OSS buck.

.github/workflows/android-release-artifacts.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
options:
1717
- "xnnpack"
1818
- "vulkan+xnnpack"
19+
- "qnn"
1920
schedule:
2021
- cron: 0 10 * * *
2122

@@ -83,17 +84,29 @@ jobs:
8384
8485
echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg
8586
87+
GRADLE_ARGS=""
88+
8689
# Update the version name in build.gradle in case of maven publish
8790
VERSION="${{ inputs.version }}"
8891
if [ ! -z "$VERSION" ]; then
89-
sed -i "s/\(coordinates(\"org.pytorch\", \"executorch-android\", \"\)\([0-9]\+.[0-9]\+.[0-9]\+\)\(\")\)/\1$VERSION\3/" extension/android/executorch_android/build.gradle
92+
GRADLE_ARGS+=" -DexecuTorchVersion=${VERSION}"
9093
fi
9194
9295
FLAVOR="${{ inputs.flavor }}"
9396
if [[ "$FLAVOR" == "vulkan+xnnpack" || -z "$FLAVOR" ]]; then
9497
export EXECUTORCH_BUILD_VULKAN=ON
9598
fi
9699
100+
if [[ "$FLAVOR" == "qnn" ]]; then
101+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-qnn-deps.sh
102+
PYTHON_EXECUTABLE=python bash .ci/scripts/build-qnn-sdk.sh
103+
export EXECUTORCH_BUILD_QNN=ON
104+
source backends/qualcomm/scripts/qnn_config.sh
105+
export QNN_SDK_ROOT="/tmp/qnn/${QNN_VERSION}"
106+
export ANDROID_ABIS=arm64-v8a
107+
GRADLE_ARGS+=" -DqnnVersion=2.28.0"
108+
fi
109+
97110
# Build AAR Package
98111
mkdir aar-out
99112
export BUILD_AAR_DIR=aar-out
@@ -106,7 +119,7 @@ jobs:
106119
# Publish to maven staging
107120
UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}"
108121
if [[ "$UPLOAD_TO_MAVEN" == "true" ]]; then
109-
(cd extension/android; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral)
122+
(cd extension/android; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew ${GRADLE_ARGS} :executorch_android:publishToMavenCentral)
110123
fi
111124
112125
upload-release-aar:

.github/workflows/apple.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
"kernels_llm"
157157
"kernels_optimized"
158158
"kernels_quantized"
159+
"kernels_torchao"
159160
"threadpool"
160161
)
161162

.github/workflows/build-presets.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
strategy:
110110
fail-fast: false
111111
matrix:
112-
preset: [pybind]
112+
preset: [pybind, windows]
113113
with:
114114
job-name: build
115115
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
@@ -119,14 +119,24 @@ jobs:
119119
set -eux
120120
conda init powershell
121121
powershell -Command "& {
122-
\$ErrorActionPreference = 'Stop'
123122
Set-PSDebug -Trace 1
123+
\$ErrorActionPreference = 'Stop'
124+
\$PSNativeCommandUseErrorActionPreference = \$true
124125
125126
conda create --yes --quiet -n et python=3.12
126127
conda activate et
127-
128128
python install_requirements.py
129-
cmake --preset ${{ matrix.preset }}
129+
130+
cmake --preset ${{ matrix.preset }} -T ClangCL
131+
if (\$LASTEXITCODE -ne 0) {
132+
Write-Host "CMake configuration was unsuccessful. Exit code: \$LASTEXITCODE."
133+
exit \$LASTEXITCODE
134+
}
135+
130136
\$numCores = [System.Environment]::GetEnvironmentVariable('NUMBER_OF_PROCESSORS') - 1
131137
cmake --build cmake-out -j \$numCores
138+
if (\$LASTEXITCODE -ne 0) {
139+
Write-Host "CMake build was unsuccessful. Exit code: \$LASTEXITCODE."
140+
exit \$LASTEXITCODE
141+
}
132142
}"

.github/workflows/nightly.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
flow: [vulkan, xnnpack, xnnpack_static_int8_per_channel]
45+
flow: [
46+
qnn, qnn_16a16w, qnn_16a8w, qnn_16a4w, qnn_16a4w_block, qnn_8a8w,
47+
vulkan, vulkan_static_int8_per_channel,
48+
xnnpack, xnnpack_dynamic_int8_per_channel, xnnpack_static_int8_per_channel, xnnpack_static_int8_per_tensor
49+
]
4650
suite: [models, operators]
4751
with:
4852
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
@@ -53,11 +57,8 @@ jobs:
5357
upload-artifact: test-report-${{ matrix.flow }}-${{ matrix.suite }}
5458
script: |
5559
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."
60+
61+
source .ci/scripts/test_backend_linux.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"
6162
6263
backend-test-macos:
6364
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
@@ -82,6 +83,4 @@ jobs:
8283
# This is needed to get the prebuilt PyTorch wheel from S3
8384
${CONDA_RUN} --no-capture-output pip install awscli==1.37.21
8485
85-
EXIT_CODE=0
86-
.ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}" || EXIT_CODE=$?
87-
echo "Test run complete with exit code $EXIT_CODE."
86+
source .ci/scripts/test_backend_macos.sh "${{ matrix.suite }}" "${{ matrix.flow }}" "${RUNNER_ARTIFACT_DIR}"

.github/workflows/periodic.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
branches:
1212
- release/*
1313
workflow_dispatch:
14+
pull_request:
15+
types: [opened, synchronize, reopened, labeled, unlabeled]
1416

1517
concurrency:
1618
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}-${{ github.event.schedule }}
@@ -32,10 +34,11 @@ jobs:
3234
python-version: '3.10'
3335
- name: Extract the list of models to test
3436
id: gather-models
37+
env:
38+
EFFECTIVE_EVENT: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ciflow/periodic') && 'schedule' || github.event_name }}
3539
run: |
3640
set -eux
37-
38-
PYTHONPATH="${PWD}" python .ci/scripts/gather_test_models.py --event "${GITHUB_EVENT_NAME}"
41+
PYTHONPATH="${PWD}" python .ci/scripts/gather_test_models.py --event "${EFFECTIVE_EVENT}"
3942
4043
test-models-linux:
4144
name: test-models-linux

0 commit comments

Comments
 (0)