Skip to content

Commit ec1f9ac

Browse files
committed
[Android] Support llama3
1 parent 1a93dee commit ec1f9ac

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ cmake examples/models/llama2 \
3434
-DANDROID_ABI="$ANDROID_ABI" \
3535
-DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
3636
-DEXECUTORCH_USE_TIKTOKEN="${EXECUTORCH_USE_TIKTOKEN}" \
37+
-DEXECUTORCH_BUILD_CUSTOM=ON \
38+
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
39+
-DEXECUTORCH_BUILD_XNNPACK=ON \
3740
-DCMAKE_BUILD_TYPE=Release \
3841
-B"${CMAKE_OUT}"/examples/models/llama2
3942

extension/android/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
6868
set_property(TARGET custom_ops PROPERTY IMPORTED_LOCATION ${CUSTOM_OPS_PATH})
6969
target_link_options_shared_lib(custom_ops)
7070

71+
target_link_options_shared_lib(quantized_ops_lib)
72+
7173
if(TARGET pthreadpool)
7274
set(LLAMA_JNI_SRCS jni/jni_layer_llama.cpp ../../backends/xnnpack/threadpool/cpuinfo_utils.cpp)
7375
else()
@@ -83,7 +85,7 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
8385
endif()
8486
target_include_directories(executorch_llama_jni PRIVATE ${_common_include_directories})
8587
target_link_libraries(executorch_llama_jni ${link_libraries} llama_runner
86-
custom_ops cpublas eigen_blas)
88+
custom_ops cpublas eigen_blas quantized_kernels quantized_ops_lib)
8789
target_compile_options(executorch_llama_jni PUBLIC ${_common_compile_options})
8890
if(EXECUTORCH_USE_TIKTOKEN)
8991
set(ABSL_ENABLE_INSTALL ON)

0 commit comments

Comments
 (0)