From bd1f5d1c32fad1d33f9716bc0e7b3924c62e65c1 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Fri, 10 Jan 2025 00:47:41 +0000 Subject: [PATCH] update xnnpack for disable libm on Windows [submodule XNNPACK] (#141943) This PR is implement of RFC: https://github.com/pytorch/pytorch/issues/141946 Changes: 1. Update `XNNPACK` to contains it's PRS: https://github.com/google/XNNPACK/pull/7456, https://github.com/google/XNNPACK/pull/7535 and other build fixing PRs. 2. Set `XNNPACK_BUILD_WITH_LIBM` to `OFF`, it is turn off CMake find_library(libm) of `XNNPACK`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/141943 Approved by: https://github.com/atalman --- cmake/Dependencies.cmake | 6 ++++++ third_party/XNNPACK | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 1653ae163818..4be94feaac0b 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -540,6 +540,12 @@ if(USE_XNNPACK AND NOT USE_SYSTEM_XNNPACK) set(__caffe2_CMAKE_POSITION_INDEPENDENT_CODE_FLAG ${CMAKE_POSITION_INDEPENDENT_CODE}) set(CMAKE_POSITION_INDEPENDENT_CODE ON) + if(Win32) + # Disable libm dependency explicitly to avoid symbol conflict for XNNPACK as + # Windows runtime has provided the math functions - #134989 + set(XNNPACK_BUILD_WITH_LIBM OFF CACHE BOOL "") + endif() + add_subdirectory( "${XNNPACK_SOURCE_DIR}" "${CONFU_DEPENDENCIES_BINARY_DIR}/XNNPACK") diff --git a/third_party/XNNPACK b/third_party/XNNPACK index 4ea82e595b36..51a0103656ef 160000 --- a/third_party/XNNPACK +++ b/third_party/XNNPACK @@ -1 +1 @@ -Subproject commit 4ea82e595b36106653175dcb04b2aa532660d0d8 +Subproject commit 51a0103656eff6fc9bfd39a4597923c4b542c883