Skip to content

Commit 4111b3f

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Rename quantized and optimized build options for OSS to follow the rest of options. (#2664)
Summary: Pull Request resolved: #2664 bypass-github-export-checks Reviewed By: atalman, kirklandsign Differential Revision: D55262462 fbshipit-source-id: 7befd0ad58aa3701dc4fc3161e1baf298ed5c492
1 parent 682d9ac commit 4111b3f

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

.ci/scripts/test_llama.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ cmake_install_executorch_libraries() {
4747
-DCMAKE_BUILD_TYPE=Release \
4848
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
4949
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
50-
-DEXECUTORCH_REGISTER_OPTIMIZED_OPS=ON \
50+
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
5151
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
5252
-Bcmake-out .
5353
cmake --build cmake-out -j9 --target install --config Release
@@ -59,7 +59,7 @@ cmake_build_llama_runner() {
5959
retry cmake -DBUCK2="$BUCK" \
6060
-DCMAKE_INSTALL_PREFIX=cmake-out \
6161
-DCMAKE_BUILD_TYPE=Release \
62-
-DEXECUTORCH_REGISTER_OPTIMIZED_OPS=ON \
62+
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
6363
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
6464
-Bcmake-out/${dir} \
6565
${dir}

.ci/scripts/test_quantized_aot_lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ build_cmake_quantized_aot_lib() {
2424
&& retry cmake -DBUCK2=buck2 \
2525
-DCMAKE_BUILD_TYPE=Release \
2626
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
27-
-DREGISTER_QUANTIZED_OPS=ON \
27+
-DEXECUTORCH_BUILD_QUANTIZED=ON \
2828
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" ..)
2929

3030
cmake --build ${CMAKE_OUTPUT_DIR} -j4

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ option(EXECUTORCH_BUILD_PYBIND "Build the Python Bindings" OFF)
158158

159159
option(EXECUTORCH_BUILD_QNN "Build the Qualcomm backend" OFF)
160160

161-
option(EXECUTORCH_REGISTER_OPTIMIZED_OPS "Build the optimized kernels" OFF)
161+
option(EXECUTORCH_BUILD_OPTIMIZED "Build the optimized kernels" OFF)
162162

163-
option(EXECUTORCH_REGISTER_QUANTIZED_OPS "Build the quantized kernels" OFF)
163+
option(EXECUTORCH_BUILD_QUANTIZED "Build the quantized kernels" OFF)
164164

165165
option(EXECUTORCH_BUILD_SDK "Build the ExecuTorch SDK")
166166

@@ -316,11 +316,11 @@ endif()
316316
#
317317
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/portable)
318318

319-
if(EXECUTORCH_REGISTER_OPTIMIZED_OPS)
319+
if(EXECUTORCH_BUILD_OPTIMIZED)
320320
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/optimized)
321321
endif()
322322

323-
if(EXECUTORCH_REGISTER_QUANTIZED_OPS)
323+
if(EXECUTORCH_BUILD_QUANTIZED)
324324
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/quantized)
325325
endif()
326326

@@ -354,14 +354,14 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
354354
# Baseline libraries that executor_runner will link against.
355355
set(_executor_runner_libs executorch gflags)
356356

357-
if(EXECUTORCH_REGISTER_OPTIMIZED_OPS)
357+
if(EXECUTORCH_BUILD_OPTIMIZED)
358358
list(APPEND _executor_runner_libs optimized_native_cpu_ops_lib)
359359
else()
360360
list(APPEND _executor_runner_libs portable_ops_lib)
361361
endif()
362362

363363
# Generate lib to register quantized ops
364-
if(EXECUTORCH_REGISTER_QUANTIZED_OPS)
364+
if(EXECUTORCH_BUILD_QUANTIZED)
365365
list(APPEND _executor_runner_libs quantized_ops_lib)
366366
endif()
367367

build/Utils.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ function(executorch_print_configuration_summary)
7272
" EXECUTORCH_BUILD_PYBIND : ${EXECUTORCH_BUILD_PYBIND}")
7373
message(
7474
STATUS " EXECUTORCH_BUILD_QNN : ${EXECUTORCH_BUILD_QNN}")
75-
message(
76-
STATUS " EXECUTORCH_REGISTER_OPTIMIZED_OPS : ${EXECUTORCH_REGISTER_OPTIMIZED_OPS}")
77-
message(
78-
STATUS " EXECUTORCH_REGISTER_QUANTIZED_OPS : ${EXECUTORCH_REGISTER_QUANTIZED_OPS}")
75+
message(STATUS " EXECUTORCH_BUILD_OPTIMIZED : "
76+
"${EXECUTORCH_BUILD_OPTIMIZED}")
77+
message(STATUS " EXECUTORCH_BUILD_QUANTIZED : "
78+
"${EXECUTORCH_BUILD_QUANTIZED}")
7979
message(
8080
STATUS " EXECUTORCH_BUILD_SDK : ${EXECUTORCH_BUILD_SDK}")
8181
message(

build/build_apple_frameworks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ cmake_build() {
131131
-DIOS_DEPLOYMENT_TARGET="$IOS_DEPLOYMENT_TARGET" \
132132
-DEXECUTORCH_BUILD_COREML=$COREML \
133133
-DEXECUTORCH_BUILD_MPS=$MPS \
134-
-DEXECUTORCH_REGISTER_OPTIMIZED_OPS=$OPTIMIZED \
135-
-DEXECUTORCH_REGISTER_QUANTIZED_OPS=$QUANTIZED \
134+
-DEXECUTORCH_BUILD_OPTIMIZED=$OPTIMIZED \
135+
-DEXECUTORCH_BUILD_QUANTIZED=$QUANTIZED \
136136
-DEXECUTORCH_BUILD_XNNPACK=$XNNPACK \
137137
${platform_flag:+-DIOS_PLATFORM=$platform_flag}
138138
cmake --build . --config $MODE

configurations/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set(_common_compile_options -Wno-deprecated-declarations)
2828
include(${EXECUTORCH_ROOT}/build/Utils.cmake)
2929
include(${EXECUTORCH_ROOT}/build/Codegen.cmake)
3030

31-
if(EXECUTORCH_REGISTER_OPTIMIZED_OPS)
31+
if(EXECUTORCH_BUILD_OPTIMIZED)
3232
# Merge optimized and portable definitions, taking optimized where available.
3333
merge_yaml(
3434
FUNCTIONS_YAML ${EXECUTORCH_ROOT}/kernels/optimized/optimized-oss.yaml

examples/models/llama2/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
cmake_minimum_required(VERSION 3.19)
1919
project(llama_runner)
2020

21-
option(EXECUTORCH_REGISTER_OPTIMIZED_OPS "Build the optimized kernels" OFF)
21+
option(EXECUTORCH_BUILD_OPTIMIZED "Build the optimized kernels" OFF)
2222

2323
if(NOT PYTHON_EXECUTABLE)
2424
set(PYTHON_EXECUTABLE python3)
@@ -57,7 +57,7 @@ add_subdirectory(runner)
5757
set(link_options)
5858
set(link_libraries)
5959

60-
if(EXECUTORCH_REGISTER_OPTIMIZED_OPS)
60+
if(EXECUTORCH_BUILD_OPTIMIZED)
6161
list(APPEND link_libraries optimized_native_cpu_ops_lib optimized_kernels portable_kernels)
6262
list(APPEND link_options
6363
"SHELL:LINKER:--whole-archive \

examples/models/llama2/export_llama_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def check_embedding_byte_registered():
141141
'Use `python -c "import torch as _; print(_.__path__)"` to find where torch package is installed.\n'
142142
"Set that as TORCH_PACKAGE_DIR.\n"
143143
"Then from root executorch dir do the following:\n"
144-
"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"
144+
"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"
145145
'To find the location of the lib: find cmake-out -name "libquantized_ops_aot_lib*"\n'
146146
"Then specify the said library via -s <path to libquantized_ops_aot_lib.so\n"
147147
)

0 commit comments

Comments
 (0)