@@ -187,6 +187,10 @@ option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR "Build the Flat Tensor extension"
187187 OFF
188188)
189189
190+ option (EXECUTORCH_BUILD_EXTENSION_LLM "Build the LLM extension"
191+ OFF
192+ )
193+
190194option (EXECUTORCH_BUILD_EXTENSION_MODULE "Build the Module extension" OFF )
191195
192196option (EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL "Build the Runner Util extension"
@@ -246,7 +250,7 @@ cmake_dependent_option(
246250)
247251
248252if (EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR)
249- set (EXECUTORCH_BUILF_EXTENSION_DATA_LOADER ON )
253+ set (EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON )
250254endif ()
251255
252256if (EXECUTORCH_BUILD_EXTENSION_TRAINING)
@@ -349,6 +353,7 @@ if(EXECUTORCH_BUILD_PTHREADPOOL)
349353endif ()
350354
351355if (EXECUTORCH_BUILD_TESTS)
356+ set (EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON )
352357 include (CTest)
353358endif ()
354359
@@ -374,7 +379,7 @@ if(NOT "${_repo_dir_name}" STREQUAL "executorch")
374379 "fix for this restriction."
375380 )
376381endif ()
377- set (_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR} /.. ${CMAKE_CURRENT_SOURCE_DIR} /runtime/core/portable_type)
382+ set (_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR} /.. ${CMAKE_CURRENT_SOURCE_DIR} /runtime/core/portable_type/c10 )
378383
379384#
380385# The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}.
@@ -719,6 +724,10 @@ if(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR)
719724 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/flat_tensor/serialize)
720725endif ()
721726
727+ if (EXECUTORCH_BUILD_EXTENSION_LLM)
728+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/llm/tokenizer)
729+ endif ()
730+
722731if (EXECUTORCH_BUILD_EXTENSION_MODULE)
723732 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /extension/module)
724733endif ()
@@ -754,9 +763,7 @@ if(EXECUTORCH_BUILD_PYBIND)
754763 endif ()
755764
756765 # find pytorch lib, to allow pybind to take at::Tensor as input/output
757- if (NOT TARGET torch)
758- find_package (Torch CONFIG REQUIRED)
759- endif ()
766+ find_package_torch()
760767 find_library (
761768 TORCH_PYTHON_LIBRARY torch_python PATHS "${TORCH_INSTALL_PREFIX} /lib"
762769 )
0 commit comments