From fea397af69665144b7cdf2c847d9e6387bdf1e22 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 16 Sep 2025 16:53:40 -0700 Subject: [PATCH 1/2] Android use new llm runner deps --- extension/android/CMakeLists.txt | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/extension/android/CMakeLists.txt b/extension/android/CMakeLists.txt index be6715f93d5..f702fbefd61 100644 --- a/extension/android/CMakeLists.txt +++ b/extension/android/CMakeLists.txt @@ -168,27 +168,8 @@ endif() if(EXECUTORCH_BUILD_LLAMA_JNI) target_sources(executorch_jni PRIVATE jni/jni_layer_llama.cpp jni/log.cpp) - list(APPEND link_libraries llama_runner llava_runner) + list(APPEND link_libraries extension_llm_runner) target_compile_definitions(executorch_jni PUBLIC EXECUTORCH_BUILD_LLAMA_JNI=1) - add_subdirectory( - ${EXECUTORCH_ROOT}/examples/models/llava/runner - ${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llava/runner - ) - - add_subdirectory( - ${EXECUTORCH_ROOT}/examples/models/llama/runner - ${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llama/runner - ) - - target_sources( - executorch_jni - PRIVATE ${EXECUTORCH_ROOT}/extension/llm/runner/llm_runner_helper.cpp - ) - - target_include_directories( - executorch_jni PRIVATE ${EXECUTORCH_ROOT}/extension/llm/runner - ) - if(QNN_SDK_ROOT) target_sources( executorch_jni From d4608d2818e1953411c77579be9fa40690fb4ecf Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Wed, 17 Sep 2025 12:16:29 -0700 Subject: [PATCH 2/2] Fix QNN part --- examples/qualcomm/oss_scripts/llama/runner/runner.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/qualcomm/oss_scripts/llama/runner/runner.cpp b/examples/qualcomm/oss_scripts/llama/runner/runner.cpp index 253e083a80e..fc4ff006a90 100644 --- a/examples/qualcomm/oss_scripts/llama/runner/runner.cpp +++ b/examples/qualcomm/oss_scripts/llama/runner/runner.cpp @@ -182,8 +182,7 @@ Error Runner::load() { eos_ids->insert(tokenizer_->encode("<|eot|>", 0, 0).get()[0]); eos_ids->insert(tokenizer_->encode("<|end_of_text|>", 0, 0).get()[0]); } else { - tokenizer_ = - example::load_llama_tokenizer(tokenizer_path_, Version::Default); + tokenizer_ = llm::load_tokenizer(tokenizer_path_); if (tokenizer_ == nullptr) { ET_LOG( Error, "Failed to load tokenizer with %s", tokenizer_path_.c_str());