Compare commits
No commits in common. "rawhide" and "f40" have entirely different histories.
6 changed files with 190 additions and 86 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,3 +1 @@
|
|||
/xnnpack-51a9875.tar.gz
|
||||
/xnnpack-fcbf55a.tar.gz
|
||||
/xnnpack-312eb7e.tar.gz
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
From 38e76639a8a0064acb96805986ae2f9ab23e1161 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Rix <trix@redhat.com>
|
||||
Date: Fri, 8 Mar 2024 08:41:44 -0500
|
||||
Subject: [PATCH] Fix cmake for pthread and cpuinfo with USE_SYSTEM_LIBS
|
||||
|
||||
When -DUSE_SYSTEM_LIBS=ON is used this error is caused
|
||||
|
||||
CMake Error in CMakeLists.txt:
|
||||
Imported target "pthreadpool" includes non-existent path
|
||||
|
||||
"/include"
|
||||
|
||||
...
|
||||
|
||||
CMake Error in CMakeLists.txt:
|
||||
Imported target "pthreadpool" includes non-existent path
|
||||
|
||||
"/include"
|
||||
|
||||
In the USE_SYSTEM_LIBS=ON case, neither the CPUINFO_SOURCE_DIR nor
|
||||
the PTHREADPOLL_SOURCE_DIR variables are defined.
|
||||
|
||||
Revert the logic back to what it was before the change in Fixes: tag.
|
||||
|
||||
Fixes: e81b7f14eee7 ("Enable use of dependencies in arbitrary locations")
|
||||
Signed-off-by: Tom Rix <trix@redhat.com>
|
||||
---
|
||||
CMakeLists.txt | 6 ++----
|
||||
1 file changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 03c80a99b0b0..7f31d4f87a42 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -963,11 +963,10 @@ IF(NOT TARGET cpuinfo)
|
||||
"${CMAKE_BINARY_DIR}/cpuinfo")
|
||||
ELSE()
|
||||
ADD_LIBRARY(cpuinfo SHARED IMPORTED)
|
||||
- FIND_LIBRARY(CPUINFO_LIBRARY cpuinfo PATHS "${CPUINFO_SOURCE_DIR}/lib")
|
||||
+ FIND_LIBRARY(CPUINFO_LIBRARY cpuinfo)
|
||||
IF(NOT CPUINFO_LIBRARY)
|
||||
MESSAGE(FATAL_ERROR "Cannot find cpuinfo")
|
||||
ENDIF()
|
||||
- TARGET_INCLUDE_DIRECTORIES(cpuinfo INTERFACE "${CPUINFO_SOURCE_DIR}/include")
|
||||
SET_PROPERTY(TARGET cpuinfo PROPERTY IMPORTED_LOCATION "${CPUINFO_LIBRARY}")
|
||||
SET_PROPERTY(TARGET cpuinfo PROPERTY IMPORTED_IMPLIB "${CPUINFO_LIBRARY}")
|
||||
ENDIF()
|
||||
@@ -988,12 +987,11 @@ IF(NOT TARGET pthreadpool)
|
||||
"${CMAKE_BINARY_DIR}/pthreadpool")
|
||||
ELSE()
|
||||
ADD_LIBRARY(pthreadpool SHARED IMPORTED)
|
||||
- FIND_LIBRARY(PTHREADPOOL_LIBRARY pthreadpool PATHS "${PTHREADPOOL_SOURCE_DIR}/lib")
|
||||
+ FIND_LIBRARY(PTHREADPOOL_LIBRARY pthreadpool)
|
||||
IF(NOT PTHREADPOOL_LIBRARY)
|
||||
MESSAGE(FATAL_ERROR "Cannot find pthreadpool")
|
||||
ENDIF()
|
||||
FIND_PACKAGE(Threads REQUIRED)
|
||||
- TARGET_INCLUDE_DIRECTORIES(pthreadpool INTERFACE "${PTHREADPOOL_SOURCE_DIR}/include")
|
||||
TARGET_LINK_LIBRARIES(pthreadpool INTERFACE Threads::Threads)
|
||||
SET_PROPERTY(TARGET pthreadpool PROPERTY IMPORTED_LOCATION "${PTHREADPOOL_LIBRARY}")
|
||||
SET_PROPERTY(TARGET pthreadpool PROPERTY IMPORTED_IMPLIB "${PTHREADPOOL_LIBRARY}")
|
||||
--
|
||||
2.44.0
|
||||
|
||||
122
0001-Prepare-xnnpack-cmake-for-fedora.patch
Normal file
122
0001-Prepare-xnnpack-cmake-for-fedora.patch
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
From 09407b5055a4a78adb45deef9da972d6ddc5278e Mon Sep 17 00:00:00 2001
|
||||
From: Tom Rix <trix@redhat.com>
|
||||
Date: Thu, 28 Sep 2023 13:46:53 -0700
|
||||
Subject: [PATCH] Prepare xnnpack cmake for fedora
|
||||
|
||||
Signed-off-by: Tom Rix <trix@redhat.com>
|
||||
---
|
||||
CMakeLists.txt | 55 +++++++++-----------------------------------------
|
||||
1 file changed, 9 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 95df99e..20b3429 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -71,10 +71,12 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
# --- [ Processor-specific options
|
||||
+IF(XNNPACK_TARGET_PROCESSOR MATCHES "^arm64")
|
||||
OPTION(XNNPACK_ENABLE_ARM_FP16_SCALAR "Build XNNPACK with ARM FP16 (FP16 data processing) scalar micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_ARM_FP16_VECTOR "Build XNNPACK with ARM FP16 (FP16 data processing) vector micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_ARM_BF16 "Build XNNPACK with ARM BF16 (BFLOAT16) micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_ARM_DOTPROD "Build XNNPACK with ARM DotProd (integer dot product) micro-kernels" ON)
|
||||
+ENDIF()
|
||||
|
||||
# ---[ CMake options
|
||||
INCLUDE(GNUInstallDirs)
|
||||
@@ -104,6 +106,10 @@ ENDIF()
|
||||
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# Disable "note: parameter passing for argument of type ... changed/will change in ..."
|
||||
ADD_COMPILE_OPTIONS("-Wno-psabi")
|
||||
+ IF(XNNPACK_TARGET_PROCESSOR MATCHES "^arm64")
|
||||
+ # stricter gcc 14 breaks arm build
|
||||
+ ADD_COMPILE_OPTIONS(-Wno-incompatible-pointer-types)
|
||||
+ ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# ---[ Build flags
|
||||
@@ -513,6 +519,9 @@ IF(XNNPACK_BUILD_LIBRARY)
|
||||
TARGET_LINK_LIBRARIES(subgraph PRIVATE allocator logging memory mutex operators operator-run)
|
||||
TARGET_LINK_LIBRARIES(XNNPACK PRIVATE allocator cache hardware-config indirection jit logging memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing post-operation microkernels-prod subgraph)
|
||||
SET_TARGET_PROPERTIES(XNNPACK PROPERTIES C_EXTENSIONS YES)
|
||||
+ # YY.M.D of last upstream commit to main
|
||||
+ SET_TARGET_PROPERTIES(XNNPACK PROPERTIES SOVERSION "0.0.221221")
|
||||
+
|
||||
ENDIF()
|
||||
IF(NOT MSVC)
|
||||
SET_PROPERTY(SOURCE ${ALL_MICROKERNEL_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -fno-math-errno ")
|
||||
@@ -786,26 +795,6 @@ IF(LIBM)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
-# ---[ Configure clog
|
||||
-IF(NOT TARGET clog)
|
||||
- IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
||||
- SET(CLOG_BUILD_TESTS OFF CACHE BOOL "")
|
||||
- SET(CLOG_RUNTIME_TYPE "${CPUINFO_RUNTIME_TYPE}" CACHE STRING "")
|
||||
- ADD_SUBDIRECTORY(
|
||||
- "${CLOG_SOURCE_DIR}/deps/clog"
|
||||
- "${CMAKE_BINARY_DIR}/clog")
|
||||
- # We build static version of clog but a dynamic library may indirectly depend on it
|
||||
- SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
- ELSE()
|
||||
- ADD_LIBRARY(clog STATIC IMPORTED)
|
||||
- FIND_LIBRARY(CLOG_LIBRARY clog)
|
||||
- IF(NOT CLOG_LIBRARY)
|
||||
- MESSAGE(FATAL_ERROR "Cannot find clog")
|
||||
- ENDIF()
|
||||
- SET_PROPERTY(TARGET clog PROPERTY IMPORTED_LOCATION "${CLOG_LIBRARY}")
|
||||
- ENDIF()
|
||||
-ENDIF()
|
||||
-
|
||||
# ---[ Configure cpuinfo
|
||||
IF(NOT TARGET cpuinfo)
|
||||
IF(NOT XNNPACK_USE_SYSTEM_LIBS)
|
||||
@@ -885,16 +874,8 @@ IF(NOT TARGET fxdiv)
|
||||
IF(NOT FXDIV_HDR)
|
||||
MESSAGE(FATAL_ERROR "Cannot find fxdiv")
|
||||
ENDIF()
|
||||
- ADD_LIBRARY(fxdiv STATIC "${FXDIV_HDR}")
|
||||
- SET_PROPERTY(TARGET fxdiv PROPERTY LINKER_LANGUAGE C)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
-TARGET_LINK_LIBRARIES(microkernels-all PRIVATE fxdiv)
|
||||
-TARGET_LINK_LIBRARIES(microkernels-prod PRIVATE fxdiv)
|
||||
-TARGET_LINK_LIBRARIES(indirection PRIVATE fxdiv)
|
||||
-IF(XNNPACK_BUILD_LIBRARY)
|
||||
- TARGET_LINK_LIBRARIES(XNNPACK PRIVATE fxdiv)
|
||||
-ENDIF()
|
||||
|
||||
# ---[ Configure FP16
|
||||
IF(NOT TARGET fp16)
|
||||
@@ -909,26 +890,8 @@ IF(NOT TARGET fp16)
|
||||
IF(NOT FP16_HDR)
|
||||
MESSAGE(FATAL_ERROR "Cannot find fp16")
|
||||
ENDIF()
|
||||
- ADD_LIBRARY(fp16 STATIC "${FP16_HDR}")
|
||||
- SET_PROPERTY(TARGET fp16 PROPERTY LINKER_LANGUAGE C)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
-TARGET_LINK_LIBRARIES(microkernels-all PRIVATE fp16)
|
||||
-TARGET_LINK_LIBRARIES(microkernels-prod PRIVATE fp16)
|
||||
-TARGET_LINK_LIBRARIES(microparams-init PRIVATE fp16)
|
||||
-TARGET_LINK_LIBRARIES(packing PRIVATE fp16)
|
||||
-TARGET_LINK_LIBRARIES(indirection PRIVATE fp16)
|
||||
-IF(XNNPACK_BUILD_LIBRARY)
|
||||
- TARGET_LINK_LIBRARIES(subgraph PRIVATE fp16)
|
||||
- TARGET_LINK_LIBRARIES(operators PRIVATE fp16)
|
||||
- TARGET_LINK_LIBRARIES(operator-run PRIVATE fp16)
|
||||
-
|
||||
- TARGET_LINK_LIBRARIES(XNNPACK PRIVATE fp16)
|
||||
- INSTALL(TARGETS XNNPACK
|
||||
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
-ENDIF()
|
||||
|
||||
# ---[ XNNPACK unit tests
|
||||
IF(XNNPACK_BUILD_TESTS)
|
||||
--
|
||||
2.43.0
|
||||
|
||||
40
next/0001-Prepare-xnnpack-cmake-for-fedora.patch
Normal file
40
next/0001-Prepare-xnnpack-cmake-for-fedora.patch
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
From c64915df538cb8e54d8739c99ccf89da11c98eb0 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Rix <trix@redhat.com>
|
||||
Date: Sat, 3 Feb 2024 09:24:12 -0500
|
||||
Subject: [PATCH] Prepare xnnpack cmake for fedora
|
||||
|
||||
---
|
||||
CMakeLists.txt | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 877107f87..92dbabf1d 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -75,12 +75,14 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
# --- [ Processor-specific options
|
||||
+IF(XNNPACK_TARGET_PROCESSOR MATCHES "^arm64")
|
||||
OPTION(XNNPACK_ENABLE_ARM_FP16_SCALAR "Build XNNPACK with ARM FP16 (FP16 data processing) scalar micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_ARM_FP16_VECTOR "Build XNNPACK with ARM FP16 (FP16 data processing) vector micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_ARM_BF16 "Build XNNPACK with ARM BF16 (BFLOAT16) micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_ARM_DOTPROD "Build XNNPACK with ARM DotProd (integer dot product) micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_ARM_I8MM "Build XNNPACK with ARM I8MM (8-bit integer matrix multiply accumulate) micro-kernels" ON)
|
||||
OPTION(XNNPACK_ENABLE_RISCV_VECTOR "Build XNNPACK with RISC-V Vector micro-kernels" ON)
|
||||
+ENDIF()
|
||||
SET(XNNPACK_AVXVNNI_DEFAULT ON CACHE INTERNAL "Default value to enable AVX-VNNI in x86 builds.")
|
||||
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
IF(CMAKE_C_COMPILER_VERSION VERSION_LESS "11")
|
||||
@@ -571,6 +573,8 @@ IF(XNNPACK_BUILD_LIBRARY)
|
||||
TARGET_LINK_LIBRARIES(subgraph PRIVATE allocator logging memory mutex operators operator-run)
|
||||
TARGET_LINK_LIBRARIES(XNNPACK PRIVATE allocator cache hardware-config indirection jit logging memory microkernel-utils microparams-init mutex normalization operators operator-run operator-utils packing post-operation microkernels-prod subgraph)
|
||||
SET_TARGET_PROPERTIES(XNNPACK PROPERTIES C_EXTENSIONS YES)
|
||||
+ # YY.M.D of last upstream commit to main
|
||||
+ SET_TARGET_PROPERTIES(XNNPACK PROPERTIES SOVERSION "23.11.27")
|
||||
ENDIF()
|
||||
IF(NOT MSVC)
|
||||
SET_PROPERTY(SOURCE ${ALL_MICROKERNEL_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -fno-math-errno ")
|
||||
--
|
||||
2.43.0
|
||||
|
||||
2
sources
2
sources
|
|
@ -1,3 +1 @@
|
|||
SHA512 (xnnpack-51a9875.tar.gz) = 1742ad4de3aa1a67cd5a3cbf15d82afc2cc8569a2abac92542f748a440ef37fef4e9d9c302b7b2813e3176934b637c761c1c0956d20ab1ba28b280d9b121d91b
|
||||
SHA512 (xnnpack-fcbf55a.tar.gz) = 8063e27686f7b71cfba05b0c004c46db4506638689ffb112f013b3886de58653b60ca5487978c3f96275c17bb1136883ca4c93ddb2241a2c31925a950cb51759
|
||||
SHA512 (xnnpack-312eb7e.tar.gz) = fe027e3a5ff065675b845f391380939ebd85d1482b2b991b2ef0e6f15528d119cc36d52201f44d2301e34cf0928d53d7b52e95a29c5d69f48d1e2679b12e075c
|
||||
|
|
|
|||
46
xnnpack.spec
46
xnnpack.spec
|
|
@ -2,16 +2,14 @@
|
|||
%bcond_with gitcommit
|
||||
|
||||
%if %{with gitcommit}
|
||||
# Something recent to match change to cpuinfo
|
||||
%global commit0 312eb7e13554ce75d02c5cb27357555f1368f2d1
|
||||
%global date0 20240814
|
||||
|
||||
# commit is what PyTorch 2.3 at its gitcommit expects
|
||||
%global commit0 d9cce341f86a207da9d851d05e26cd50b508b73c
|
||||
%global date0 20231127
|
||||
%else
|
||||
# For PyTorch 2.5
|
||||
%global commit0 312eb7e13554ce75d02c5cb27357555f1368f2d1
|
||||
%global date0 20240814
|
||||
# commit is what PyTorch 2.1 expects, TOT has API changes that break PyTorch
|
||||
%global commit0 51a987591a6fc9f0fc0707077f53d763ac132cbf
|
||||
%global date0 20221221
|
||||
%endif
|
||||
|
||||
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
|
||||
|
||||
|
||||
|
|
@ -30,8 +28,7 @@ Release: %autorelease
|
|||
|
||||
URL: https://github.com/google/%{upstream_name}
|
||||
Source0: %{url}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz
|
||||
# https://github.com/google/XNNPACK/pull/6144
|
||||
Patch0: 0001-Fix-cmake-for-pthread-and-cpuinfo-with-USE_SYSTEM_LI.patch
|
||||
Patch0: 0001-Prepare-xnnpack-cmake-for-fedora.patch
|
||||
|
||||
ExclusiveArch: x86_64 aarch64
|
||||
|
||||
|
|
@ -62,9 +59,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
|||
%prep
|
||||
%autosetup -p1 -n %{upstream_name}-%{commit0}
|
||||
|
||||
# version of the *.so
|
||||
echo "SET_TARGET_PROPERTIES(XNNPACK PROPERTIES SOVERSION \"24.08.14\")" >> CMakeLists.txt
|
||||
|
||||
%build
|
||||
%cmake -G Ninja \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
|
|
@ -73,7 +67,6 @@ echo "SET_TARGET_PROPERTIES(XNNPACK PROPERTIES SOVERSION \"24.08.14\")" >> CMake
|
|||
-DXNNPACK_BUILD_BENCHMARKS=OFF \
|
||||
-DXNNPACK_BUILD_LIBRARY=ON \
|
||||
-DXNNPACK_BUILD_TESTS=OFF \
|
||||
-DXNNPACK_ENABLE_KLEIDIAI=OFF \
|
||||
-DXNNPACK_USE_SYSTEM_LIBS=ON \
|
||||
-DXNNPACK_LIBRARY_TYPE=shared
|
||||
|
||||
|
|
@ -83,10 +76,17 @@ echo "SET_TARGET_PROPERTIES(XNNPACK PROPERTIES SOVERSION \"24.08.14\")" >> CMake
|
|||
mkdir -p %{buildroot}%{_includedir}
|
||||
install -p -m 644 include/xnnpack.h %{buildroot}%{_includedir}
|
||||
mkdir -p %{buildroot}%{_libdir}
|
||||
strip libXNNPACK.so.24.08.14
|
||||
install -p -m 755 libXNNPACK.so.24.08.14 %{buildroot}%{_libdir}
|
||||
%if %{with gitcommit}
|
||||
strip libXNNPACK.so.23.11.27
|
||||
install -p -m 755 libXNNPACK.so.23.11.27 %{buildroot}%{_libdir}
|
||||
cd %{buildroot}%{_libdir}
|
||||
ln -s libXNNPACK.so.24.08.14 libXNNPACK.so
|
||||
ln -s libXNNPACK.so.23.11.27 libXNNPACK.so
|
||||
%else
|
||||
strip libXNNPACK.so.0.0.221221
|
||||
install -p -m 755 libXNNPACK.so.0.0.221221 %{buildroot}%{_libdir}
|
||||
cd %{buildroot}%{_libdir}
|
||||
ln -s libXNNPACK.so.0.0.221221 libXNNPACK.so
|
||||
%endif
|
||||
|
||||
# building tests or benchmarks is broken
|
||||
# % check
|
||||
|
|
@ -102,4 +102,14 @@ ln -s libXNNPACK.so.24.08.14 libXNNPACK.so
|
|||
%{_libdir}/libXNNPACK.so
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
* Tue Jan 30 2024 Tom Rix <trix@redhat.com> - 0.0^git20221221.51a9875-4
|
||||
- Fix arm build
|
||||
|
||||
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.0^git20221221.51a9875-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Tue Oct 10 2023 Tom Rix <trix@redhat.com> - 0.0^git20221221.51a9875-2
|
||||
- Address review comments
|
||||
|
||||
* Thu Oct 5 2023 Tom Rix <trix@redhat.com> - 0.0^git20221221.51a9875-1
|
||||
- Initial package
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue