gnu: Add XNNPACK.

* gnu/packages/machine-learning.scm (xnnpack): New variable.
* gnu/packages/patches/xnnpack-system-libraries.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
This commit is contained in:
Ludovic Courtès 2021-07-29 21:15:23 +02:00 committed by Ludovic Courtès
parent 1daa662722
commit b402a3ec86
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 1550 additions and 0 deletions

View file

@ -1859,6 +1859,7 @@ dist_patch_DATA = \
%D%/packages/patches/xfce4-panel-plugins.patch \
%D%/packages/patches/xfce4-settings-defaults.patch \
%D%/packages/patches/xmonad-dynamic-linking.patch \
%D%/packages/patches/xnnpack-system-libraries.patch \
%D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \
%D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \
%D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \

View file

@ -70,6 +70,7 @@ (define-module (gnu packages machine-learning)
#:use-module (gnu packages mpi)
#:use-module (gnu packages ocaml)
#:use-module (gnu packages onc-rpc)
#:use-module (gnu packages parallel)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages protobuf)
@ -2229,3 +2230,52 @@ (define-public python-umap-learn
technique that can be used for visualisation similarly to t-SNE, but also for
general non-linear dimension reduction.")
(license license:bsd-3)))
(define-public xnnpack
;; There's currently no tag on this repo.
(let ((version "0.0")
(commit "bbe88243aba847f6a3dd86defec0fea4a0e415a1")
(revision "1"))
(package
(name "xnnpack")
(version (git-version version revision commit))
(home-page "https://github.com/google/XNNPACK")
(source (origin
(method git-fetch)
(uri (git-reference (url home-page) (commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"19j605x1l2h95mjhcj90zwjh1153pdgmqggl35ya5w0wll628iiz"))
(patches (search-patches "xnnpack-system-libraries.patch"))))
(build-system cmake-build-system)
(arguments
'(#:configure-flags '("-DXNNPACK_USE_SYSTEM_LIBS=YES"
"-DBUILD_SHARED_LIBS=ON"
"-DXNNPACK_LIBRARY_TYPE=shared"
"-DXNNPACK_BUILD_TESTS=FALSE" ;FIXME: see below
"-DXNNPACK_BUILD_BENCHMARKS=FALSE")
;; FIXME: Building tests leads to a CMake error:
;;
;; ADD_LIBRARY cannot create target "all_microkernels" because
;; another target with the same name already exists.
#:tests? #f))
(inputs
`(("cpuinfo" ,cpuinfo)
("pthreadpool" ,pthreadpool)
("googletest" ,googletest)
("googlebenchmark" ,googlebenchmark)
("fxdiv" ,fxdiv)
("fp16" ,fp16)
("psimd" ,psimd)))
(synopsis "Optimized floating-point neural network inference operators")
(description
"XNNPACK is a highly optimized library of floating-point neural network
inference operators for ARM, WebAssembly, and x86 platforms. XNNPACK is not
intended for direct use by deep learning practitioners and researchers;
instead it provides low-level performance primitives for accelerating
high-level machine learning frameworks, such as TensorFlow Lite,
TensorFlow.js, PyTorch, and MediaPipe.")
(license license:bsd-3))))

File diff suppressed because it is too large Load diff