diff --git a/.ci/scripts/build_llama_android.sh b/.ci/scripts/build_llama_android.sh index eb1221620c..42843da1b2 100644 --- a/.ci/scripts/build_llama_android.sh +++ b/.ci/scripts/build_llama_android.sh @@ -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 . @@ -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 diff --git a/.ci/scripts/test_llama.sh b/.ci/scripts/test_llama.sh index 94528613e3..8dd3bda81a 100644 --- a/.ci/scripts/test_llama.sh +++ b/.ci/scripts/test_llama.sh @@ -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 . @@ -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} \ diff --git a/.ci/scripts/test_quantized_aot_lib.sh b/.ci/scripts/test_quantized_aot_lib.sh index 610144f80d..3f8ea886f5 100755 --- a/.ci/scripts/test_quantized_aot_lib.sh +++ b/.ci/scripts/test_quantized_aot_lib.sh @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 098df5c16d..3b4c31a131 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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") @@ -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) @@ -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() @@ -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() @@ -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() diff --git a/backends/vulkan/docs/android_demo.md b/backends/vulkan/docs/android_demo.md index f9fc35657a..34e5d63ed2 100644 --- a/backends/vulkan/docs/android_demo.md +++ b/backends/vulkan/docs/android_demo.md @@ -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) diff --git a/build/Utils.cmake b/build/Utils.cmake index 0a79627c8a..56fc1e104b 100644 --- a/build/Utils.cmake +++ b/build/Utils.cmake @@ -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}" @@ -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}" diff --git a/build/build_apple_frameworks.sh b/build/build_apple_frameworks.sh index de794c6264..73635c3f90 100755 --- a/build/build_apple_frameworks.sh +++ b/build/build_apple_frameworks.sh @@ -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} \ diff --git a/configurations/CMakeLists.txt b/configurations/CMakeLists.txt index ba05f67df3..54a37e5923 100644 --- a/configurations/CMakeLists.txt +++ b/configurations/CMakeLists.txt @@ -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 diff --git a/docs/source/llm/getting-started.md b/docs/source/llm/getting-started.md index bdbdbddab4..8f1f2d3cdf 100644 --- a/docs/source/llm/getting-started.md +++ b/docs/source/llm/getting-started.md @@ -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( @@ -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. diff --git a/examples/arm/run.sh b/examples/arm/run.sh index bb3e63b901..fcea986939 100755 --- a/examples/arm/run.sh +++ b/examples/arm/run.sh @@ -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 \ @@ -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}" \ diff --git a/examples/demo-apps/android/ExecuTorchDemo/setup.sh b/examples/demo-apps/android/ExecuTorchDemo/setup.sh index 8ff65bee59..05dc3e4492 100644 --- a/examples/demo-apps/android/ExecuTorchDemo/setup.sh +++ b/examples/demo-apps/android/ExecuTorchDemo/setup.sh @@ -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}" diff --git a/examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh b/examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh index a3284ec783..1ee0a450b8 100644 --- a/examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh +++ b/examples/demo-apps/android/LlamaDemo/setup-with-qnn.sh @@ -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 \ diff --git a/examples/demo-apps/android/LlamaDemo/setup.sh b/examples/demo-apps/android/LlamaDemo/setup.sh index 212e214d37..4c30695a27 100644 --- a/examples/demo-apps/android/LlamaDemo/setup.sh +++ b/examples/demo-apps/android/LlamaDemo/setup.sh @@ -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}" @@ -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 diff --git a/examples/llm_manual/CMakeLists.txt b/examples/llm_manual/CMakeLists.txt index 89c3619c6b..185665180f 100644 --- a/examples/llm_manual/CMakeLists.txt +++ b/examples/llm_manual/CMakeLists.txt @@ -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. diff --git a/examples/models/llama2/CMakeLists.txt b/examples/models/llama2/CMakeLists.txt index 0a3494a5a6..5044a5ce9b 100644 --- a/examples/models/llama2/CMakeLists.txt +++ b/examples/models/llama2/CMakeLists.txt @@ -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) @@ -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() @@ -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 @@ -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() diff --git a/examples/models/llama2/README.md b/examples/models/llama2/README.md index 19f386eb31..f07a315763 100644 --- a/examples/models/llama2/README.md +++ b/examples/models/llama2/README.md @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/examples/models/llama2/custom_ops/CMakeLists.txt b/examples/models/llama2/custom_ops/CMakeLists.txt index 6285278abd..761e9f273f 100644 --- a/examples/models/llama2/custom_ops/CMakeLists.txt +++ b/examples/models/llama2/custom_ops/CMakeLists.txt @@ -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( diff --git a/examples/models/llama2/lib/quant_lib.py b/examples/models/llama2/lib/quant_lib.py index e1f0827a64..06a47b8146 100644 --- a/examples/models/llama2/lib/quant_lib.py +++ b/examples/models/llama2/lib/quant_lib.py @@ -107,7 +107,7 @@ def check_embedding_byte_registered(): 'Use `python -c "import torch as _; print(_.__path__)"` to find where torch package is installed.\n' "Set that as TORCH_PACKAGE_DIR.\n" "Then from root executorch dir do the following:\n" - "rm -rf cmake-out && mkdir cmake-out && (cd cmake-out && cmake -DBUCK2= -DCMAKE_PREFIX_PATH=$TORCH_PACKAGE_DIR -DEXECUTORCH_BUILD_QUANTIZED_OPS_AOT=ON ..) && cmake --build . -j16\n" + "rm -rf cmake-out && mkdir cmake-out && (cd cmake-out && cmake -DBUCK2= -DCMAKE_PREFIX_PATH=$TORCH_PACKAGE_DIR -DEXECUTORCH_BUILD_KERNELS_QUANTIZED_AOT=ON ..) && cmake --build . -j16\n" 'To find the location of the lib: find cmake-out -name "libquantized_ops_aot_lib*"\n' "Then specify the said library via -s bool: @classmethod @property def llama_custom_ops(cls) -> bool: - return cls._is_env_enabled("EXECUTORCH_BUILD_CUSTOM_OPS_AOT", default=True) + return cls._is_env_enabled("EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT", default=True) class Version: @@ -451,7 +451,7 @@ def run(self): if ShouldBuild.pybindings: cmake_args += [ "-DEXECUTORCH_BUILD_PYBIND=ON", - "-DEXECUTORCH_BUILD_QUANTIZED=ON", # add quantized ops to pybindings. + "-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON", # add quantized ops to pybindings. ] build_args += ["--target", "portable_lib"] # To link backends into the portable_lib target, callers should @@ -460,8 +460,8 @@ def run(self): if ShouldBuild.llama_custom_ops: cmake_args += [ - "-DEXECUTORCH_BUILD_CUSTOM=ON", # add llama sdpa ops to pybindings. - "-DEXECUTORCH_BUILD_CUSTOM_OPS_AOT=ON", + "-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON", # add llama sdpa ops to pybindings. + "-DEXECUTORCH_BUILD_KERNELS_CUSTOM_AOT=ON", ] build_args += ["--target", "custom_ops_aot_lib"] # Allow adding extra cmake args through the environment. Used by some