Skip to content

Commit 12a9263

Browse files
committed
Resolve the conflict
2 parents 62f7545 + ec6b88a commit 12a9263

File tree

801 files changed

+38802
-16704
lines changed

Some content is hidden

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

801 files changed

+38802
-16704
lines changed

.ci/docker/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ case "${IMAGE_NAME}" in
3737
ARM_SDK=yes
3838
CLANG_VERSION=12
3939
;;
40+
executorch-ubuntu-22.04-clang12-android)
41+
LINTRUNNER=""
42+
CLANG_VERSION=12
43+
# From https://developer.android.com/ndk/downloads
44+
ANDROID_NDK_VERSION=r26c
45+
;;
4046
*)
4147
echo "Invalid image name ${IMAGE_NAME}"
4248
exit 1
@@ -66,6 +72,7 @@ docker build \
6672
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
6773
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
6874
--build-arg "ARM_SDK=${ARM_SDK:-}" \
75+
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
6976
-f "${OS}"/Dockerfile \
7077
"$@" \
7178
.

.ci/docker/ci_commit_pins/pytorch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f5b99976adcbb01fd71bd0a39ea15bdac6c9e48a
1+
6ca9ae4f8693639c395544327f7e362441a58c79

.ci/docker/common/install_android.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/bin/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+
8+
set -ex
9+
10+
# Double check if the NDK version is set
11+
[ -n "${ANDROID_NDK_VERSION}" ]
12+
13+
install_prerequiresites() {
14+
apt-get update
15+
16+
# NB: Need OpenJDK 17 at the minimum
17+
apt-get install -y --no-install-recommends \
18+
openjdk-17-jdk \
19+
ca-certificates-java \
20+
ant
21+
22+
# Cleanup package manager
23+
apt-get autoclean && apt-get clean
24+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
25+
}
26+
27+
install_ndk() {
28+
NDK_INSTALLATION_DIR=/opt/ndk
29+
mkdir -p "${NDK_INSTALLATION_DIR}"
30+
31+
pushd /tmp
32+
# The NDK installation is cached on ossci-android S3 bucket
33+
curl -Os --retry 3 "https://ossci-android.s3.amazonaws.com/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
34+
unzip -qo "android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
35+
36+
# Print the content for manual verification
37+
ls -lah "android-ndk-${ANDROID_NDK_VERSION}"
38+
mv "android-ndk-${ANDROID_NDK_VERSION}"/* "${NDK_INSTALLATION_DIR}"
39+
40+
popd
41+
}
42+
43+
install_cmdtools() {
44+
CMDTOOLS_FILENAME=commandlinetools-linux-11076708_latest.zip
45+
46+
pushd /tmp
47+
# The file is cached on ossci-android S3 bucket
48+
curl -Os --retry 3 "https://ossci-android.s3.us-west-1.amazonaws.com/${CMDTOOLS_FILENAME}"
49+
unzip -qo "${CMDTOOLS_FILENAME}" -d /opt
50+
51+
ls -lah /opt/cmdline-tools/bin
52+
popd
53+
}
54+
55+
install_sdk() {
56+
SDK_INSTALLATION_DIR=/opt/android/sdk
57+
mkdir -p "${SDK_INSTALLATION_DIR}"
58+
59+
# These are the tools needed to build Android apps
60+
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "platforms;android-34"
61+
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "build-tools;33.0.1"
62+
# And some more tools for future emulator tests
63+
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "platform-tools"
64+
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "tools"
65+
}
66+
67+
install_prerequiresites
68+
install_ndk
69+
install_cmdtools
70+
install_sdk

.ci/docker/common/install_conda.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ install_pip_dependencies() {
4444
}
4545

4646
fix_conda_ubuntu_libstdcxx() {
47+
cat /etc/issue
4748
# WARNING: This is a HACK from PyTorch core to be able to build PyTorch on 22.04.
48-
# The issue still exists with the latest conda 23.10.0-1 at the time of writing
49-
# (2023/11/16).
49+
# Specifically, ubuntu-20+ all comes lib libstdc++ newer than 3.30+, but anaconda
50+
# is stuck with 3.29. So, remove libstdc++6.so.3.29 as installed by
51+
# https://anaconda.org/anaconda/libstdcxx-ng/files?version=11.2.0
5052
#
5153
# PyTorch sev: https://github.com/pytorch/pytorch/issues/105248
5254
# Ref: https://github.com/pytorch/pytorch/blob/main/.ci/docker/common/install_conda.sh
53-
if grep -e "[12][82].04.[623]" /etc/issue >/dev/null; then
55+
if grep -e "2[02].04." /etc/issue >/dev/null; then
5456
rm "/opt/conda/envs/py_${PYTHON_VERSION}/lib/libstdc++.so.6"
5557
fi
5658
}

.ci/docker/ubuntu/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ COPY ./requirements-lintrunner.txt requirements-lintrunner.txt
7171
RUN if [ -n "${LINTRUNNER}" ]; then bash ./install_linter.sh; fi
7272
RUN rm install_linter.sh utils.sh requirements-lintrunner.txt
7373

74+
ARG ANDROID_NDK_VERSION
75+
# Install lintrunner if needed
76+
COPY ./common/install_android.sh install_android.sh
77+
RUN if [ -n "${ANDROID_NDK_VERSION}" ]; then bash ./install_android.sh; fi
78+
RUN rm install_android.sh
79+
7480
ARG ARM_SDK
7581
COPY --chown=ci-user:ci-user ./arm /opt/arm
7682
# Set up ARM SDK if needed

.ci/scripts/setup-macos.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ install_buck() {
2323
brew install zstd
2424
fi
2525

26-
if ! command -v wget &> /dev/null; then
27-
brew install wget
26+
if ! command -v curl &> /dev/null; then
27+
brew install curl
2828
fi
2929

3030
pushd .ci/docker
@@ -37,7 +37,7 @@ install_buck() {
3737
# --version doesn't say anything w.r.t its release version, i.e. 2024-02-15.
3838
# See D53878006 for more details.
3939
BUCK2=buck2-aarch64-apple-darwin.zst
40-
wget -q "https://ossci-macos.s3.amazonaws.com/${BUCK2}"
40+
curl -s "https://ossci-macos.s3.amazonaws.com/${BUCK2}" -o "${BUCK2}"
4141

4242
zstd -d "${BUCK2}" -o buck2
4343

.ci/scripts/utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install_executorch() {
1919
which pip
2020
# Install executorch, this assumes that Executorch is checked out in the
2121
# current directory
22-
pip install . --no-build-isolation
22+
pip install . --no-build-isolation -v
2323
# Just print out the list of packages for debugging
2424
pip list
2525
}

.github/pytorch-probot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
ciflow_push_tags:
33
- ciflow/nightly
44
- ciflow/trunk
5+
- ciflow/binaries
6+
- ciflow/binaries/all

.github/workflows/_unittest.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ jobs:
3333
conda activate "${CONDA_ENV}"
3434
3535
BUILD_TOOL=${{ matrix.build-tool }}
36+
3637
# Setup MacOS dependencies as there is no Docker support on MacOS atm
37-
PYTHON_EXECUTABLE=python EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
38+
PYTHON_EXECUTABLE=python \
39+
EXECUTORCH_BUILD_PYBIND=ON \
40+
.ci/scripts/setup-linux.sh "${BUILD_TOOL}"
3841
3942
# Run pytest with coverage
4043
pytest -n auto --cov=./ --cov-report=xml
@@ -59,8 +62,13 @@ jobs:
5962
BUILD_TOOL=${{ matrix.build-tool }}
6063
6164
bash .ci/scripts/setup-conda.sh
65+
6266
# Setup MacOS dependencies as there is no Docker support on MacOS atm
63-
PYTHON_EXECUTABLE=python ${CONDA_RUN} EXECUTORCH_BUILD_PYBIND=ON bash .ci/scripts/setup-macos.sh "${BUILD_TOOL}"
67+
PYTHON_EXECUTABLE=python \
68+
EXECUTORCH_BUILD_PYBIND=ON \
69+
CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DEXECUTORCH_BUILD_MPS=ON -DEXECUTORCH_BUILD_XNNPACK=ON" \
70+
${CONDA_RUN} --no-capture-output \
71+
.ci/scripts/setup-macos.sh "${BUILD_TOOL}"
6472
6573
# Run pytest with coverage
6674
${CONDA_RUN} pytest -n auto --cov=./ --cov-report=xml

.github/workflows/android.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build ExecuTorch Android demo apps
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/*
8+
pull_request:
9+
paths:
10+
- .ci/docker/**
11+
- .github/workflows/android.yml
12+
- install_requirements.sh
13+
- examples/demo-apps/**
14+
- extension/module/**
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test-demo-android:
23+
name: test-demo-android
24+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
25+
strategy:
26+
matrix:
27+
include:
28+
- build-tool: buck2
29+
with:
30+
# NB: The example model dl3 requires lots of memory (T161064121)
31+
runner: linux.12xlarge
32+
docker-image: executorch-ubuntu-22.04-clang12-android
33+
submodules: 'true'
34+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
35+
timeout: 90
36+
script: |
37+
set -eux
38+
39+
# The generic Linux job chooses to use base env, not the one setup by the image
40+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
41+
conda activate "${CONDA_ENV}"
42+
43+
BUILD_TOOL=${{ matrix.build-tool }}
44+
# Setup MacOS dependencies as there is no Docker support on MacOS atm
45+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
46+
# Build Android demo app
47+
bash build/test_android_ci.sh

.github/workflows/app-build.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)