File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,23 @@ jobs:
48
48
# Build Android demo app
49
49
bash build/test_android_ci.sh
50
50
51
+ # Strip libraries for uploda
52
+ strip cmake-out-android-arm64-v8a/lib/*.a cmake-out-android-arm64-v8a/extension/android/*.so
53
+ strip cmake-out-android-x86_64/lib/*.a cmake-out-android-x86_64/extension/android/*.so
54
+
51
55
mkdir -p artifacts-to-be-uploaded
56
+ mkdir -p artifacts-to-be-uploaded/arm64-v8a/
57
+ mkdir -p artifacts-to-be-uploaded/x86_64/
58
+ # Copy the jar to S3
59
+ cp extension/android/build/libs/executorch.jar artifacts-to-be-uploaded/
52
60
# Copy the app and its test suite to S3
53
61
cp examples/demo-apps/android/LlamaDemo/app/build/outputs/apk/debug/*.apk artifacts-to-be-uploaded/
54
62
cp examples/demo-apps/android/LlamaDemo/app/build/outputs/apk/androidTest/debug/*.apk artifacts-to-be-uploaded/
55
- # Also copy the share libraries
56
- cp cmake-out-android/lib/*.a artifacts-to-be-uploaded/
63
+ # Also copy the libraries
64
+ cp cmake-out-android-arm64-v8a/lib/*.a artifacts-to-be-uploaded/arm64-v8a/
65
+ cp cmake-out-android-arm64-v8a/extension/android/*.so artifacts-to-be-uploaded/arm64-v8a/
66
+ cp cmake-out-android-x86_64/lib/*.a artifacts-to-be-uploaded/x86_64/
67
+ cp cmake-out-android-x86_64/extension/android/*.so artifacts-to-be-uploaded/x86_64/
57
68
58
69
# Upload the app and its test suite to S3 so that they can be downloaded by the test job
59
70
upload-artifacts :
Original file line number Diff line number Diff line change 8
8
set -ex
9
9
10
10
# https://github.com/pytorch/executorch/tree/main/examples/demo-apps/android/ExecuTorchDemo
11
- build_executorch () {
11
+ export_model () {
12
12
MODEL_NAME=dl3
13
13
# Delegating DeepLab v3 to XNNPACK backend
14
14
python -m examples.xnnpack.aot_compiler --model_name=" ${MODEL_NAME} " --delegate
15
15
16
16
ASSETS_DIR=examples/demo-apps/android/ExecuTorchDemo/app/src/main/assets/
17
17
mkdir -p " ${ASSETS_DIR} "
18
18
cp " ${MODEL_NAME} _xnnpack_fp32.pte" " ${ASSETS_DIR} "
19
+ }
19
20
20
- rm -rf cmake-out && mkdir cmake-out
21
- ANDROID_NDK=/opt/ndk BUCK2=$( which buck2) FLATC=$( which flatc) ANDROID_ABI=arm64-v8a \
22
- bash examples/demo-apps/android/ExecuTorchDemo/setup.sh
21
+ build_android_native_library () {
22
+ pushd examples/demo-apps/android/LlamaDemo
23
+ CMAKE_OUT=" cmake-out-android-$1 " ANDROID_NDK=/opt/ndk ANDROID_ABI=" $1 " ./gradlew setup
24
+ popd
23
25
}
24
26
25
27
build_android_demo_app () {
@@ -30,12 +32,13 @@ build_android_demo_app() {
30
32
31
33
build_android_llama_demo_app () {
32
34
pushd examples/demo-apps/android/LlamaDemo
33
- ANDROID_NDK=/opt/ndk ANDROID_ABI=arm64-v8a ./gradlew setup
34
35
ANDROID_HOME=/opt/android/sdk ./gradlew build
35
36
ANDROID_HOME=/opt/android/sdk ./gradlew assembleAndroidTest
36
37
popd
37
38
}
38
39
39
- build_executorch
40
+ build_android_native_library arm64-v8a
41
+ build_android_native_library x86_64
42
+ export_model
40
43
build_android_demo_app
41
44
build_android_llama_demo_app
You can’t perform that action at this time.
0 commit comments