File tree Expand file tree Collapse file tree 5 files changed +13
-4
lines changed Expand file tree Collapse file tree 5 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ build_cmake_quantized_aot_lib() {
24
24
&& retry cmake -DBUCK2=buck2 \
25
25
-DCMAKE_BUILD_TYPE=Release \
26
26
-DCMAKE_PREFIX_PATH=" $CMAKE_PREFIX_PATH " \
27
- -DEXECUTORCH_BUILD_QUANTIZED =ON \
27
+ -DEXECUTORCH_BUILD_QUANTIZED_OPS_AOT =ON \
28
28
-DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " ..)
29
29
30
30
cmake --build ${CMAKE_OUTPUT_DIR} -j4
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ set(lib_list
38
38
etdump bundled_program extension_data_loader ${FLATCCRT_LIB} mpsdelegate
39
39
qnn_executorch_backend portable_ops_lib extension_module xnnpack_backend
40
40
XNNPACK cpuinfo pthreadpool vulkan_backend optimized_kernels cpublas eigen_blas
41
- optimized_ops_lib optimized_native_cpu_ops_lib
41
+ optimized_ops_lib optimized_native_cpu_ops_lib quantized_kernels quantized_ops_lib
42
42
)
43
43
foreach (lib ${lib_list} )
44
44
# Name of the variable which stores result of the find_library search
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ add_subdirectory(runner)
91
91
if (EXECUTORCH_USE_TIKTOKEN )
92
92
# find RE2 for tokenizer
93
93
set (ABSL_ENABLE_INSTALL ON )
94
+ set (ABSL_PROPAGATE_CXX_STD ON )
94
95
set (_pic_flag
95
96
${CMAKE_POSITION_INDEPENDENT_CODE} )
96
97
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
@@ -118,6 +119,11 @@ else()
118
119
target_link_options_shared_lib (portable_ops_lib )
119
120
endif ()
120
121
122
+ if (EXECUTORCH_BUILD_QUANTIZED )
123
+ list (APPEND link_libraries quantized_ops_lib quantized_kernels )
124
+ target_link_options_shared_lib (quantized_ops_lib )
125
+ endif ()
126
+
121
127
if (EXECUTORCH_BUILD_CUSTOM )
122
128
target_link_options_shared_lib (custom_ops )
123
129
list (APPEND link_libraries custom_ops )
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ def check_embedding_byte_registered():
105
105
'Use `python -c "import torch as _; print(_.__path__)"` to find where torch package is installed.\n '
106
106
"Set that as TORCH_PACKAGE_DIR.\n "
107
107
"Then from root executorch dir do the following:\n "
108
- "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 "
108
+ "rm -rf cmake-out && mkdir cmake-out && (cd cmake-out && cmake -DBUCK2=<path-to-buck2> -DCMAKE_PREFIX_PATH=$TORCH_PACKAGE_DIR -DEXECUTORCH_BUILD_QUANTIZED_OPS_AOT =ON ..) && cmake --build . -j16\n "
109
109
'To find the location of the lib: find cmake-out -name "libquantized_ops_aot_lib*"\n '
110
110
"Then specify the said library via -s <path to libquantized_ops_aot_lib.so\n "
111
111
)
Original file line number Diff line number Diff line change 10
10
# ~~~
11
11
cmake_minimum_required (VERSION 3.19 )
12
12
13
+ option (EXECUTORCH_BUILD_QUANTIZED_OPS_AOT
14
+ "Build the optimized ops library for AOT export usage" OFF )
15
+
13
16
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
14
17
if (NOT CMAKE_CXX_STANDARD )
15
18
set (CMAKE_CXX_STANDARD 17 )
@@ -49,7 +52,7 @@ message("Generated files ${gen_command_sources}")
49
52
# quantized_ops_aot_lib quantized_ops_lib but none of these is a common
50
53
# dependency of the other(s). This is not allowed by the Xcode "new build
51
54
# system".
52
- if (NOT CMAKE_GENERATOR STREQUAL "Xcode" )
55
+ if (NOT CMAKE_GENERATOR STREQUAL "Xcode" AND EXECUTORCH_BUILD_QUANTIZED_OPS_AOT )
53
56
# Build a AOT library to register quantized ops into PyTorch. This is a hack.
54
57
set (_quantized_sources
55
58
${_quantized_kernels__srcs}
You can’t perform that action at this time.
0 commit comments