Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,9 @@ if(EXECUTORCH_BUILD_EXTENSION_LLM)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/cache)
list(APPEND _executorch_extensions extension_llm_cache)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/batching)
list(APPEND _executorch_extensions extension_llm_batching)
list(APPEND _executorch_extensions extension_llm_batching
extension_llm_batching_cell
)
endif()

if(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL)
Expand Down
20 changes: 19 additions & 1 deletion extension/llm/batching/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
# scheduler and the executor seam are header-only and free of ExecuTorch runtime
# types; the runner owns a thread, so this is a static library rather than an
# INTERFACE target.
#
# extension_llm_batching_cell is a separate target because it implements that
# seam against a program and a KV cache, and so carries the runtime types the
# seam itself is kept clear of.

if(NOT EXECUTORCH_ROOT)
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
Expand All @@ -26,8 +30,22 @@ target_compile_options(extension_llm_batching PUBLIC ${_common_compile_options})
find_package(Threads REQUIRED)
target_link_libraries(extension_llm_batching PUBLIC Threads::Threads)

add_library(extension_llm_batching_cell cell_executor.cpp)
target_link_libraries(
extension_llm_batching_cell
PUBLIC extension_llm_batching extension_llm_cache extension_module
extension_tensor
PRIVATE extension_llm_sampler
)
target_include_directories(
extension_llm_batching_cell PUBLIC ${_common_include_directories}
)
target_compile_options(
extension_llm_batching_cell PUBLIC ${_common_compile_options}
)

install(
TARGETS extension_llm_batching
TARGETS extension_llm_batching extension_llm_batching_cell
EXPORT ExecuTorchTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES
Expand Down
Loading
Loading