Skip to content

Commit 6e07637

Browse files
committed
Update
[ghstack-poisoned]
2 parents d0861b6 + aef38ab commit 6e07637

File tree

6 files changed

+73
-17
lines changed

6 files changed

+73
-17
lines changed

.ci/docker/common/install_zephyr.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
set -ex
1010

11+
# shellcheck source=/dev/null
12+
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
13+
1114
# Double check if the NDK version is set
1215
[ -n "${ZEPHYR_SDK}" ]
1316

@@ -77,16 +80,8 @@ install_prerequiresites() {
7780
chmod +x kitware-archive.sh && \
7881
./kitware-archive.sh && \
7982
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
83+
pip_install --no-cache-dir west
84+
pip_install pyelftools
8985
}
9086

9187
install_prerequiresites
92-
install_sdk

.ci/docker/ubuntu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ ARG ARM_SDK
8686

8787
ARG ZEPHYR_SDK
8888
COPY ./common/install_zephyr.sh install_zephyr.sh
89+
COPY ./common/utils.sh utils.sh
8990
RUN if [ -n "${ZEPHYR_SDK}" ]; then bash ./install_zephyr.sh; fi
90-
RUN rm install_zephyr.sh
91+
RUN rm install_zephyr.sh utils.sh
9192

9293
ARG QNN_SDK
9394

.ci/scripts/zephyr-utils.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
download_arm_zephyr_sdk () {
9+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz
10+
tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz
11+
rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz
12+
}
13+
14+
setup_zephyr_et_module () {
15+
git clone --branch executorch-module-integration https://github.com/BujSet/zephyr.git
16+
west init -l zephyr
17+
west config manifest.project-filter -- +executorch
18+
west -v update
19+
}

.github/workflows/trunk.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,49 @@ jobs:
5555
# Build and test executorch
5656
PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}"
5757
58+
test-models-arm-zephyr:
59+
name: test-models-arm-zephyr
60+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
61+
strategy:
62+
matrix:
63+
model: [add]
64+
fail-fast: false
65+
with:
66+
runner: linux.2xlarge
67+
docker-image: ci-image:executorch-ubuntu-22.04-zephyr-sdk
68+
submodules: 'recursive'
69+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
70+
timeout: 120
71+
script: |
72+
MODEL_NAME=${{ matrix.model }}
73+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
74+
conda activate "${CONDA_ENV}"
75+
76+
source .ci/scripts/utils.sh
77+
source .ci/scripts/zephyr-utils.sh
78+
mkdir -p zephyr_scratch/
79+
cd zephyr_scratch
80+
export ZEPHYR_PROJ_ROOT=$(realpath $(pwd))
81+
82+
download_arm_zephyr_sdk
83+
./zephyr-sdk-0.16.0/setup.sh -c -t arm-zephyr-eabi
84+
85+
cd $ZEPHYR_PROJ_ROOT
86+
setup_zephyr_et_module
87+
88+
cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch
89+
install_executorch "--use-pt-pinned-commit"
90+
.ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr
91+
source examples/arm/ethos-u-scratch/setup_path.sh
92+
source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh
93+
cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world
94+
west build -p always -b mps3/corstone300/fvp
95+
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 120
96+
97+
grep -qF "Output[0][0]: (float) 2.000000" sim.out
98+
exit_status=$? #store 0 if found (success), 1 if not (failure)
99+
exit $exit_status
100+
58101
test-models-linux-aarch64:
59102
name: test-models-linux-aarch64
60103
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main

extension/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ allprojects {
1717

1818
dependencies {
1919
classpath 'com.android.tools.build:gradle:8.9.0'
20-
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.31.0'
20+
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.34.0'
2121
}
2222

2323
}

extension/android/executorch_android/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,11 @@ dependencies {
5858
androidTestImplementation 'org.jetbrains.kotlin:kotlin-test:1.9.23'
5959
}
6060

61-
import com.vanniktech.maven.publish.SonatypeHost
62-
6361
mavenPublishing {
64-
publishToMavenCentral(SonatypeHost.DEFAULT)
62+
publishToMavenCentral()
6563
signAllPublications()
6664

67-
coordinates("org.pytorch", "executorch-android", "0.7.0")
65+
coordinates("org.pytorch", "executorch-android", "0.7.0-SNAPSHOT")
6866

6967
pom {
7068
name = "ExecuTorch Android"
@@ -96,6 +94,6 @@ mavenPublishing {
9694

9795
repositories {
9896
maven {
99-
url "https://oss.sonatype.org/content/repositories/snapshots"
97+
url "https://central.sonatype.com/repository/maven-snapshots/"
10098
}
10199
}

0 commit comments

Comments
 (0)