Skip to content

Commit 8484ede

Browse files
authored
Merge branch 'main' into patch-1
2 parents d6404cd + eadd027 commit 8484ede

File tree

4,132 files changed

+1836418
-80942
lines changed

Some content is hidden

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

4,132 files changed

+1836418
-80942
lines changed

.buckconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,16 @@
2323

2424
[parser]
2525
target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default
26+
27+
# Limit the number of files that the buck daemon needs to monitor. If every
28+
# submodule is cloned recursively, some system can fail to build with "OS file
29+
# watch limit reached".
30+
[project]
31+
ignore = \
32+
.git, \
33+
**/.git, \
34+
cmake-out, \
35+
pip-out
36+
37+
[buck2]
38+
restarter=true

.ci/docker/build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,19 @@ 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+
;;
44+
executorch-ubuntu-22.04-mediatek-sdk)
45+
MEDIATEK_SDK=yes
46+
CLANG_VERSION=12
47+
;;
4048
executorch-ubuntu-22.04-clang12-android)
4149
LINTRUNNER=""
4250
CLANG_VERSION=12
4351
# From https://developer.android.com/ndk/downloads
44-
ANDROID_NDK_VERSION=r26c
52+
ANDROID_NDK_VERSION=r27b
4553
;;
4654
*)
4755
echo "Invalid image name ${IMAGE_NAME}"
@@ -72,6 +80,8 @@ docker build \
7280
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
7381
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
7482
--build-arg "ARM_SDK=${ARM_SDK:-}" \
83+
--build-arg "QNN_SDK=${QNN_SDK:-}" \
84+
--build-arg "MEDIATEK_SDK=${MEDIATEK_SDK:-}" \
7585
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
7686
-f "${OS}"/Dockerfile \
7787
"$@" \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-02-15
1+
2024-12-16
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b1984237a0fb32b760c1b84d6d02d2f0f7ed293b
1+
27e35de6c288bffad1b4d18b393579c1d1a95547

.ci/docker/common/install_android.sh

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,33 @@ set -ex
1111
[ -n "${ANDROID_NDK_VERSION}" ]
1212

1313
install_prerequiresites() {
14-
apt-get update
14+
OS=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"')
15+
case "$OS" in
16+
amzn)
17+
# https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/amazon-linux-install.html
18+
yum install -y java-17-amazon-corretto \
19+
ca-certificates \
20+
ant
21+
;;
22+
*)
23+
apt-get update
1524

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
25+
# NB: Need OpenJDK 17 at the minimum
26+
apt-get install -y --no-install-recommends \
27+
openjdk-17-jdk \
28+
ca-certificates-java \
29+
ant
2130

22-
# Cleanup package manager
23-
apt-get autoclean && apt-get clean
24-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
31+
# Cleanup package manager
32+
apt-get autoclean && apt-get clean
33+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
34+
;;
35+
esac
2536
}
2637

2738
install_ndk() {
2839
NDK_INSTALLATION_DIR=/opt/ndk
29-
mkdir -p "${NDK_INSTALLATION_DIR}"
40+
rm -rf "${NDK_INSTALLATION_DIR}" && mkdir -p "${NDK_INSTALLATION_DIR}"
3041

3142
pushd /tmp
3243
# The NDK installation is cached on ossci-android S3 bucket
@@ -54,7 +65,7 @@ install_cmdtools() {
5465

5566
install_sdk() {
5667
SDK_INSTALLATION_DIR=/opt/android/sdk
57-
mkdir -p "${SDK_INSTALLATION_DIR}"
68+
rm -rf "${SDK_INSTALLATION_DIR}" && mkdir -p "${SDK_INSTALLATION_DIR}"
5869

5970
# These are the tools needed to build Android apps
6071
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "platforms;android-34"

.ci/docker/common/install_base.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ install_ubuntu() {
2323
unzip \
2424
gdb \
2525
rsync \
26-
libssl-dev
26+
libssl-dev \
27+
zip
2728

2829
# Cleanup package manager
2930
apt-get autoclean && apt-get clean

.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/common/install_linter.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1313
# NB: Install all linter dependencies, the caching of lintrunner init could be
1414
# done after Executorch becomes public
1515
pip_install -r requirements-lintrunner.txt
16+
17+
# Install google-java-format
18+
curl -L --retry 3 https://github.com/google/google-java-format/releases/download/v1.23.0/google-java-format_linux-x86-64 > /opt/google-java-format
19+
chmod +x /opt/google-java-format

.ci/docker/common/install_pytorch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ install_pytorch_and_domains() {
2626

2727
chown -R ci-user .
2828

29-
export _GLIBCXX_USE_CXX11_ABI=0
29+
export _GLIBCXX_USE_CXX11_ABI=1
3030
# Then build and install PyTorch
3131
conda_run python setup.py bdist_wheel
3232
pip_install "$(echo dist/*.whl)"

0 commit comments

Comments
 (0)