summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAndy Tai <atai@atai.org>2025-09-29 23:54:37 -0700
committerCayetano Santos <csantosb@inventati.org>2026-02-24 22:03:45 +0100
commita92bf1b96c0dda7d5c41b4c6755f9fd0249aed80 (patch)
tree0ea9ca8aeb8d51579a2910e3bc35fffc589401dd /gnu
parent1ca156a687c5259ceb567684de782edfb6d6611b (diff)
gnu: Add mnn.
* gnu/packages/machine-learning.scm (mnn): New variable. Merges guix/guix!3134 Change-Id: I6b39e49e360804c0787c41c0e287c30eced3bfcc Modified-by: Cayetano Santos <csantosb@inventati.org> Signed-off-by: Cayetano Santos <csantosb@inventati.org>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/machine-learning.scm77
1 files changed, 77 insertions, 0 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index abad5200104..e640bb65c40 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -6979,6 +6979,83 @@ easily extensible.")
Brian 2 simulator.")
(license license:cecill)))
+(define-public mnn
+ (package
+ (name "mnn")
+ (version "3.4.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/alibaba/MNN/")
+ (commit version)))
+ (snippet
+ #~(begin
+ (use-modules (guix build utils))
+ ;; Remove external libraries. Almost all of them are
+ ;; available in Guix.
+ (with-directory-excursion "3rd_party"
+ (for-each delete-file-recursively
+ '(;;"OpenCLHeaders"; for now does not build if in tree copy removed
+ ;; "flatbuffers" ; for now does not build if in tree copy removed
+ ;; "protobuf" ; for now does not build if in tree copy removed
+ "rapidjson")))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "073cdbcazxjzffajmn1w28jcaavann0c55fnm7cf7b0azj5vnhg6"))))
+ (build-system cmake-build-system)
+ (native-inputs (list googletest pkg-config python-minimal-wrapper))
+ (inputs (list flatbuffers
+ fp16
+ glew
+ glslang
+ glu
+ mesa
+ mesa-headers
+ mesa-opencl
+ opencl-headers
+ opencl-clhpp
+ opencl-icd-loader
+ opencv
+ protobuf
+ pthreadpool
+ rapidjson
+ shaderc
+ vulkan-headers
+ vulkan-loader))
+ (arguments
+ (list
+ #:configure-flags
+ #~(list "-DMNN_USE_SYSTEM_LIB=ON"
+ "-DMNN_OPENMP=ON"
+ ;; "-DMNN_OPENGL=ON" ; TO DO
+ "-DMNN_OPENCL=ON"
+ "-DMNN_VULKAN=ON"
+ "-DMNN_SUPPORT_BF16=ON"
+ "-DMNN_BUILD_TEST=ON"
+ "-DMNN_BUILD_AUDIO=ON"
+ "-DMNN_BUILD_OPENCV=ON"
+ "-DMNN_IMGCODECS=ON"
+ ;; "-DMNN_AUDIO_TEST=ON"
+ ;; tests trying to fetch googletest and cannot build
+ ;; "-DMNN_OPENCV_TEST=ON"
+ ;; TO DO: remove the fetch in cmake and use system googletest
+ "-DMNN_OPENCV_BENCH=ON"
+ "-DMNN_BUILD_QUANTOOLS=ON"
+ "-DMNN_EVALUATION=ON"
+ "-DMNN_BUILD_BENCHMARK=ON"
+ "-DMNN_BUILD_TOOLS=ON"
+ "-DMNN_BUILD_CONVERTER=ON"
+ "-DMNN_USE_SSE=ON"
+ "-DMNN_AVX512=ON") ;TO DO: add Pytorch support
+ #:tests? #f)) ;tests not building yet, cannot run
+ (home-page "http://www.mnn.zone/")
+ (synopsis "Fast, lightweight deep learning framework")
+ (description
+ "MNN is a deep learning framework. It supports inference and
+training of deep learning models for inference and training on-device.")
+ (license license:asl2.0)))
+
(define-public python-gguf
(package
(name "python-gguf")