Skip to content

Commit c6f13f9

Browse files
kirklandsignfacebook-github-bot
authored andcommitted
Add llama demo app to CI (#2763)
Summary: Pull Request resolved: #2763 Test Plan: CI https://github.com/pytorch/executorch/actions/runs/8484915346/job/23248744019?pr=2763 Reviewed By: shoumikhin Differential Revision: D55534899 Pulled By: kirklandsign fbshipit-source-id: 1756ef8edfa613f4c024566e06d8099c59f0d544
1 parent 764c353 commit c6f13f9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

build/test_android_ci.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ build_executorch() {
2020
rm -rf cmake-out && mkdir cmake-out
2121
ANDROID_NDK=/opt/ndk BUCK2=$(which buck2) FLATC=$(which flatc) ANDROID_ABI=arm64-v8a \
2222
bash examples/demo-apps/android/ExecuTorchDemo/setup.sh
23+
ANDROID_NDK=/opt/ndk BUCK2=$(which buck2) FLATC=$(which flatc) ANDROID_ABI=arm64-v8a \
24+
bash examples/demo-apps/android/LlamaDemo/setup.sh
2325
}
2426

2527
build_android_demo_app() {
@@ -28,5 +30,12 @@ build_android_demo_app() {
2830
popd
2931
}
3032

33+
build_android_llama_demo_app() {
34+
pushd examples/demo-apps/android/LlamaDemo
35+
ANDROID_HOME=/opt/android/sdk ./gradlew build
36+
popd
37+
}
38+
3139
build_executorch
3240
build_android_demo_app
41+
build_android_llama_demo_app

examples/demo-apps/android/LlamaDemo/setup.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) Meta Platforms, Inc. and affiliates.
33
# All rights reserved.
44
#
@@ -28,7 +28,7 @@ else
2828
fi
2929
cmake --build "${CMAKE_OUT}" -j "${CMAKE_JOBS}" --target install
3030

31-
cmake examples/models/llama2 -DBUCK2="$BUCK" \
31+
cmake examples/models/llama2 -DBUCK2="${BUCK2}" \
3232
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
3333
-DANDROID_ABI="$ANDROID_ABI" \
3434
-DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
@@ -48,7 +48,3 @@ cmake --build "${CMAKE_OUT}"/extension/android -j "${CMAKE_JOBS}"
4848
JNI_LIBS_PATH="examples/demo-apps/android/LlamaDemo/app/src/main/jniLibs"
4949
mkdir -p "${JNI_LIBS_PATH}/${ANDROID_ABI}"
5050
cp "${CMAKE_OUT}"/extension/android/libexecutorch_llama_jni.so "${JNI_LIBS_PATH}/${ANDROID_ABI}/"
51-
52-
pushd extension/android
53-
./gradlew build
54-
popd

0 commit comments

Comments
 (0)