Skip to content

Rename CMake EXECUTORCH_BUILD_KERNELS_CUSTOM to EXECUTORCH_BUILD_EXTENSION_LLM #5743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 2 additions & 2 deletions .ci/scripts/build_llama_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install_executorch_and_backend_lib() {
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DXNNPACK_ENABLE_ARM_BF16=OFF \
-Bcmake-android-out .

Expand All @@ -47,7 +47,7 @@ build_llama_runner() {
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-android-out/examples/models/llama2 examples/models/llama2

cmake --build cmake-android-out/examples/models/llama2 -j4 --config Release
Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/test_llama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ cmake_install_executorch_libraries() {
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
-DEXECUTORCH_BUILD_EXTENSION_LLM="$CUSTOM" \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
Expand All @@ -129,7 +129,7 @@ cmake_build_llama_runner() {
retry cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Debug \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
-DEXECUTORCH_BUILD_EXTENSION_LLM="$CUSTOM" \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/test_llava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ EXECUTORCH_COMMON_CMAKE_ARGS=" \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
Expand Down Expand Up @@ -68,7 +68,7 @@ LLAVA_COMMON_CMAKE_ARGS=" \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON"

Expand Down
4 changes: 2 additions & 2 deletions .ci/scripts/test_phi_3_mini.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cmake_install_executorch_libraries() {
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-B${BUILD_DIR} .

cmake --build ${BUILD_DIR} -j${NPROC} --target install --config ${BUILD_TYPE}
Expand All @@ -42,7 +42,7 @@ cmake_build_phi_3_mini() {
cmake -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
-DCMAKE_INSTALL_PREFIX=${BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
Expand All @@ -384,7 +384,7 @@ jobs:
cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
Expand Down
23 changes: 11 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ option(EXECUTORCH_BUILD_ARM_BAREMETAL

option(EXECUTORCH_BUILD_COREML "Build the Core ML backend" OFF)

option(EXECUTORCH_BUILD_KERNELS_CUSTOM "Build the custom kernels" OFF)

option(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT "Build the custom ops lib for AOT"
option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "Build the Data Loader extension"
OFF
)

option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "Build the Data Loader extension"
OFF
option(EXECUTORCH_BUILD_EXTENSION_LLM "Build the LLM extension" OFF)

option(EXECUTORCH_BUILD_EXTENSION_LLM_AOT
"Build the LLM extension custom ops lib for AOT" OFF
)

option(EXECUTORCH_BUILD_EXTENSION_MODULE "Build the Module extension" OFF)
Expand Down Expand Up @@ -229,12 +229,12 @@ cmake_dependent_option(
"NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF
)

if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
if(EXECUTORCH_BUILD_EXTENSION_LLM_AOT)
set(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
set(EXECUTORCH_BUILD_KERNELS_CUSTOM ON)
set(EXECUTORCH_BUILD_EXTENSION_LLM ON)
endif()

if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
if(EXECUTORCH_BUILD_EXTENSION_LLM)
set(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
endif()

Expand Down Expand Up @@ -786,10 +786,9 @@ if(EXECUTORCH_BUILD_PYBIND)
)
endif()

if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
# TODO: move all custom kernels to ${CMAKE_CURRENT_SOURCE_DIR}/kernels/custom
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/custom_ops)
endif()
if(EXECUTORCH_BUILD_EXTENSION_LLM)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extension/llm/custom_ops)
endif()

if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/quantized)
Expand Down
4 changes: 2 additions & 2 deletions backends/cadence/build_cadence_xtensa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if $STEPWISE_BUILD; then
-DEXECUTORCH_ENABLE_PROGRAM_VERIFICATION=ON \
-DEXECUTORCH_USE_DL=OFF \
-DBUILD_EXECUTORCH_PORTABLE_OPS=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=OFF \
-DEXECUTORCH_BUILD_EXTENSION_LLM=OFF \
-DPYTHON_EXECUTABLE=python3 \
-DEXECUTORCH_NNLIB_OPT=ON \
-DEXECUTORCH_BUILD_GFLAGS=ON \
Expand Down Expand Up @@ -74,7 +74,7 @@ else
-DEXECUTORCH_ENABLE_PROGRAM_VERIFICATION=ON \
-DEXECUTORCH_USE_DL=OFF \
-DBUILD_EXECUTORCH_PORTABLE_OPS=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=OFF \
-DEXECUTORCH_BUILD_EXTENSION_LLM=OFF \
-DPYTHON_EXECUTABLE=python3 \
-DEXECUTORCH_NNLIB_OPT=ON \
-DHAVE_FNMATCH_H=OFF \
Expand Down
6 changes: 3 additions & 3 deletions build/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ function(executorch_print_configuration_summary)
STATUS
" EXECUTORCH_BUILD_COREML : ${EXECUTORCH_BUILD_COREML}"
)
message(STATUS " EXECUTORCH_BUILD_KERNELS_CUSTOM : "
"${EXECUTORCH_BUILD_KERNELS_CUSTOM}"
message(STATUS " EXECUTORCH_BUILD_EXTENSION_LLM : "
"${EXECUTORCH_BUILD_EXTENSION_LLM}"
)
message(STATUS " EXECUTORCH_BUILD_EXECUTOR_RUNNER : "
"${EXECUTORCH_BUILD_EXECUTOR_RUNNER}"
Expand All @@ -68,7 +68,7 @@ function(executorch_print_configuration_summary)
message(STATUS " EXECUTORCH_BUILD_EXTENSION_TENSOR : "
"${EXECUTORCH_BUILD_EXTENSION_TENSOR}"
)
message(STATUS " EXECUTORCH_BUILD_EXTENSION_TRAINING : "
message(STATUS " EXECUTORCH_BUILD_EXTENSION_TRAINING : "
"${EXECUTORCH_BUILD_EXTENSION_TRAINING}"
)
message(
Expand Down
4 changes: 2 additions & 2 deletions build/build_android_llm_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ build_android_native_library() {
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_QNN="${EXECUTORCH_BUILD_QNN}" \
-DQNN_SDK_ROOT="${QNN_SDK_ROOT}" \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -61,7 +61,7 @@ build_android_native_library() {
-DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_ENABLE_LOGGING=ON \
-DEXECUTORCH_LOG_LEVEL=Info \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_LLAMA_JNI=ON \
-DCMAKE_BUILD_TYPE=Release \
-B"${CMAKE_OUT}"/extension/android
Expand Down
2 changes: 1 addition & 1 deletion build/build_apple_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ cmake_build() {
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=$CUSTOM \
-DEXECUTORCH_BUILD_EXTENSION_LLM=$CUSTOM \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we continue to apply this renaming to the rest of the kernels custom instances, does that mean we're gonna distribute extension llm package eventually on apple platforms together with the executorch runtime?
Please check out what it looks like now for the end users https://pytorch.org/executorch/main/apple-runtime.html
I guess kernels customer are in fact some kernels for llms?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shoumikhin Yeah, that makes sense to me. If we rename them to llm kernels, do I just need to update the frameworks build as well?

-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=$OPTIMIZED \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=$QUANTIZED \
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY="$(pwd)" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ llama3/Meta-Llama-3-8B-Instruct/tokenizer.model -p <path_to_params.json> -c <pat
-DQNN_SDK_ROOT=${QNN_SDK_ROOT} \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-android-out .

cmake --build cmake-android-out -j16 --target install --config Release
Expand All @@ -75,7 +75,7 @@ llama3/Meta-Llama-3-8B-Instruct/tokenizer.model -p <path_to_params.json> -c <pat
-DEXECUTORCH_BUILD_QNN=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-android-out/examples/models/llama2 examples/models/llama2

cmake --build cmake-android-out/examples/models/llama2 -j16 --config Release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ cmake -DPYTHON_EXECUTABLE=python \
-DQNN_SDK_ROOT=${QNN_SDK_ROOT} \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-out .
cmake --build cmake-out -j16 --target install --config Release
```
Expand All @@ -81,7 +81,7 @@ cmake -DPYTHON_EXECUTABLE=python \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_QNN=ON \
-Bcmake-out/examples/models/llama2 \
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cmake extension/android \
-DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_BUILD_LLAMA_JNI=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
-DCMAKE_BUILD_TYPE=Release \
-B"${CMAKE_OUT}"/extension/android
Expand Down
4 changes: 2 additions & 2 deletions examples/demo-apps/android/LlamaDemo/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DCMAKE_BUILD_TYPE=Release \
-B"${CMAKE_OUT}"

Expand All @@ -37,7 +37,7 @@ cmake extension/android \
-DANDROID_PLATFORM=android-23 \
-DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_LLAMA_JNI=ON \
-DCMAKE_BUILD_TYPE=Release \
-B"${CMAKE_OUT}"/extension/android
Expand Down
4 changes: 2 additions & 2 deletions examples/models/llama2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
endif()

# custom ops library
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
if(EXECUTORCH_BUILD_EXTENSION_LLM)
add_subdirectory(
${CMAKE_CURRENT_SOURCE_DIR}/../../../extension/llm/custom_ops
${CMAKE_CURRENT_BINARY_DIR}/../../../extension/llm/custom_ops
Expand Down Expand Up @@ -116,7 +116,7 @@ endif()
target_link_options_shared_lib(quantized_ops_lib)
list(APPEND link_libraries quantized_kernels quantized_ops_lib)

if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
if(EXECUTORCH_BUILD_EXTENSION_LLM)
target_link_options_shared_lib(custom_ops)
list(APPEND link_libraries custom_ops)
endif()
Expand Down
8 changes: 4 additions & 4 deletions examples/models/llama2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ The Wikitext results generated above used: `{max_seq_len: 2048, limit: 1000}`
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-out .

cmake --build cmake-out -j16 --target install --config Release
Expand All @@ -303,7 +303,7 @@ Note for Mac users: There's a known linking issue with Xcode 15.1. Refer to the
cmake -DPYTHON_EXECUTABLE=python \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
Expand Down Expand Up @@ -345,7 +345,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-out-android .

cmake --build cmake-out-android -j16 --target install --config Release
Expand All @@ -362,7 +362,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-out-android/examples/models/llama2 \
examples/models/llama2

Expand Down
4 changes: 2 additions & 2 deletions examples/models/llava/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
endif()

# custom ops library
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
if(EXECUTORCH_BUILD_EXTENSION_LLM)
add_subdirectory(
${EXECUTORCH_ROOT}/extension/llm/custom_ops
${CMAKE_CURRENT_BINARY_DIR}/../../../extension/llm/custom_ops
Expand Down Expand Up @@ -132,7 +132,7 @@ endif()
target_link_options_shared_lib(quantized_ops_lib)
list(APPEND link_libraries quantized_kernels quantized_ops_lib)

if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
if(EXECUTORCH_BUILD_EXTENSION_LLM)
target_link_options_shared_lib(custom_ops)
list(APPEND link_libraries custom_ops)
endif()
Expand Down
4 changes: 2 additions & 2 deletions examples/models/phi-3-mini/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ python -m examples.models.phi-3-mini.export_phi-3-mini -c "4k" -s 128 -o phi-3-m
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-Bcmake-out .

cmake --build cmake-out -j16 --target install --config Release
Expand All @@ -42,7 +42,7 @@ python -m examples.models.phi-3-mini.export_phi-3-mini -c "4k" -s 128 -o phi-3-m
cmake -DPYTHON_EXECUTABLE=python \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_EXTENSION_LLM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
Expand Down
2 changes: 1 addition & 1 deletion extension/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if(TARGET vulkan_backend)
list(APPEND link_libraries vulkan_backend)
endif()

if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
if(EXECUTORCH_BUILD_EXTENSION_LLM)
add_subdirectory(
${EXECUTORCH_ROOT}/extension/llm/custom_ops
${CMAKE_CURRENT_BINARY_DIR}/../../extension/llm/custom_ops
Expand Down
2 changes: 1 addition & 1 deletion extension/llm/custom_ops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ target_compile_options(

install(TARGETS custom_ops DESTINATION lib)

if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
if(EXECUTORCH_BUILD_EXTENSION_LLM_AOT)
# Add a AOT library
find_package(Torch CONFIG REQUIRED)
add_library(
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def pybindings(cls) -> bool:

@classmethod
def llama_custom_ops(cls) -> bool:
return cls._is_env_enabled("EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT", default=True)
return cls._is_env_enabled("EXECUTORCH_BUILD_EXTENSION_LLM_AOT", default=True)

@classmethod
def flatc(cls) -> bool:
Expand Down Expand Up @@ -542,8 +542,8 @@ def run(self):

if ShouldBuild.llama_custom_ops():
cmake_args += [
"-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON", # add llama sdpa ops to pybindings.
"-DEXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=ON",
"-DEXECUTORCH_BUILD_EXTENSION_LLM=ON", # add llama sdpa ops to pybindings.
"-DEXECUTORCH_BUILD_EXTENSION_LLM_AOT=ON",
"-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON", # add quantized ops to pybindings.
"-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON",
]
Expand Down
Loading