Skip to content

Commit 0a01c66

Browse files
authored
Merge branch 'main' into vit-test
2 parents 18496fb + c52d0bf commit 0a01c66

File tree

292 files changed

+13210
-2137
lines changed

Some content is hidden

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

292 files changed

+13210
-2137
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.ci/docker/build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
set -exu
99

10-
IMAGE_NAME="$1"
10+
FULL_IMAGE_NAME="$1"
1111
shift
1212

13+
IMAGE_NAME=$(echo "${FULL_IMAGE_NAME}" | sed 's/ci-image://')
14+
1315
echo "Building ${IMAGE_NAME} Docker image"
1416

1517
OS=ubuntu
@@ -41,6 +43,10 @@ case "${IMAGE_NAME}" in
4143
ARM_SDK=yes
4244
CLANG_VERSION=12
4345
;;
46+
executorch-ubuntu-22.04-zephyr-sdk)
47+
ZEPHYR_SDK=yes
48+
GCC_VERSION=11
49+
;;
4450
executorch-ubuntu-22.04-qnn-sdk)
4551
QNN_SDK=yes
4652
CLANG_VERSION=12
@@ -85,6 +91,7 @@ docker build \
8591
--build-arg "LINTRUNNER=${LINTRUNNER:-}" \
8692
--build-arg "BUILD_DOCS=${BUILD_DOCS}" \
8793
--build-arg "ARM_SDK=${ARM_SDK:-}" \
94+
--build-arg "ZEPHYR_SDK=${ZEPHYR_SDK:-}" \
8895
--build-arg "QNN_SDK=${QNN_SDK:-}" \
8996
--build-arg "MEDIATEK_SDK=${MEDIATEK_SDK:-}" \
9097
--build-arg "ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-}" \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
90f1e7bed15ca5e48c61c5b6dc5ad4810524f82f
1+
ab43fe4bdf5ccd82897f0e982c451a0127bd175e
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
2+
#!/bin/bash
3+
# Copyright (c) Meta Platforms, Inc. and affiliates.
4+
# All rights reserved.
5+
#
6+
# This source code is licensed under the BSD-style license found in the
7+
# LICENSE file in the root directory of this source tree.
8+
9+
set -ex
10+
11+
# Double check if the NDK version is set
12+
[ -n "${ZEPHYR_SDK}" ]
13+
14+
install_prerequiresites() {
15+
rm /var/lib/dpkg/info/libc-bin.*
16+
apt-get clean
17+
apt-get -y update
18+
apt-get install -y libc-bin
19+
apt-get -y update
20+
apt-get clean
21+
apt-get install --no-install-recommends -y dos2unix
22+
apt-get install --no-install-recommends -y ca-certificates
23+
apt-get install -y --reinstall libc-bin
24+
apt-get install --no-install-recommends -y file
25+
apt-get install --no-install-recommends -y locales
26+
apt-get install --no-install-recommends -y git
27+
apt-get install --no-install-recommends -y build-essential
28+
apt-get install --no-install-recommends -y cmake
29+
apt-get install --no-install-recommends -y ninja-build gperf
30+
apt-get install --no-install-recommends -y device-tree-compiler
31+
apt-get install --no-install-recommends -y wget
32+
apt-get install --no-install-recommends -y curl
33+
apt-get install --no-install-recommends -y xz-utils
34+
apt-get install --no-install-recommends -y dos2unix
35+
apt-get install --no-install-recommends -y vim
36+
apt-get install --no-install-recommends -y nano
37+
apt-get install --no-install-recommends -y mc
38+
apt-get install --no-install-recommends -y openssh-server
39+
apt-get install -y gdb
40+
41+
# Zephyr SDK relies on python 3.12
42+
apt install software-properties-common -y
43+
add-apt-repository ppa:deadsnakes/ppa -y
44+
apt update
45+
apt install -y python3.12 python3.12-dev python3.12-venv python3-pip
46+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
47+
48+
# Upgrade cmake ot 3.24
49+
apt update
50+
apt install cmake
51+
apt install software-properties-common lsb-release
52+
apt update
53+
test -f /usr/share/doc/kitware-archive-keyring/copyright || \
54+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
55+
"deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list > /dev/null
56+
apt update
57+
apt install cmake
58+
59+
# Install additional required software for Zephyr
60+
apt install --no-install-recommends -y ccache \
61+
dfu-util \
62+
python3-setuptools \
63+
python3-tk \
64+
python3-wheel \
65+
make \
66+
gcc \
67+
libsdl2-dev \
68+
libmagic1 \
69+
xterm \
70+
telnet \
71+
net-tools
72+
apt install --no-install-recommends -y gcc-multilib g++-multilib
73+
apt-get clean -y
74+
apt-get autoremove --purge -y
75+
rm -rf /var/lib/apt/lists/*
76+
wget https://apt.kitware.com/kitware-archive.sh && \
77+
chmod +x kitware-archive.sh && \
78+
./kitware-archive.sh && \
79+
rm -f kitware-archive.sh
80+
useradd -d /home/zephyruser -m -s /bin/bash zephyruser
81+
}
82+
83+
install_sdk() {
84+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \
85+
tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \
86+
rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \
87+
cd zephyr-sdk-0.16.0/ && \
88+
./setup.sh -c -t arm-zephyr-eabi
89+
}
90+
91+
install_prerequiresites
92+
install_sdk

.ci/docker/ubuntu/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ RUN rm install_android.sh
8484

8585
ARG ARM_SDK
8686

87+
ARG ZEPHYR_SDK
88+
COPY ./common/install_zephyr.sh install_zephyr.sh
89+
RUN if [ -n "${ZEPHYR_SDK}" ]; then bash ./install_zephyr.sh; fi
90+
RUN rm install_zephyr.sh
91+
8792
ARG QNN_SDK
8893

8994
ARG MEDIATEK_SDK

.ci/scripts/setup-emscripten.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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.
17

28
set -ex
39

.ci/scripts/test_phi_3_mini.sh

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,14 @@ NPROC=8
2222
if hash nproc &> /dev/null; then NPROC=$(nproc); fi
2323

2424
cmake_install_executorch_libraries() {
25-
cmake -DPYTHON_EXECUTABLE=python \
26-
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
27-
-DEXECUTORCH_ENABLE_LOGGING=1 \
28-
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
29-
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
30-
-DEXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR=ON \
31-
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
32-
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
33-
-DEXECUTORCH_BUILD_XNNPACK=ON \
34-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
35-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
36-
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
37-
-B${BUILD_DIR} .
38-
39-
cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${BUILD_TYPE}
25+
rm -rf cmake-out
26+
cmake --preset llm -DCMAKE_INSTALL_PREFIX=cmake-out -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
27+
cmake --build cmake-out -j16 --target install --config ${BUILD_TYPE}
4028
}
4129

4230
cmake_build_phi_3_mini() {
43-
cmake -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
44-
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
31+
cmake -DCMAKE_PREFIX_PATH=${BUILD_DIR} \
4532
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
46-
-DEXECUTORCH_BUILD_KERNELS_LLM=ON \
47-
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
48-
-DEXECUTORCH_BUILD_XNNPACK=ON \
49-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
5033
-B${BUILD_DIR}/${MODEL_DIR} \
5134
${MODEL_DIR}
5235

@@ -81,7 +64,7 @@ run_and_verify() {
8164
${BUILD_DIR}/${MODEL_DIR}/phi_3_mini_runner \
8265
--model_path=phi-3-mini.pte \
8366
--tokenizer_path=tokenizer.bin \
84-
--seq_len=128 \
67+
--seq_len=60 \
8568
--temperature=0 \
8669
--prompt="<|system|>
8770
You are a helpful assistant.<|end|>

.github/workflows/_android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
contents: read
1414
with:
1515
runner: linux.2xlarge
16-
docker-image: executorch-ubuntu-22.04-clang12-android
16+
docker-image: ci-image:executorch-ubuntu-22.04-clang12-android
1717
submodules: 'recursive'
1818
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
1919
timeout: 90

.github/workflows/_link_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
1212
with:
1313
runner: linux.2xlarge
14-
docker-image: executorch-ubuntu-22.04-linter
14+
docker-image: ci-image:executorch-ubuntu-22.04-linter
1515
submodules: false
1616
fetch-depth: 0
1717
ref: ${{ inputs.ref }}
@@ -36,7 +36,7 @@ jobs:
3636
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
3737
with:
3838
runner: linux.2xlarge
39-
docker-image: executorch-ubuntu-22.04-linter
39+
docker-image: ci-image:executorch-ubuntu-22.04-linter
4040
submodules: false
4141
fetch-depth: 0
4242
ref: ${{ inputs.ref }}

0 commit comments

Comments
 (0)