Skip to content

Rename quantized and optimized build options for OSS to follow the rest of options. #2664

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

Closed
wants to merge 1 commit into from
Closed
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/test_llama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cmake_install_executorch_libraries() {
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_REGISTER_OPTIMIZED_OPS=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-Bcmake-out .
cmake --build cmake-out -j9 --target install --config Release
Expand All @@ -59,7 +59,7 @@ cmake_build_llama_runner() {
retry cmake -DBUCK2="$BUCK" \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DEXECUTORCH_REGISTER_OPTIMIZED_OPS=ON \
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
-Bcmake-out/${dir} \
${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 @@ -24,7 +24,7 @@ build_cmake_quantized_aot_lib() {
&& retry cmake -DBUCK2=buck2 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DREGISTER_QUANTIZED_OPS=ON \
-DEXECUTORCH_BUILD_QUANTIZED=ON \
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)

cmake --build ${CMAKE_OUTPUT_DIR} -j4
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ option(EXECUTORCH_BUILD_PYBIND "Build the Python Bindings" OFF)

option(EXECUTORCH_BUILD_QNN "Build the Qualcomm backend" OFF)

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

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

option(EXECUTORCH_BUILD_SDK "Build the ExecuTorch SDK")

Expand Down Expand Up @@ -316,11 +316,11 @@ endif()
#
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/portable)

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

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

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

if(EXECUTORCH_REGISTER_OPTIMIZED_OPS)
if(EXECUTORCH_BUILD_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_REGISTER_QUANTIZED_OPS)
if(EXECUTORCH_BUILD_QUANTIZED)
list(APPEND _executor_runner_libs quantized_ops_lib)
endif()

Expand Down
8 changes: 4 additions & 4 deletions build/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ function(executorch_print_configuration_summary)
" EXECUTORCH_BUILD_PYBIND : ${EXECUTORCH_BUILD_PYBIND}")
message(
STATUS " EXECUTORCH_BUILD_QNN : ${EXECUTORCH_BUILD_QNN}")
message(
STATUS " EXECUTORCH_REGISTER_OPTIMIZED_OPS : ${EXECUTORCH_REGISTER_OPTIMIZED_OPS}")
message(
STATUS " EXECUTORCH_REGISTER_QUANTIZED_OPS : ${EXECUTORCH_REGISTER_QUANTIZED_OPS}")
message(STATUS " EXECUTORCH_BUILD_OPTIMIZED : "
"${EXECUTORCH_BUILD_OPTIMIZED}")
message(STATUS " EXECUTORCH_BUILD_QUANTIZED : "
"${EXECUTORCH_BUILD_QUANTIZED}")
message(
STATUS " EXECUTORCH_BUILD_SDK : ${EXECUTORCH_BUILD_SDK}")
message(
Expand Down
4 changes: 2 additions & 2 deletions build/build_apple_frameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ cmake_build() {
-DIOS_DEPLOYMENT_TARGET="$IOS_DEPLOYMENT_TARGET" \
-DEXECUTORCH_BUILD_COREML=$COREML \
-DEXECUTORCH_BUILD_MPS=$MPS \
-DEXECUTORCH_REGISTER_OPTIMIZED_OPS=$OPTIMIZED \
-DEXECUTORCH_REGISTER_QUANTIZED_OPS=$QUANTIZED \
-DEXECUTORCH_BUILD_OPTIMIZED=$OPTIMIZED \
-DEXECUTORCH_BUILD_QUANTIZED=$QUANTIZED \
-DEXECUTORCH_BUILD_XNNPACK=$XNNPACK \
${platform_flag:+-DIOS_PLATFORM=$platform_flag}
cmake --build . --config $MODE
Expand Down
2 changes: 1 addition & 1 deletion configurations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(_common_compile_options -Wno-deprecated-declarations)
include(${EXECUTORCH_ROOT}/build/Utils.cmake)
include(${EXECUTORCH_ROOT}/build/Codegen.cmake)

if(EXECUTORCH_REGISTER_OPTIMIZED_OPS)
if(EXECUTORCH_BUILD_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 examples/models/llama2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
cmake_minimum_required(VERSION 3.19)
project(llama_runner)

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

if(NOT PYTHON_EXECUTABLE)
set(PYTHON_EXECUTABLE python3)
Expand Down Expand Up @@ -57,7 +57,7 @@ add_subdirectory(runner)
set(link_options)
set(link_libraries)

if(EXECUTORCH_REGISTER_OPTIMIZED_OPS)
if(EXECUTORCH_BUILD_OPTIMIZED)
list(APPEND link_libraries optimized_native_cpu_ops_lib optimized_kernels portable_kernels)
list(APPEND link_options
"SHELL:LINKER:--whole-archive \
Expand Down
2 changes: 1 addition & 1 deletion examples/models/llama2/export_llama_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,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=<path-to-buck2> -DCMAKE_PREFIX_PATH=$TORCH_PACKAGE_DIR -DEXECUTORCH_REGISTER_QUANTIZED_OPS=ON ..) && cmake --build . -j16\n"
"rm -rf cmake-out && mkdir cmake-out && (cd cmake-out && cmake -DBUCK2=<path-to-buck2> -DCMAKE_PREFIX_PATH=$TORCH_PACKAGE_DIR -DEXECUTORCH_BUILD_QUANTIZED=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 <path to libquantized_ops_aot_lib.so\n"
)
Expand Down