From cd9d73084065415b2df8a0f072db6e9b5ba8152a Mon Sep 17 00:00:00 2001 From: lucylq Date: Mon, 22 Apr 2024 10:20:44 -0700 Subject: [PATCH] add quantize ops to pybindings --- CMakeLists.txt | 5 +++++ setup.py | 1 + 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e963f0aaadd..11877902b23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -562,6 +562,11 @@ if(EXECUTORCH_BUILD_PYBIND) list(APPEND _dep_libs custom_ops) endif() + if(EXECUTORCH_BUILD_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) list(APPEND _dep_libs custom_ops_aot_lib) diff --git a/setup.py b/setup.py index 09d1a3a64ef..65f72a03519 100644 --- a/setup.py +++ b/setup.py @@ -376,6 +376,7 @@ def run(self): if ShouldBuild.pybindings: cmake_args += [ "-DEXECUTORCH_BUILD_PYBIND=ON", + "-DEXECUTORCH_BUILD_QUANTIZED=ON", # add quantized ops to pybindings. ] build_args += ["--target", "portable_lib"] if ShouldBuild.xnnpack: