Skip to content

Commit e259ccc

Browse files
committed
Merge remote-tracking branch 'origin/main' into contributing-md-merge
2 parents 52fe302 + 7bfe3b9 commit e259ccc

File tree

2,544 files changed

+969031
-39597
lines changed

Some content is hidden

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

2,544 files changed

+969031
-39597
lines changed

.ci/docker/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ case "${IMAGE_NAME}" in
3737
ARM_SDK=yes
3838
CLANG_VERSION=12
3939
;;
40+
executorch-ubuntu-22.04-qnn-sdk)
41+
QNN_SDK=yes
42+
CLANG_VERSION=12
43+
;;
4044
executorch-ubuntu-22.04-clang12-android)
4145
LINTRUNNER=""
4246
CLANG_VERSION=12
4347
# From https://developer.android.com/ndk/downloads
44-
ANDROID_NDK_VERSION=r26c
48+
ANDROID_NDK_VERSION=r27b
4549
;;
4650
*)
4751
echo "Invalid image name ${IMAGE_NAME}"
@@ -72,6 +76,7 @@ docker build \
7276
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
7377
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
7478
--build-arg "ARM_SDK=${ARM_SDK:-}" \
79+
--build-arg "QNN_SDK=${QNN_SDK:-}" \
7580
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
7681
-f "${OS}"/Dockerfile \
7782
"$@" \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
00e3eea170ce5db8ea9c62ce5e48f13886cd6d20
1+
19eff28ff3f19b50da46f5a9ff5f4d4d213806fe

.ci/docker/ci_commit_pins/torchao.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.ci/docker/common/install_cache.sh

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ set -ex
1212
# shellcheck source=/dev/null
1313
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1414

