From bc29950ec13e44a0286dac8d7f425158eecba4ce Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Thu, 26 Jun 2025 20:42:46 -0700 Subject: [PATCH 1/2] Add llm runner into apple frameworks build Remove `EXECUTORCH_BUILD_EXTENSION_LLM` and promote `EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER` to be an overridable option. Enable it by default in llm and apple preset. --- tools/cmake/preset/apple_common.cmake | 2 ++ tools/cmake/preset/default.cmake | 2 +- tools/cmake/preset/llm.cmake | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/cmake/preset/apple_common.cmake b/tools/cmake/preset/apple_common.cmake index fa2d764dd2b..012c89e1b65 100644 --- a/tools/cmake/preset/apple_common.cmake +++ b/tools/cmake/preset/apple_common.cmake @@ -13,12 +13,14 @@ add_compile_options( -fdebug-prefix-map=${PROJECT_SOURCE_DIR}=/executorch ) +set_overridable_option(BUILD_TESTING OFF) set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON) set_overridable_option(EXECUTORCH_BUILD_COREML ON) set_overridable_option(EXECUTORCH_BUILD_MPS ON) set_overridable_option(EXECUTORCH_XNNPACK_SHARED_WORKSPACE ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_APPLE ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON) diff --git a/tools/cmake/preset/default.cmake b/tools/cmake/preset/default.cmake index 21f3cf53ae8..f66695938f0 100644 --- a/tools/cmake/preset/default.cmake +++ b/tools/cmake/preset/default.cmake @@ -90,7 +90,7 @@ define_overridable_option( BOOL OFF ) define_overridable_option( - EXECUTORCH_BUILD_EXTENSION_LLM + EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER "Build the LLM extension" BOOL OFF ) diff --git a/tools/cmake/preset/llm.cmake b/tools/cmake/preset/llm.cmake index da1364eb2ad..8d29b6edaae 100644 --- a/tools/cmake/preset/llm.cmake +++ b/tools/cmake/preset/llm.cmake @@ -8,8 +8,10 @@ # saving a few kB is less important than showing useful error information to # users. # keep sorted +set_overridable_option(BUILD_TESTING OFF) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_CUSTOM ON) From b2ad9cf220db2620268e1a4d18dece2a3f87dd2c Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Thu, 26 Jun 2025 20:50:20 -0700 Subject: [PATCH 2/2] Remove EXECUTORCH_BUILD_EXTENSION_LLM --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3225f0fc715..5b3e24d1dd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -544,10 +544,6 @@ if(EXECUTORCH_BUILD_EXTENSION_MODULE) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/module) endif() -if(EXECUTORCH_BUILD_EXTENSION_LLM) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/tokenizers) -endif() - if(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/runner) endif()