Skip to content

Commit 6a7ea5c

Browse files
authored
Update xnnpack, cpuinfo and pthreadpool (microsoft#23362)
### Description Update xnnpack to remove the dependency on psimd and fp16 libraries. However, coremltool still depends on them, which will be addressed later. Also, update CPUINFO because the latest xnnpack requires CPUINFO's avx10 support. ### Motivation and Context The fewer dependencies the better.
1 parent cff0ec5 commit 6a7ea5c

File tree

6 files changed

+24
-63
lines changed

6 files changed

+24
-63
lines changed

cgmanifests/generated/cgmanifest.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"component": {
137137
"type": "git",
138138
"git": {
139-
"commitHash": "309b75c9e56e0a674bf78d59872ce131f814dfb6",
139+
"commitHash": "fe98e0b93565382648129271381c14d6205255e3",
140140
"repositoryUrl": "https://github.com/google/XNNPACK.git"
141141
},
142142
"comments": "googlexnnpack"
@@ -226,8 +226,8 @@
226226
"component": {
227227
"type": "git",
228228
"git": {
229-
"commitHash": "4fe0e1e183925bf8cfa6aae24237e724a96479b8",
230-
"repositoryUrl": "https://github.com/Maratyszcza/pthreadpool.git"
229+
"commitHash": "4e80ca24521aa0fb3a746f9ea9c3eaa20e9afbb0",
230+
"repositoryUrl": "https://github.com/google/pthreadpool.git"
231231
},
232232
"comments": "pthreadpool"
233233
}
@@ -246,7 +246,7 @@
246246
"component": {
247247
"type": "git",
248248
"git": {
249-
"commitHash": "ca678952a9a8eaa6de112d154e8e104b22f9ab3f",
249+
"commitHash": "8a1772a0c5c447df2d18edf33ec4603a8c9c04a6",
250250
"repositoryUrl": "https://github.com/pytorch/cpuinfo.git"
251251
},
252252
"comments": "pytorch_cpuinfo"

cmake/deps.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fxdiv;https://github.com/Maratyszcza/FXdiv/archive/63058eff77e11aa15bf531df5dd34
2929
google_benchmark;https://github.com/google/benchmark/archive/refs/tags/v1.8.5.zip;cd47d3d272faf353600c8cc2fdec2b52d6f69177
3030
googletest;https://github.com/google/googletest/archive/refs/tags/v1.15.0.zip;9d2d0af8d77ac726ea55d44a8fa727ec98311349
3131
#xnnpack 2024.09.04
32-
googlexnnpack;https://github.com/google/XNNPACK/archive/309b75c9e56e0a674bf78d59872ce131f814dfb6.zip;39FA5259EAEACE0547284B63D5CEDC4F05553F5A
32+
googlexnnpack;https://github.com/google/XNNPACK/archive/fe98e0b93565382648129271381c14d6205255e3.zip;14f61dcf17cec2cde34ba2dcf61d6f24bf6059f3
3333
json;https://github.com/nlohmann/json/archive/refs/tags/v3.10.5.zip;f257f8dc27c5b8c085dc887b40cddd18ae1f725c
3434
microsoft_gsl;https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.zip;cf368104cd22a87b4dd0c80228919bb2df3e2a14
3535
microsoft_wil;https://github.com/microsoft/wil/archive/refs/tags/v1.0.230629.1.zip;e4a542a323c070376f7c2d1973d0f7ddbc1d2fa5
@@ -46,9 +46,9 @@ protoc_linux_x86;https://github.com/protocolbuffers/protobuf/releases/download/v
4646
protoc_linux_aarch64;https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-linux-aarch_64.zip;df9d45470b0b8cf939dd2f0ec6b88e9cafc4d617
4747
protoc_mac_universal;https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-osx-universal_binary.zip;23710c3d1c2036d8d65a6a22234372fa2d7af9ef
4848
psimd;https://github.com/Maratyszcza/psimd/archive/072586a71b55b7f8c584153d223e95687148a900.zip;1f5454b01f06f9656b77e4a5e2e31d7422487013
49-
pthreadpool;https://github.com/Maratyszcza/pthreadpool/archive/4fe0e1e183925bf8cfa6aae24237e724a96479b8.zip;07a0aa91dd9bf86f31b95497e00f31d8a261a4bd
49+
pthreadpool;https://github.com/google/pthreadpool/archive/4e80ca24521aa0fb3a746f9ea9c3eaa20e9afbb0.zip;bd4ea65c8292801e9555b527a0ecbb2e0092c917
5050
pybind11;https://github.com/pybind/pybind11/archive/refs/tags/v2.13.1.zip;9255d5c8568debcc329dd42ed8f410ee139ac7b1
51-
pytorch_cpuinfo;https://github.com/pytorch/cpuinfo/archive/ca678952a9a8eaa6de112d154e8e104b22f9ab3f.zip;138bf57d2a110935330d1048dce6d7b82d17d377
51+
pytorch_cpuinfo;https://github.com/pytorch/cpuinfo/archive/8a1772a0c5c447df2d18edf33ec4603a8c9c04a6.zip;85bf8a60dae026b99b6ccd78606c85ed83bfb2cd
5252
re2;https://github.com/google/re2/archive/refs/tags/2024-07-02.zip;646e1728269cde7fcef990bf4a8e87b047882e88
5353
safeint;https://github.com/dcleblanc/SafeInt/archive/refs/tags/3.0.28.zip;23f252040ff6cb9f1fd18575b32fa8fb5928daac
5454
tensorboard;https://github.com/tensorflow/tensorboard/archive/373eb09e4c5d2b3cc2493f0949dc4be6b6a45e81.zip;67b833913605a4f3f499894ab11528a702c2b381
@@ -59,4 +59,4 @@ composable_kernel;https://github.com/ROCmSoftwarePlatform/composable_kernel/arch
5959
directx_headers;https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.613.1.zip;47653509a3371eabb156360f42faf582f314bf2e
6060
cudnn_frontend;https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v1.7.0.zip;d0753d8d5b39947ca0729d7773cb84653a129eb1
6161
dawn;https://github.com/google/dawn/archive/12a3b24c456cebd9fd11f23ac0164f78129b00c6.zip;ad428f6dc16f1336d584f7bad5714e1097dafc43
62-
kleidiai;https://gitlab.arm.com/kleidi/kleidiai/-/archive/v0.2.0/kleidiai-v0.2.0.zip;B1E3173992FD91F20DB904AB77D6E901778C2681
62+
kleidiai;https://gitlab.arm.com/kleidi/kleidiai/-/archive/d15722976120710080ca098fe8ddabf4556cb40f/kleidiai-d15722976120710080ca098fe8ddabf4556cb40f.zip;d6c840d00c3b05aedf06e957ddaece1013d1f40b

cmake/external/xnnpack.cmake

+1-40
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
set(XNNPACK_USE_SYSTEM_LIBS ON CACHE INTERNAL "")
22
set(XNNPACK_BUILD_TESTS OFF CACHE INTERNAL "")
33
set(XNNPACK_BUILD_BENCHMARKS OFF CACHE INTERNAL "")
4-
set(FP16_BUILD_TESTS OFF CACHE INTERNAL "")
5-
set(FP16_BUILD_BENCHMARKS OFF CACHE INTERNAL "")
4+
65
set(PTHREADPOOL_BUILD_TESTS OFF CACHE INTERNAL "")
76
set(PTHREADPOOL_BUILD_BENCHMARKS OFF CACHE INTERNAL "")
87
set(KLEIDIAI_BUILD_TESTS OFF CACHE INTERNAL "")
@@ -17,44 +16,6 @@ if(CMAKE_ANDROID_ARCH_ABI STREQUAL armeabi-v7a)
1716
set(XNNPACK_ENABLE_ARM_BF16 OFF)
1817
endif()
1918

20-
# fp16 depends on psimd
21-
FetchContent_Declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd})
22-
onnxruntime_fetchcontent_makeavailable(psimd)
23-
set(PSIMD_SOURCE_DIR ${psimd_SOURCE_DIR})
24-
25-
block(PROPAGATE fp16_PATCH_COMMAND)
26-
# only apply fp16 patch for Apple x86_64 targets
27-
28-
if(APPLE)
29-
if(NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
30-
if ("x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES)
31-
set(fp16_PATCH_REQUIRED 1)
32-
endif()
33-
else()
34-
# CMAKE_OSX_ARCHITECTURES unspecified, check host
35-
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
36-
set(fp16_PATCH_REQUIRED 1)
37-
endif()
38-
endif()
39-
endif()
40-
41-
if(fp16_PATCH_REQUIRED)
42-
message(STATUS "Applying fp16 patch.")
43-
set(fp16_PATCH_FILE ${PROJECT_SOURCE_DIR}/patches/fp16/remove_math_h_dependency_from_fp16_h.patch)
44-
set(fp16_PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${fp16_PATCH_FILE})
45-
else()
46-
set(fp16_PATCH_COMMAND "")
47-
endif()
48-
endblock()
49-
50-
FetchContent_Declare(
51-
fp16
52-
URL ${DEP_URL_fp16}
53-
URL_HASH SHA1=${DEP_SHA1_fp16}
54-
PATCH_COMMAND ${fp16_PATCH_COMMAND}
55-
)
56-
onnxruntime_fetchcontent_makeavailable(fp16)
57-
5819
# pthreadpool depends on fxdiv
5920
FetchContent_Declare(fxdiv URL ${DEP_URL_fxdiv} URL_HASH SHA1=${DEP_SHA1_fxdiv})
6021
onnxruntime_fetchcontent_makeavailable(fxdiv)

cmake/onnxruntime_providers_coreml.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ endif()
177177
if (_enable_ML_PROGRAM)
178178
# Setup coremltools fp16 and json dependencies for creating an mlpackage.
179179
#
180-
# These are also used by external/xnnpack.cmake. fp16 depends on psimd
180+
# fp16 depends on psimd
181181
FetchContent_Declare(psimd URL ${DEP_URL_psimd} URL_HASH SHA1=${DEP_SHA1_psimd})
182182
onnxruntime_fetchcontent_makeavailable(psimd)
183183
set(PSIMD_SOURCE_DIR ${psimd_SOURCE_DIR})

cmake/patches/xnnpack/AddEmscriptenAndIosSupport.patch

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 1ff85b538..c3ef2183f 100644
2+
index f0b3410ae..1e3cb8178 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -253,7 +253,7 @@ ENDIF()
5+
@@ -337,7 +337,7 @@ ENDIF()
66
# ---[ Build flags
77
IF(NOT CMAKE_SYSTEM_NAME)
88
MESSAGE(FATAL_ERROR "CMAKE_SYSTEM_NAME not defined")
@@ -11,21 +11,21 @@ index 1ff85b538..c3ef2183f 100644
1111
MESSAGE(FATAL_ERROR "Unrecognized CMAKE_SYSTEM_NAME value \"${CMAKE_SYSTEM_NAME}\"")
1212
ENDIF()
1313
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
14-
@@ -763,7 +763,12 @@ IF(XNNPACK_BUILD_LIBRARY)
15-
TARGET_LINK_LIBRARIES(operator-run PRIVATE xnnpack-base logging)
14+
@@ -848,7 +848,12 @@ IF(XNNPACK_BUILD_LIBRARY)
1615
TARGET_LINK_LIBRARIES(operator-utils PRIVATE xnnpack-base logging)
17-
TARGET_LINK_LIBRARIES(subgraph PRIVATE xnnpack-base allocator logging memory mutex operators operator-run)
18-
- TARGET_LINK_LIBRARIES(XNNPACK PRIVATE allocator cache hardware-config indirection logging memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing microkernels-prod subgraph)
16+
TARGET_LINK_LIBRARIES(reference-ukernels PRIVATE xnnpack-base)
17+
TARGET_LINK_LIBRARIES(subgraph PRIVATE xnnpack-base allocator logging memory mutex operators operator-run datatype)
18+
- TARGET_LINK_LIBRARIES(XNNPACK PRIVATE xnnpack-base allocator cache hardware-config indirection memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing microkernels-prod subgraph datatype reference-ukernels)
1919
+ IF(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
20-
+ # omit microkernels-prod as the list is manually created by ORT in cmake/external/xnnpack.cmake
21-
+ TARGET_LINK_LIBRARIES(XNNPACK PRIVATE allocator cache hardware-config indirection logging memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing subgraph)
20+
+ # omit microkernels-prod as the list is manually created by ORT in cmake/external/xnnpack.cmake
21+
+ TARGET_LINK_LIBRARIES(XNNPACK PRIVATE xnnpack-base allocator cache hardware-config indirection memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing subgraph datatype reference-ukernels)
2222
+ ELSE()
23-
+ TARGET_LINK_LIBRARIES(XNNPACK PRIVATE allocator cache hardware-config indirection logging memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing microkernels-prod subgraph)
24-
+ ENDIF()
25-
TARGET_LINK_LIBRARIES(XNNPACK PUBLIC xnnpack-base)
23+
+ TARGET_LINK_LIBRARIES(XNNPACK PRIVATE xnnpack-base allocator cache hardware-config indirection memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing microkernels-prod subgraph datatype reference-ukernels)
24+
+ ENDIF()
25+
TARGET_LINK_LIBRARIES(XNNPACK PUBLIC pthreadpool logging)
2626
SET_TARGET_PROPERTIES(XNNPACK PROPERTIES C_EXTENSIONS YES)
2727
ENDIF()
28-
@@ -772,7 +777,8 @@ IF(NOT MSVC)
28+
@@ -857,7 +862,8 @@ IF(NOT MSVC)
2929
ENDIF()
3030
IF(XNNPACK_TARGET_PROCESSOR STREQUAL "arm")
3131
SET_PROPERTY(SOURCE ${ALL_MICROKERNEL_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -marm ")

tools/ci_build/github/azure-pipelines/templates/download-deps.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ steps:
1111
packageType: upack
1212
feed: '/7424c8e4-5c62-490e-95c4-79446f31017c'
1313
definition: '517c4f6f-5437-4392-a70d-4f15ec5be2f0'
14-
version: 1.0.206
14+
version: 1.0.208
1515
downloadPath: $(Build.BinariesDirectory)/deps
1616

1717
# The private ADO project
@@ -22,7 +22,7 @@ steps:
2222
packageType: upack
2323
feed: '/4c7631f5-24c0-4307-8822-1aa8f180c325'
2424
definition: 'fd9dd5ad-b73e-4678-890e-edcf680dbc1a'
25-
version: 1.0.206
25+
version: 1.0.208
2626
downloadPath: $(Build.BinariesDirectory)/deps
2727

2828
# You can add more ADO accounts at here.

0 commit comments

Comments
 (0)