15+
install_ubuntu() {
16+
echo "Preparing to build sccache from source"
17+
apt-get update
18+
# libssl-dev will not work as it is upgraded to libssl3 in Ubuntu-22.04.
19+
# Instead use lib and headers from OpenSSL1.1 installed in `install_openssl.sh``
20+
apt-get install -y cargo
21+
echo "Checking out sccache repo"
22+
git clone https://github.com/mozilla/sccache -b v0.8.2
23+
24+
cd sccache
25+
echo "Building sccache"
26+
cargo build --release
27+
cp target/release/sccache /opt/cache/bin
28+
echo "Cleaning up"
29+
cd ..
30+
rm -rf sccache
31+
apt-get remove -y cargo rustc
32+
apt-get autoclean && apt-get clean
33+
}
34+
1535
install_binary() {
1636
echo "Downloading sccache binary from S3 repo"
1737
curl --retry 3 https://s3.amazonaws.com/ossci-linux/sccache -o /opt/cache/bin/sccache
@@ -22,15 +42,33 @@ mkdir -p /opt/cache/bin
2242
sed -e 's|PATH="\(.*\)"|PATH="/opt/cache/bin:\1"|g' -i /etc/environment
2343
export PATH="/opt/cache/bin:$PATH"
2444

25-
# NB: Install the pre-built binary from S3 as building from source
26-
# https://github.com/pytorch/sccache has started failing mysteriously
27-
# in which sccache server couldn't start with the following error:
28-
# sccache: error: Invalid argument (os error 22)
29-
install_binary
45+
install_ubuntu
3046

3147
function write_sccache_stub() {
3248
BINARY=$1
33-
printf "#!/bin/sh\nif [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then\n exec sccache %s \"\$@\"\nelse\n exec %s \"\$@\"\nfi" "$(which "${BINARY}")" "$(which "${BINARY}")" > "/opt/cache/bin/${BINARY}"
49+
if [ $1 == "gcc" ]; then
50+
# Do not call sccache recursively when dumping preprocessor argument
51+
# For some reason it's very important for the first cached nvcc invocation
52+
cat >"/opt/cache/bin/$1" <<EOF
53+
#!/bin/sh
54+
if [ "\$1" = "-E" ] || [ "\$2" = "-E" ]; then
55+
exec $(which $1) "\$@"
56+
elif [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then
57+
exec sccache $(which $1) "\$@"
58+
else
59+
exec $(which $1) "\$@"
60+
fi
61+
EOF
62+
else
63+
cat >"/opt/cache/bin/$1" <<EOF
64+
#!/bin/sh
65+
if [ \$(env -u LD_PRELOAD ps -p \$PPID -o comm=) != sccache ]; then
66+
exec sccache $(which $1) "\$@"
67+
else
68+
exec $(which $1) "\$@"
69+
fi
70+
EOF
71+
fi
3472
chmod a+x "/opt/cache/bin/${BINARY}"
3573
}
3674

@@ -44,7 +82,7 @@ init_sccache() {
4482

4583
# NB: This function is adopted from PyTorch core at
4684
# https://github.com/pytorch/pytorch/blob/main/.ci/pytorch/common-build.sh
47-
as_ci_user sccache --stop-server > /dev/null 2>&1 || true
85+
as_ci_user sccache --stop-server >/dev/null 2>&1 || true
4886
rm -f "${SCCACHE_ERROR_LOG}" || true
4987

5088
# Clear sccache stats before using it

.ci/docker/common/install_clang.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ install_ubuntu() {
1313
apt-get install -y --no-install-recommends clang-"$CLANG_VERSION"
1414
apt-get install -y --no-install-recommends llvm-"$CLANG_VERSION"
1515
# Also require LLD linker from llvm and libomp to build PyTorch from source
16-
apt-get install -y lld "libomp-${CLANG_VERSION}-dev"
16+
apt-get install -y lld "libomp-${CLANG_VERSION}-dev" "libc++-${CLANG_VERSION}-dev"
1717

1818
# Use update-alternatives to make this version the default
1919
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-"$CLANG_VERSION" 50

.ci/docker/ubuntu/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ COPY ./common/utils.sh utils.sh
5757
RUN bash ./install_cache.sh && rm install_cache.sh utils.sh
5858
ENV SCCACHE_BUCKET ossci-compiler-cache-circleci-v2
5959
ENV SCCACHE_S3_KEY_PREFIX executorch
60+
ENV SCCACHE_REGION us-east-1
6061

6162
ARG TORCH_VERSION
6263
COPY ./common/install_pytorch.sh install_pytorch.sh
@@ -82,5 +83,7 @@ COPY --chown=ci-user:ci-user ./arm /opt/arm
8283
# Set up ARM SDK if needed
8384
RUN if [ -n "${ARM_SDK}" ]; then git config --global user.email "[email protected]"; git config --global user.name "OSS CI"; bash /opt/arm/setup.sh --i-agree-to-the-contained-eula /opt/arm-sdk; chown -R ci-user:ci-user /opt/arm-sdk; fi
8485

86+
ARG QNN_SDK
87+
8588
USER ci-user
8689
CMD ["bash"]

.ci/scripts/build-qnn-sdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -o xtrace
1111
build_qnn_backend() {
1212
echo "Start building qnn backend."
1313
export ANDROID_NDK_ROOT=/opt/ndk
14-
export QNN_SDK_ROOT=/tmp/qnn/2.23.0.240531
14+
export QNN_SDK_ROOT=/tmp/qnn/2.25.0.240728
1515
export EXECUTORCH_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)"
1616

1717
bash backends/qualcomm/scripts/build.sh --skip_aarch64 --job_number 2 --release
@@ -27,7 +27,7 @@ set_up_aot() {
2727
-DCMAKE_INSTALL_PREFIX=$PWD \
2828
-DEXECUTORCH_BUILD_QNN=ON \
2929
-DQNN_SDK_ROOT=${QNN_SDK_ROOT} \
30-
-DEXECUTORCH_BUILD_SDK=ON \
30+
-DEXECUTORCH_BUILD_DEVTOOLS=ON \
3131
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3232
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3333
-DEXECUTORCH_ENABLE_EVENT_TRACER=ON \

.ci/scripts/build_llama_android.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ install_executorch_and_backend_lib() {
1919
cmake -DBUCK2="${BUCK2}" \
2020
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK}/build/cmake/android.toolchain.cmake" \
2121
-DANDROID_ABI="${ANDROID_ABI}" \
22-
-DANDROID_PLATFORM=android-23 \
2322
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
2423
-DCMAKE_BUILD_TYPE=Release \
2524
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
@@ -41,16 +40,15 @@ build_llama_runner() {
4140
cmake -DBUCK2="${BUCK2}" \
4241
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK"/build/cmake/android.toolchain.cmake \
4342
-DANDROID_ABI="${ANDROID_ABI}" \
44-
-DANDROID_PLATFORM=android-23 \
4543
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
4644
-DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=python \
4745
-DEXECUTORCH_BUILD_XNNPACK=ON \
4846
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
4947
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
5048
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
51-
-Bcmake-android-out/examples/models/llama2 examples/models/llama2
49+
-Bcmake-android-out/examples/models/llama examples/models/llama
5250

53-
cmake --build cmake-android-out/examples/models/llama2 -j4 --config Release
51+
cmake --build cmake-android-out/examples/models/llama -j4 --config Release
5452
}
5553
install_flatc_from_source
5654
install_executorch_and_backend_lib

.ci/scripts/gather_test_models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
"ic4": "linux.12xlarge",
2525
"resnet50": "linux.12xlarge",
2626
"llava": "linux.12xlarge",
27+
"llama3_2_vision_encoder": "linux.12xlarge",
28+
# "llama3_2_text_decoder": "linux.12xlarge", # TODO: re-enable test when Huy's change is in / model gets smaller.
2729
# This one causes timeout on smaller runner, the root cause is unclear (T161064121)
2830
"dl3": "linux.12xlarge",
2931
"emformer_join": "linux.12xlarge",
@@ -88,8 +90,8 @@ def model_should_run_on_event(model: str, event: str) -> bool:
8890
if event == "pull_request":
8991
return model in ["mv3", "vit"]
9092
elif event == "push":
91-
# 'emformer_predict' is running super slow. Only run it periodically
92-
return model not in ["emformer_predict"]
93+
# These are super slow. Only run it periodically
94+
return model not in ["dl3", "edsr", "emformer_predict"]
9395
else:
9496
return True
9597

.ci/scripts/setup-linux.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ else
1919
fi
2020

2121
# As Linux job is running inside a Docker container, all of its dependencies
22-
# have already been installed
23-
install_executorch
22+
# have already been installed, so we use PyTorch build from source here instead
23+
# of nightly. This allows CI to test against latest commits from PyTorch
24+
install_executorch "use-pt-pinned-commit"
2425
build_executorch_runner "${BUILD_TOOL}"
26+
do_not_use_nightly_on_ci

0 commit comments

Comments
 (0)