Skip to content

Commit

Permalink
Add suffixes to cmake flags related to building kernels. (pytorch#3499)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#3499

.

Reviewed By: cccclai

Differential Revision: D56917214

fbshipit-source-id: 6dbb4c1f5c981e7da9215469d6e38a90bc731515
  • Loading branch information
shoumikhin authored and facebook-github-bot committed May 3, 2024
1 parent 494f981 commit b9488fe
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 71 deletions.
6 changes: 3 additions & 3 deletions .ci/scripts/build_llama_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ install_executorch_and_backend_lib() {
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DXNNPACK_ENABLE_ARM_BF16=OFF \
-Bcmake-android-out .

Expand All @@ -42,7 +42,7 @@ build_llama_runner() {
-DANDROID_PLATFORM=android-23 \
-DCMAKE_INSTALL_PREFIX=cmake-android-out \
-DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=python \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-Bcmake-android-out/examples/models/llama2 examples/models/llama2

cmake --build cmake-android-out/examples/models/llama2 -j4 --config Release
Expand Down
10 changes: 5 additions & 5 deletions .ci/scripts/test_llama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ cmake_install_executorch_libraries() {
-DCMAKE_BUILD_TYPE=Debug \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_CUSTOM="$CUSTOM" \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-Bcmake-out .
Expand All @@ -88,8 +88,8 @@ cmake_build_llama_runner() {
retry cmake -DBUCK2="$BUCK" \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Debug \
-DEXECUTORCH_BUILD_CUSTOM="$CUSTOM" \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM="$CUSTOM" \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK="$XNNPACK" \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-Bcmake-out/${dir} \
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/test_quantized_aot_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build_cmake_quantized_aot_lib() {
&& cd ${CMAKE_OUTPUT_DIR} \
&& retry cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DEXECUTORCH_BUILD_QUANTIZED_OPS_AOT=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)

cmake --build ${CMAKE_OUTPUT_DIR} -j4
Expand Down
34 changes: 18 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ option(EXECUTORCH_BUILD_ARM_BAREMETAL

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

option(EXECUTORCH_BUILD_CUSTOM "Build the custom kernels" OFF)
option(EXECUTORCH_BUILD_KERNELS_CUSTOM "Build the custom kernels" OFF)

option(EXECUTORCH_BUILD_CUSTOM_OPS_AOT "Build the custom ops lib for AOT" OFF)
option(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT "Build the custom ops lib for AOT"
OFF
)

option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "Build the Data Loader extension"
OFF
Expand All @@ -171,9 +173,9 @@ option(EXECUTORCH_BUILD_PYBIND "Build the Python Bindings" OFF)

option(EXECUTORCH_BUILD_QNN "Build the Qualcomm backend" OFF)

option(EXECUTORCH_BUILD_OPTIMIZED "Build the optimized kernels" OFF)
option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED "Build the optimized kernels" OFF)

option(EXECUTORCH_BUILD_QUANTIZED "Build the quantized kernels" OFF)
option(EXECUTORCH_BUILD_KERNELS_QUANTIZED "Build the quantized kernels" OFF)

option(EXECUTORCH_BUILD_SDK "Build the ExecuTorch SDK")

Expand All @@ -199,12 +201,12 @@ cmake_dependent_option(
"NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF
)

if(EXECUTORCH_BUILD_CUSTOM_OPS_AOT)
set(EXECUTORCH_BUILD_CUSTOM ON)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
set(EXECUTORCH_BUILD_KERNELS_CUSTOM ON)
endif()

if(EXECUTORCH_BUILD_CUSTOM)
set(EXECUTORCH_BUILD_OPTIMIZED ON)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
set(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
endif()

if(EXECUTORCH_BUILD_CPUINFO)
Expand Down Expand Up @@ -443,18 +445,18 @@ target_link_options_shared_lib(executorch)
#
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/portable)

if(EXECUTORCH_BUILD_CUSTOM)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
# TODO: move all custom kernels to ${CMAKE_CURRENT_SOURCE_DIR}/kernels/custom
add_subdirectory(
${CMAKE_CURRENT_SOURCE_DIR}/examples/models/llama2/custom_ops
)
endif()

if(EXECUTORCH_BUILD_OPTIMIZED)
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/optimized)
endif()

if(EXECUTORCH_BUILD_QUANTIZED)
if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/quantized)
endif()

Expand Down Expand Up @@ -492,14 +494,14 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
# Baseline libraries that executor_runner will link against.
set(_executor_runner_libs executorch gflags)

if(EXECUTORCH_BUILD_OPTIMIZED)
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
list(APPEND _executor_runner_libs optimized_native_cpu_ops_lib)
else()
list(APPEND _executor_runner_libs portable_ops_lib)
endif()

# Generate lib to register quantized ops
if(EXECUTORCH_BUILD_QUANTIZED)
if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
list(APPEND _executor_runner_libs quantized_ops_lib)
endif()

Expand Down Expand Up @@ -606,19 +608,19 @@ if(EXECUTORCH_BUILD_PYBIND)
list(APPEND _dep_libs xnnpack_backend XNNPACK)
endif()

if(EXECUTORCH_BUILD_QUANTIZED)
if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
target_link_options_shared_lib(quantized_ops_lib)
list(APPEND _dep_libs quantized_kernels quantized_ops_lib)
endif()

# TODO(larryliu): Fix macOS 2 dylibs having 2 sets of static variables issue
if(EXECUTORCH_BUILD_CUSTOM_OPS_AOT AND NOT APPLE)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT AND NOT APPLE)
list(APPEND _dep_libs custom_ops_aot_lib)
endif()
# TODO(laryliu): Fix linux duplicate registation problem. In GH CI worker
# libcustom_ops.a doesn't dedup with the one indirectly linked from
# libcustom_ops_aot_lib.a
if(EXECUTORCH_BUILD_CUSTOM AND APPLE)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM AND APPLE)
target_link_options_shared_lib(custom_ops)
list(APPEND _dep_libs custom_ops)
endif()
Expand Down
2 changes: 1 addition & 1 deletion backends/vulkan/docs/android_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ binary using the Android NDK toolchain.
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_VULKAN=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DPYTHON_EXECUTABLE=python \
-Bcmake-android-out && \
cmake --build cmake-android-out -j16 --target install)
Expand Down
12 changes: 6 additions & 6 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_CUSTOM : "
"${EXECUTORCH_BUILD_CUSTOM}"
message(STATUS " EXECUTORCH_BUILD_KERNELS_CUSTOM : "
"${EXECUTORCH_BUILD_KERNELS_CUSTOM}"
)
message(STATUS " EXECUTORCH_BUILD_EXECUTOR_RUNNER : "
"${EXECUTORCH_BUILD_EXECUTOR_RUNNER}"
Expand Down Expand Up @@ -90,11 +90,11 @@ function(executorch_print_configuration_summary)
message(
STATUS " EXECUTORCH_BUILD_QNN : ${EXECUTORCH_BUILD_QNN}"
)
message(STATUS " EXECUTORCH_BUILD_OPTIMIZED : "
"${EXECUTORCH_BUILD_OPTIMIZED}"
message(STATUS " EXECUTORCH_BUILD_KERNELS_OPTIMIZED : "
"${EXECUTORCH_BUILD_KERNELS_OPTIMIZED}"
)
message(STATUS " EXECUTORCH_BUILD_QUANTIZED : "
"${EXECUTORCH_BUILD_QUANTIZED}"
message(STATUS " EXECUTORCH_BUILD_KERNELS_QUANTIZED : "
"${EXECUTORCH_BUILD_KERNELS_QUANTIZED}"
)
message(
STATUS " EXECUTORCH_BUILD_SDK : ${EXECUTORCH_BUILD_SDK}"
Expand Down
6 changes: 3 additions & 3 deletions build/build_apple_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ cmake_build() {
-DEXECUTORCH_BUILD_EXTENSION_APPLE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_CUSTOM=$CUSTOM \
-DEXECUTORCH_BUILD_OPTIMIZED=$OPTIMIZED \
-DEXECUTORCH_BUILD_QUANTIZED=$QUANTIZED \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=$CUSTOM \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=$OPTIMIZED \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=$QUANTIZED \
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY="$(pwd)" \
${platform_flag:+-DPLATFORM=$platform_flag} \
${platform_target:+-DDEPLOYMENT_TARGET=$platform_target} \
Expand Down
2 changes: 1 addition & 1 deletion configurations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(_common_compile_options -Wno-deprecated-declarations)
include(${EXECUTORCH_ROOT}/build/Utils.cmake)
include(${EXECUTORCH_ROOT}/build/Codegen.cmake)

if(EXECUTORCH_BUILD_OPTIMIZED)
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
# Merge optimized and portable definitions, taking optimized where available.
merge_yaml(
FUNCTIONS_YAML ${EXECUTORCH_ROOT}/kernels/optimized/optimized-oss.yaml
Expand Down
4 changes: 2 additions & 2 deletions docs/source/llm/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set options for executorch build.
option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "" ON)
option(EXECUTORCH_BUILD_EXTENSION_MODULE "" ON)
option(EXECUTORCH_BUILD_OPTIMIZED "" ON)
option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED "" ON)
# Include the executorch subdirectory.
add_subdirectory(
Expand Down Expand Up @@ -521,7 +521,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set options for executorch build.
option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "" ON)
option(EXECUTORCH_BUILD_EXTENSION_MODULE "" ON)
option(EXECUTORCH_BUILD_OPTIMIZED "" ON)
option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED "" ON)
option(EXECUTORCH_BUILD_XNNPACK "" ON) # Build with Xnnpack backend
# Include the executorch subdirectory.
Expand Down
6 changes: 3 additions & 3 deletions examples/arm/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function build_quantization_aot_lib()
cmake -DBUCK2=${buck2} \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_XNNPACK=OFF \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DEXECUTORCH_BUILD_QUANTIZED_OPS_AOT=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON \
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DPYTHON_EXECUTABLE=python3 \
-Bcmake-out-aot-lib \
Expand All @@ -101,7 +101,7 @@ function build_executorch() {
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_ENABLE_LOGGING=ON \
-DEXECUTORCH_BUILD_ARM_BAREMETAL=ON \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
-DFLATC_EXECUTABLE="$(which flatc)" \
-DCMAKE_TOOLCHAIN_FILE="${toolchain_cmake}" \
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-apps/android/ExecuTorchDemo/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DCMAKE_BUILD_TYPE=Release \
-B"${CMAKE_OUT}"

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 @@ -15,7 +15,7 @@ cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_QNN=ON \
-DQNN_SDK_ROOT="${QNN_SDK_ROOT}" \
-DCMAKE_BUILD_TYPE=Release \
Expand Down
10 changes: 5 additions & 5 deletions examples/demo-apps/android/LlamaDemo/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DEXECUTORCH_BUILD_CUSTOM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DCMAKE_BUILD_TYPE=Release \
-B"${CMAKE_OUT}"

Expand All @@ -34,8 +34,8 @@ cmake examples/models/llama2 \
-DANDROID_ABI="$ANDROID_ABI" \
-DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
-DEXECUTORCH_USE_TIKTOKEN="${EXECUTORCH_USE_TIKTOKEN}" \
-DEXECUTORCH_BUILD_CUSTOM=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DCMAKE_BUILD_TYPE=Release \
-B"${CMAKE_OUT}"/examples/models/llama2
Expand Down
2 changes: 1 addition & 1 deletion examples/llm_manual/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
# Set options for executorch build.
option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER "" ON)
option(EXECUTORCH_BUILD_EXTENSION_MODULE "" ON)
option(EXECUTORCH_BUILD_OPTIMIZED "" ON)
option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED "" ON)
option(EXECUTORCH_BUILD_XNNPACK "" ON) # Build with Xnnpack backend

# Include the executorch subdirectory.
Expand Down
8 changes: 4 additions & 4 deletions examples/models/llama2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cmake_minimum_required(VERSION 3.19)
project(llama_runner)

# Duplicating options as root CMakeLists.txt
option(EXECUTORCH_BUILD_OPTIMIZED "Build the optimized kernels" OFF)
option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED "Build the optimized kernels" OFF)

option(EXECUTORCH_USE_TIKTOKEN "Use Tiktoken as a tokenizer" OFF)

Expand Down Expand Up @@ -85,7 +85,7 @@ if(CMAKE_TOOLCHAIN_IOS OR ANDROID)
endif()

# custom ops library
if(EXECUTORCH_BUILD_CUSTOM)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
add_subdirectory(custom_ops)
endif()

Expand All @@ -106,7 +106,7 @@ endif()
set(link_libraries gflags)
set(_srcs main.cpp)

if(EXECUTORCH_BUILD_OPTIMIZED)
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
list(
APPEND
link_libraries
Expand All @@ -126,7 +126,7 @@ endif()
target_link_options_shared_lib(quantized_ops_lib)
list(APPEND link_libraries quantized_kernels quantized_ops_lib)

if(EXECUTORCH_BUILD_CUSTOM)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
target_link_options_shared_lib(custom_ops)
list(APPEND link_libraries custom_ops)
endif()
Expand Down
16 changes: 8 additions & 8 deletions examples/models/llama2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ The Wikitext results generated above used: `{max_seq_len: 2048, limit: 1000}`
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_CUSTOM=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-Bcmake-out .
cmake --build cmake-out -j16 --target install --config Release
Expand All @@ -174,10 +174,10 @@ The Wikitext results generated above used: `{max_seq_len: 2048, limit: 1000}`
cmake -DPYTHON_EXECUTABLE=python \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_CUSTOM=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-Bcmake-out/examples/models/llama2 \
examples/models/llama2
Expand Down Expand Up @@ -215,7 +215,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DEXECUTORCH_ENABLE_LOGGING=1 \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DPYTHON_EXECUTABLE=python \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-Bcmake-out-android .

cmake --build cmake-out-android -j16 --target install --config Release
Expand All @@ -229,7 +229,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
-DCMAKE_INSTALL_PREFIX=cmake-out-android \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE=python \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-Bcmake-out-android/examples/models/llama2 \
examples/models/llama2

Expand Down
2 changes: 1 addition & 1 deletion examples/models/llama2/custom_ops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ target_compile_options(

install(TARGETS custom_ops DESTINATION lib)

if(EXECUTORCH_BUILD_CUSTOM_OPS_AOT)
if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
# Add a AOT library
find_package(Torch CONFIG REQUIRED)
add_library(
Expand Down
Loading

0 comments on commit b9488fe

Please sign in to comment.