From 287b2ee954d1b7e6fe2aab23271f5f24a8ef06f6 Mon Sep 17 00:00:00 2001 From: Mengwei Liu Date: Fri, 12 Apr 2024 00:22:12 -0700 Subject: [PATCH] Fix 3 CI jobs (#3006) Summary: * Apple / build-frameworks-ios / macos-job We removed libcustom_ops_lib.a in https://github.com/pytorch/executorch/issues/2916 so need to remove it from `build_apple_frameworks.sh`. * Lint / lintrunner / linux-job Remove extra line in backends/qualcomm/quantizer/utils.py * pull / unittest / macos (buck2) / macos-job Fix it by using `executorch_no_prim_ops` instead of `executorch` in MPS and CoreML. Pull Request resolved: https://github.com/pytorch/executorch/pull/3006 Reviewed By: lucylq Differential Revision: D56048430 Pulled By: larryliu0820 fbshipit-source-id: 9dcb476eea446ea3aba566d595167c691fb00eec (cherry picked from commit 5b7c4bab928a5e05331ed533195bca1d670896d8) --- CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ build/build_apple_frameworks.sh | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75de1e01ae6..c579892a34f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -527,6 +527,38 @@ if(EXECUTORCH_BUILD_PYBIND) find_library(TORCH_PYTHON_LIBRARY torch_python PATHS "${TORCH_INSTALL_PREFIX}/lib") + set(_dep_libs + ${TORCH_PYTHON_LIBRARY} + bundled_program + etdump + executorch + extension_data_loader + portable_ops_lib + util + torch) + + if(EXECUTORCH_BUILD_COREML) + list(APPEND _dep_libs coremldelegate) + endif() + + if(EXECUTORCH_BUILD_MPS) + list(APPEND _dep_libs mpsdelegate) + endif() + + if(EXECUTORCH_BUILD_XNNPACK) + # need to explicitly specify XNNPACK here otherwise uses XNNPACK symbols + # from libtorch_cpu + list(APPEND _dep_libs xnnpack_backend XNNPACK) + endif() + + if(EXECUTORCH_BUILD_CUSTOM) + list(APPEND _dep_libs custom_ops) + 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) + endif() # compile options for pybind set(_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti diff --git a/build/build_apple_frameworks.sh b/build/build_apple_frameworks.sh index cbaa903ecda..0b6adae0a7f 100755 --- a/build/build_apple_frameworks.sh +++ b/build/build_apple_frameworks.sh @@ -27,7 +27,7 @@ XNNPACK=OFF HEADERS_PATH="include" EXECUTORCH_FRAMEWORK="executorch:libexecutorch.a,libexecutorch_no_prim_ops.a,libextension_apple.a,libextension_data_loader.a,libextension_module.a:$HEADERS_PATH" COREML_FRAMEWORK="coreml_backend:libcoremldelegate.a:" -CUSTOM_FRAMEWORK="custom_backend:libcustom_ops.a,libcustom_ops_lib.a:" +CUSTOM_FRAMEWORK="custom_backend:libcustom_ops.a:" MPS_FRAMEWORK="mps_backend:libmpsdelegate.a:" OPTIMIZED_FRAMEWORK="optimized_backend:liboptimized_kernels.a,liboptimized_ops_lib.a:" PORTABLE_FRAMEWORK="portable_backend:libportable_kernels.a,libportable_ops_lib.a:"