@@ -84,38 +84,31 @@ if(NOT CMAKE_GENERATOR STREQUAL "Xcode"
84
84
${EXECUTORCH_ROOT} /kernels/portable/cpu/util/reduce_util.cpp
85
85
${EXECUTORCH_ROOT} /runtime/core/exec_aten/util/tensor_util_aten.cpp
86
86
)
87
-
88
- # Build aot library for embedding ops. Used for pybindings only.
89
- # set(_embedding_aot_ops
90
- # "quantized_decomposed::embedding_4bit.dtype_out"
91
- # )
92
-
93
- # gen_selected_ops(
94
- # LIB_NAME "embedding_ops_aot_lib" ROOT_OPS ${_embedding_aot_ops}
95
- # )
96
-
97
- # # Expect gen_selected_ops output file to be
98
- # # embedding_ops_aot_lib/selected_operators.yaml
99
- # generate_bindings_for_kernels(
100
- # LIB_NAME "embedding_ops_aot_lib" CUSTOM_OPS_YAML "${_yaml_file}"
101
- # )
102
- # set(_out_dir ${CMAKE_CURRENT_BINARY_DIR}/embedding_ops_aot_lib)
103
-
104
- # add_library(
105
- # embedding_ops_aot_lib
106
- # ${_out_dir}/RegisterCodegenUnboxedKernelsEverything.cpp
107
- # ${_out_dir}/Functions.h ${_out_dir}/NativeFunctions.h
108
- # )
109
-
110
- # target_link_libraries(embedding_ops_aot_lib PRIVATE executorch_no_prim_ops)
111
- # list(APPEND _quantized_sources ${_out_dir}/RegisterCodegenUnboxedKernelsEverything.cpp ${_out_dir}/Functions.h)
112
87
gen_custom_ops_aot_lib (
113
88
LIB_NAME "quantized_ops_aot_lib" KERNEL_SOURCES "${_quantized_sources} "
114
89
)
115
- target_include_directories (
116
- quantized_ops_aot_lib PUBLIC "${_common_include_directories} "
117
- )
118
90
91
+ if (TARGET portable_lib )
92
+ add_library (quantized_pybind_kernels_lib ${_quantized_kernels__srcs} )
93
+ target_link_libraries (quantized_pybind_kernels_lib PRIVATE portable_lib )
94
+ target_compile_options (quantized_pybind_kernels_lib PUBLIC ${_common_compile_options} )
95
+ target_include_directories (
96
+ quantized_pybind_kernels_lib PUBLIC "${_common_include_directories} "
97
+ )
98
+ gen_selected_ops (
99
+ LIB_NAME "quantized_ops_pybind_lib" OPS_SCHEMA_YAML "${_yaml_file} "
100
+ )
101
+ generate_bindings_for_kernels (
102
+ LIB_NAME "quantized_ops_pybind_lib" CUSTOM_OPS_YAML "${_yaml_file} "
103
+ )
104
+ # Build a library for pybind usage
105
+ #
106
+ # quantized_ops_pybind_lib: Register quantized ops kernels into Executorch runtime for pybind
107
+ gen_operators_lib (
108
+ LIB_NAME "quantized_ops_pybind_lib" KERNEL_LIBS quantized_pybind_kernels_lib DEPS portable_lib
109
+ )
110
+ target_link_libraries (quantized_ops_aot_lib PUBLIC quantized_ops_pybind_lib )
111
+ endif ()
119
112
# target_link_libraries(quantized_ops_aot_lib PUBLIC embedding_ops_aot_lib)
120
113
endif ()
121
114
endif ()
0 commit comments