diff options
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r-- | gnu/packages/machine-learning.scm | 2362 |
1 files changed, 915 insertions, 1447 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 2b6955b406..01b7c49de5 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -4,7 +4,6 @@ ;;; Copyright © 2016, 2017, 2020 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com> ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net> ;;; Copyright © 2018 Mark Meyer <mark@ofosos.org> ;;; Copyright © 2018 Ben Woodcroft <donttrustben@gmail.com> ;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com> @@ -16,8 +15,8 @@ ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net> ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com> ;;; Copyright © 2020-2025 Vinicius Monego <monego@posteo.net> -;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> -;;; Copyright © 2022, 2023, 2024 Nicolas Graves <ngraves@ngraves.fr> +;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim@guixotic.coop> +;;; Copyright © 2022-2025 Nicolas Graves <ngraves@ngraves.fr> ;;; Copyright © 2022 Kiran Shila <me@kiranshila.com> ;;; Copyright © 2022 Wiktor Zelazny <wzelazny@vurv.cz> ;;; Copyright © 2023 zamfofex <zamfofex@twdb.moe> @@ -31,6 +30,7 @@ ;;; Copyright © 2024, 2025 David Elsing <david.elsing@posteo.net> ;;; Copyright © 2024 Andy Tai <atai@atai.org> ;;; Copyright © 2025 Lapearldot <lapearldot@disroot.org> +;;; Copyright © 2025 Cayetano Santos <csantosb@inventati.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -76,16 +76,12 @@ #:use-module (gnu packages boost) #:use-module (gnu packages build-tools) #:use-module (gnu packages c) + #:use-module (gnu packages calendar) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) #:use-module (gnu packages cpp) #:use-module (gnu packages cran) - #:use-module (gnu packages crates-check) - #:use-module (gnu packages crates-crypto) - #:use-module (gnu packages crates-io) - #:use-module (gnu packages crates-tls) - #:use-module (gnu packages crates-web) #:use-module (gnu packages curl) #:use-module (gnu packages databases) #:use-module (gnu packages dejagnu) @@ -125,6 +121,7 @@ #:use-module (gnu packages python) #:use-module (gnu packages python-build) #:use-module (gnu packages python-check) + #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-science) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) @@ -139,6 +136,7 @@ #:use-module (gnu packages sqlite) #:use-module (gnu packages statistics) #:use-module (gnu packages swig) + #:use-module (gnu packages textutils) #:use-module (gnu packages time) #:use-module (gnu packages tls) #:use-module (gnu packages valgrind) @@ -154,7 +152,7 @@ (define-public dlpack (package (name "dlpack") - (version "1.0") + (version "1.1") (source (origin (method git-fetch) @@ -163,10 +161,10 @@ (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "169slm88jin4ddhdwk1qhqzzkhkwk1jrz35i7abhcqkry9wjib4f")))) + (base32 "0vlp8gcf7s3snalj6xmvgqxxn96fki6gw9hzph30gmgdbaz730j6")))) (build-system cmake-build-system) (arguments (list #:tests? #f)) ;No tests. - (home-page "https://github.com/dmlc/dlpack") + (home-page "https://dmlc.github.io/dlpack/latest/") (synopsis "In memory tensor structure") (description "DLPack is an in-memory tensor structure for sharing tensors among @@ -188,7 +186,16 @@ frameworks.") (base32 "07cz2ghfq6amcljaxpdr5chbd64ph513y8zqmibfx2xwfp74xkhn")))) (build-system cmake-build-system) ;; Tests require downloading of test data. - (arguments (list #:tests? #false)) + (arguments + (list + #:tests? #false + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'gcc-14-fix + (lambda _ + (substitute* "src/args.cc" + (("#include <unordered_map>" all) + (string-append all "\n#include <cstdint>")))))))) (home-page "https://github.com/facebookresearch/fastText") (synopsis "Library for fast text representation and classification") (description "fastText is a library for efficient learning of word @@ -220,6 +227,40 @@ representations and sentence classification.") family of functions.") (license license:expat))) +(define-public python-faster-whisper + (package + (name "python-faster-whisper") + (version "1.2.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/SYSTRAN/faster-whisper") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0wmc9aszpnbr60l5v97np0rc3zsz4pldjald7kmnr668rhpakzcj")))) + (build-system pyproject-build-system) + ;; XXX: Currently tests requires model download, which we'd rather avoid + ;; in Guix unless we're sure about the FOSS weights. To test in source : + ;; guix shell -D python-faster-whisper -- pytest + (arguments (list #:tests? #f)) + (propagated-inputs (list (list onnxruntime "python") + python-av + python-ctranslate2 + python-huggingface-hub + python-tokenizers + python-tqdm)) + (native-inputs (list python-numpy + python-pytest + python-setuptools)) + (home-page "https://github.com/SYSTRAN/faster-whisper") + (synopsis "Whisper transcription reimplementation") + (description + "This package provides a reimplementation of OpenAI's Whisper model using +CTranslate2, which is a inference engine for transformer models.") + (license license:expat))) + (define-public python-fasttext (package (inherit fasttext) @@ -242,6 +283,7 @@ family of functions.") (build-system pyproject-build-system) (arguments (list + ;; tests: 7636 passed, 3859 skipped, 2 deselected, 69 xfailed, 2 xpassed #:test-flags '(list "-k" (string-append @@ -253,23 +295,14 @@ family of functions.") (propagated-inputs (list python-makefun python-multipledispatch python-numpy python-opt-einsum python-typing-extensions)) - (native-inputs (list python-black - python-flake8 - python-isort - python-nbsphinx - python-pandas + (native-inputs (list python-pandas python-pillow python-pyro-api python-pytest - python-pytest-xdist python-requests python-scipy python-setuptools - python-sphinx - python-sphinx-gallery - python-sphinx-rtd-theme - python-torchvision - python-wheel)) + python-torchvision)) (home-page "https://github.com/pyro-ppl/funsor") (synopsis "Tensor-like library for functions and distributions") (description @@ -278,30 +311,41 @@ distributions.") (license license:asl2.0))) (define-public fann - ;; The last release is >100 commits behind, so we package from git. - (let ((commit "d71d54788bee56ba4cf7522801270152da5209d7")) + ;; The last release is 14 years old. + (let ((commit "1783cbf6239a597c4d29f694e227e22b8d4f4bf6") + (revision "2")) (package (name "fann") - (version (string-append "2.2.0-1." (string-take commit 8))) - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/libfann/fann") - (commit commit))) - (file-name (string-append name "-" version "-checkout")) - (sha256 - (base32 - "0ibwpfrjs6q2lijs8slxjgzb2llcl6rk3v2ski4r6215g5jjhg3x")))) + (version (git-version "2.2.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/libfann/fann") + (commit commit))) + (modules '((guix build utils))) + (snippet #~(delete-file-recursively "lib/googletest")) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0jlcxl0czlr3982mak3935mb08i2f368f0jsxca91ppgfd596ldr")))) (build-system cmake-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (with-directory-excursion (string-append (getcwd) "/tests") - (invoke "./fann_tests")))))))) - (home-page "http://leenissen.dk/fann/wp/") + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-googletest + (lambda _ + (substitute* "CMakeLists.txt" + (("ADD_SUBDIRECTORY\\( lib/googletest \\)") + "")))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "tests" + (invoke "./fann_tests")))))))) + (native-inputs (list googletest)) + (home-page "https://leenissen.dk/") (synopsis "Fast Artificial Neural Network") (description "FANN is a neural network library, which implements multilayer @@ -312,39 +356,40 @@ sparsely connected networks.") (define-public libsvm (package (name "libsvm") - (version "3.23") + (version "336") (source (origin - (method url-fetch) - (uri (string-append "https://www.csie.ntu.edu.tw/~cjlin/libsvm/" - name "-" version ".tar.gz")) + (method git-fetch) + (uri (git-reference + (url "https://github.com/cjlin1/libsvm/") + (commit (string-append "v" version)))) (sha256 - (base32 "0jpaq0rr92x38p4nk3gjan79ip67m6p80anb28z1d8601miysyi5")))) + (base32 "03ns6frhfdcyl661ws1yqbzsa6m8wrmba544vlacghry2kg88hn2")))) (build-system gnu-build-system) (arguments - `(#:tests? #f ; no "check" target - #:phases - (modify-phases %standard-phases - (delete 'configure) - (add-after 'build 'build-lib - (lambda _ - (invoke "make" "lib"))) - (replace 'install ; no ‘install’ target - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin/")) - (lib (string-append out "/lib/")) - (inc (string-append out "/include/libsvm"))) - (mkdir-p bin) - (for-each (lambda (file) - (copy-file file (string-append bin file))) - '("svm-train" - "svm-predict" - "svm-scale")) - (mkdir-p lib) - (install-file "libsvm.so.2" lib) - (mkdir-p inc) - (install-file "svm.h" inc))))))) + (list + #:tests? #f ;no "check" target + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'build 'build-lib + (lambda _ + (invoke "make" "lib"))) + (replace 'install + ;no "install" target + (lambda _ + (for-each (lambda (file) + (install-file file + (string-append #$output "/bin"))) + '("svm-train" "svm-predict" "svm-scale")) + (install-file "libsvm.so.4" + (string-append #$output "/lib")) + (symlink (string-append #$output "/lib/libsvm.so.4") + (string-append #$output "/lib/libsvm.so")) + (install-file "svm.h" + (string-append #$output "/include/" + #$name))))))) + (native-inputs (list python-minimal-wrapper)) (home-page "https://www.csie.ntu.edu.tw/~cjlin/libsvm/") (synopsis "Library for Support Vector Machines") (description @@ -367,6 +412,15 @@ classification.") (build-system pyproject-build-system) (arguments (list + #:test-flags + ;; TODO: Review tests. + #~(list + ;; Failed: 'yield' keyword is allowed in fixtures, but not in tests + ;; (test_scale2_models) + "--ignore=GPy/testing/test_likelihood.py" + ;; Failed: 'yield' keyword is allowed in fixtures, but not in + ;; tests (test_figure) + "--ignore=GPy/testing/test_plotting.py") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'compatibility @@ -403,35 +457,20 @@ machine learning algorithms based on GPs.") (license license:bsd-3))) (define-public python-libsvm - (package (inherit libsvm) + (package + (inherit libsvm) (name "python-libsvm") - (build-system gnu-build-system) + (build-system pyproject-build-system) (arguments - `(#:tests? #f ; no "check" target - #:make-flags '("-C" "python") - #:phases - (modify-phases %standard-phases - (delete 'configure) - (replace - 'install ; no ‘install’ target - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((site (string-append (assoc-ref outputs "out") - "/lib/python" - (string-take - (string-take-right - (assoc-ref inputs "python") 5) 3) - "/site-packages/"))) - (substitute* "python/svm.py" - (("../libsvm.so.2") "libsvm.so.2")) - (mkdir-p site) - (for-each (lambda (file) - (copy-file file (string-append site (basename file)))) - (find-files "python" "\\.py")) - (copy-file "libsvm.so.2" - (string-append site "libsvm.so.2"))) - #t))))) - (inputs - (list python)) + (list + #:tests? #f ;no "check" target + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'chdir + (lambda _ + (chdir "python")))))) + (native-inputs (list python-setuptools python-wheel)) + (propagated-inputs (list libsvm python-scipy)) (synopsis "Python bindings of libSVM"))) (define-public python-mcfit @@ -499,6 +538,65 @@ transforms.") Learning usecases.") (license license:asl2.0))) +(define-public python-ml-dtypes + (package + (name "python-ml-dtypes") + (version "0.2.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jax-ml/ml_dtypes") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1yv90f28c9w34430xjwvn1lzxdylvp1zi6b02cx7crla6qkvrzn5")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-eigen-package + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "setup.py" + (("third_party/eigen") + (search-input-directory inputs "include/eigen3"))))) + (add-after 'install 'symlink-lib + (lambda* (#:key inputs outputs #:allow-other-keys) + (for-each + (lambda (file) + (symlink file + (string-append #$output "/lib/ml_dtypes.so"))) + (find-files (site-packages inputs outputs) "\\.so$"))))))) + (inputs (list eigen-for-python-ml-dtypes)) + (propagated-inputs (list python-numpy)) + (native-inputs (list pybind11 + python-absl-py + python-pytest + python-setuptools + python-wheel)) + (home-page "https://github.com/jax-ml/ml_dtypes") + (synopsis "NumPy dtype extensions used in machine learning") + (description + "This package is a stand-alone implementation of several +NumPy @code{dtype} extensions used in machine learning libraries, including: + +@itemize +@item @code{bfloat16}: an alternative to the standard @code{float16} format +@item @code{float8_*}: several experimental 8-bit floating point + representations including: + @itemize + @item @code{float8_e4m3b11fnuz} + @item @code{float8_e4m3fn} + @item @code{float8_e4m3fnuz} + @item @code{float8_e5m2} + @item @code{float8_e5m2fnuz} + @end itemize +@item @code{int4} and @code{uint4}: low precision integer types. +@end itemize +") + (license license:asl2.0))) + (define-public ghmm ;; The latest release candidate is several years and a couple of fixes have ;; been published since. This is why we download the sources from the SVN @@ -576,114 +674,8 @@ Markov Models} (HMM) and algorithms: discrete, continuous emissions, basic training, HMM clustering, HMM mixtures.") (license license:lgpl2.0+)))) -(define-public guile-aiscm - (package - (name "guile-aiscm") - (version "0.25.2") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/wedesoft/aiscm") - (commit "v0.25.2"))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1sagpxwrqxkn5b9zqzd07c9r7swmw45q672pa8fy6s71iw6a0x77")))) - (build-system gnu-build-system) - (arguments - (list - #:make-flags - #~(list (string-append "GUILE_CACHE=" #$output "/lib/guile/3.0/site-ccache") - (string-append "GUILE_EXT=" #$output "/lib/guile/3.0/extensions") - (string-append "GUILE_SITE=" #$output "/share/guile/site/3.0")) - #:phases - '(modify-phases %standard-phases - (add-after 'unpack 'build-reproducibly - (lambda _ - (substitute* "doc/Makefile.am" - (("\\$\\(DATE\\)") "1970-01-01")))) - (add-after 'unpack 'find-clearsilver - (lambda* (#:key inputs #:allow-other-keys) - (substitute* "configure.ac" - (("/usr/local/include/ClearSilver") - (string-append (assoc-ref inputs "clearsilver") - "/include/ClearSilver"))) - (substitute* "aiscm/Makefile.am" - (("-lneo_utl" m) - (string-append m " -lstreamhtmlparser"))) - (setenv "C_INCLUDE_PATH" - (string-append (assoc-ref inputs "clearsilver") - "/include/ClearSilver:" - (or (getenv "C_INCLUDE_PATH") ""))))) - (add-after 'unpack 'use-llvm-config - (lambda _ - (substitute* "m4/ax_llvmc.m4" - (("llvm-config-11") "llvm-config") - ;; For some reason this library is not on the link list. - (("(LLVM_LIBS=\"\\$\\(\\$ac_llvm_config_path --libs \\$1\\))\"" _ m) - (string-append m " -lLLVMMCJIT\""))) - - ;; Because of this message: - ;; symbol lookup error: ./.libs/libguile-aiscm-core.so: undefined symbol: LLVMInitializeX86TargetInfo - ;; This probably needs to differ when building on architectures - ;; other than x86_64. - (substitute* "aiscm/Makefile.am" - (("LLVM_LIBS\\)") "LLVM_LIBS) \ --lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info")))) - ;; This test fails because our version of tensorflow is too old - ;; to provide tf-string-length. - (add-after 'unpack 'disable-broken-test - (lambda _ - (substitute* "tests/test_tensorflow.scm" - (("\\(test-eqv \"determine string length" m) - (string-append "#;" m))))) - ;; Use Clang instead of GCC. - (add-before 'configure 'prepare-build-environment - (lambda _ - (setenv "AR" "llvm-ar") - (setenv "NM" "llvm-nm") - (setenv "CC" "clang") - (setenv "CXX" "clang++")))))) - (inputs - (list clearsilver - ffmpeg-4 - freeglut - guile-3.0 - imagemagick - libgc - libjpeg-turbo - libomp - libxi - libxmu - libxpm - libxt - libxv - mesa - mjpegtools - pandoc - pulseaudio - tensorflow)) - (native-inputs - (list clang-13 - llvm-13 - pkg-config - protobuf-c-for-aiscm - autoconf - automake - gettext-minimal - libtool - which)) - (home-page "https://wedesoft.github.io/aiscm/") - (synopsis "Guile extension for numerical arrays and tensors") - (description "AIscm is a Guile extension for numerical arrays and tensors. -Performance is achieved by using the LLVM JIT compiler.") - (license license:gpl3+))) - -(define-public guile-aiscm-next - (deprecated-package "guile-aiscm-next" guile-aiscm)) - (define-public llama-cpp - (let ((tag "b6056")) + (let ((tag "b6101")) (package (name "llama-cpp") (version (string-append "0.0.0-" tag)) @@ -695,7 +687,7 @@ Performance is achieved by using the LLVM JIT compiler.") (commit tag))) (file-name (git-file-name name tag)) (sha256 - (base32 "1y9blrd7c8snazjmjkzj0148v328pigncvf1l9g1ih735b67zpd0")))) + (base32 "0yz97dk19pxqck9l83wvlwzf1i78wrc55hrk9ynraqybdz7yqjdc")))) (build-system cmake-build-system) (arguments (list @@ -882,8 +874,11 @@ without dependencies, with "15xlax3z31lsn62vlg94hkm75nm40q4679amnfg13jm8m2bnhy5m")))) (build-system gnu-build-system) (arguments - `(#:configure-flags (list "--enable-blast" - "CFLAGS=-fcommon"))) + (list + #:configure-flags + #~(list "--enable-blast" + (string-append "CFLAGS=-fcommon -g -O2" + " -Wno-error=implicit-function-declaration")))) (inputs (list perl)) (home-page "https://micans.org/mcl/") @@ -952,16 +947,17 @@ algorithm.") (define-public openmm (package (name "openmm") - (version "8.1.1") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/openmm/openmm") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "064vv6zaci30pj38z5lwfqscxssm67jqxkz30hcya9vm4ng831d5")))) + (version "8.3.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/openmm/openmm") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0pcy1f6r4h6z0b75gx4lcnkf7yr8342w2dch7jml1ycmzpqkxvfx")))) (build-system cmake-build-system) (arguments (list @@ -1114,16 +1110,17 @@ optimizing, and searching weighted finite-state transducers (FSTs).") (define-public sentencepiece (package (name "sentencepiece") - (version "0.1.97") + (version "0.2.1") (source (origin (method git-fetch) - (uri (git-reference - (url "https://github.com/google/sentencepiece") - (commit (string-append "v" version)))) + (uri + (git-reference + (url "https://github.com/google/sentencepiece/") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1kzfkp2pk0vabyw3wmkh16h11chzq63mzc20ddhsag5fp6s91ajg")))) + (base32 "1yzsaam3kk9fqzxfc3nm2pskwq1bdgkrijmcmzmg5x0338rn0hmb")))) (build-system cmake-build-system) (arguments (list #:tests? #f)) ;no tests (native-inputs (list gperftools)) @@ -1156,6 +1153,7 @@ depend on language-specific pre- or post-processing.") (sha256 (base32 "018ilrp41fcclmb5lsml3aijwbmhbq3m7wy65hr1fryj0avic8fr")))) (build-system pyproject-build-system) + (arguments (list #:test-backend #~'unittest)) (native-inputs (list python-setuptools python-wheel)) (home-page "https://github.com/sofiatolaosebikan/hopcroftkarp") (synopsis "Implementation of the Hopcroft-Karp algorithm") @@ -1167,23 +1165,24 @@ cardinality matching from a bipartite graph.") (define-public python-persim (package (name "python-persim") - (version "0.3.2") + (version "0.3.8") (source (origin (method url-fetch) (uri (pypi-uri "persim" version)) (sha256 - (base32 "0q8wfakx8q4h3ryvw8cba0v6z7xn9139qkrzs3mi1ggyzacnx9d7")))) + (base32 "03d4kgakpgj54c3pl9dkqrkbmj6w13gmczkds5jagf3n85c1hgg1")))) (build-system pyproject-build-system) - (propagated-inputs (list python-deprecated - python-hopcroftkarp - python-joblib - python-matplotlib - python-numpy - python-scikit-learn - python-scipy)) - (native-inputs (list python-pytest python-pytest-cov python-setuptools - python-wheel)) + (native-inputs + (list python-pytest python-setuptools)) + (propagated-inputs + (list python-deprecated + python-hopcroftkarp + python-joblib + python-matplotlib + python-numpy + python-scikit-learn + python-scipy)) (home-page "https://persim.scikit-tda.org") (synopsis "Tools for analyzing persistence diagrams in Python") (description @@ -1348,34 +1347,6 @@ and not test_wmt22_references") and reproducible BLEU, chrF, and TER scores for natural language processing.") (license license:asl2.0))) -(define-public rust-safetensors - (package - (name "rust-safetensors") - (version "0.4.3") - (source - (origin - (method url-fetch) - (uri (crate-uri "safetensors" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "1fbx56wikqcvqb4y0ym0cys68lj0v3cpanhsy5i13fkz5jr7dvcc")))) - (build-system cargo-build-system) - (arguments - `(#:cargo-inputs - (("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1)) - #:cargo-development-inputs - (("rust-criterion" ,rust-criterion-0.5) - ("rust-memmap2" ,rust-memmap2-0.9) - ("rust-proptest" ,rust-proptest-1)))) - (home-page "https://github.com/huggingface/safetensors") - (synopsis "Simple and safe way to store and distribute tensors") - (description - "This package provides a fast (zero-copy) and safe (dedicated) format for -storing tensors safely, named safetensors. They aim to be safer than their -@code{PyTorch} counterparts.") - (license license:asl2.0))) - (define-public python-safetensors (package (name "python-safetensors") @@ -1400,31 +1371,15 @@ storing tensors safely, named safetensors. They aim to be safer than their (unless (member file '("." "..")) (rename-file (string-append "bindings/python/" file) file))) - (scandir "bindings/python")))))) + (scandir "bindings/python")) + (substitute* "Cargo.toml" + (("^path = .*") "")))))) (build-system cargo-build-system) (arguments (list - #:modules '((guix build cargo-build-system) - (guix build utils) - (ice-9 regex) - (ice-9 textual-ports) - (srfi srfi-26)) + #:install-source? #f #:phases #~(modify-phases %standard-phases - (add-after 'unpack-rust-crates 'inject-safetensors - (lambda _ - (substitute* "Cargo.toml" - (("\\[dependencies\\]") - (format #f "[dependencies]~%safetensors = ~s" - #$(package-version rust-safetensors)))) - (call-with-input-file "Cargo.toml" - (lambda (port) - (let* ((content (get-string-all port)) - (top-match (string-match - "\\[dependencies.safetensors" - content))) - (call-with-output-file "Cargo.toml" - (cut display (match:prefix top-match) <>))))))) (add-before 'check 'install-rust-library (lambda _ (copy-file "target/release/libsafetensors_rust.so" @@ -1454,14 +1409,9 @@ storing tensors safely, named safetensors. They aim to be safer than their (copy-file "PKG-INFO" (string-append info "/METADATA")) (copy-recursively "py_src/safetensors" - (string-append lib "safetensors")))))) - #:cargo-inputs - `(("rust-pyo3" ,rust-pyo3-0.21) - ("rust-memmap2" ,rust-memmap2-0.9) - ("rust-safetensors" ,rust-safetensors) - ("rust-serde-json" ,rust-serde-json-1)))) + (string-append lib "safetensors")))))))) (inputs - (list rust-safetensors)) + (cargo-inputs 'python-safetensors)) (native-inputs (list python-h5py python-minimal @@ -1471,64 +1421,52 @@ storing tensors safely, named safetensors. They aim to be safer than their python-pytorch)) (home-page "https://huggingface.co/docs/safetensors") (synopsis "Simple and safe way to store and distribute tensors") - (description "This package provides a fast (zero-copy) and safe -(dedicated) format for storing tensors safely. This package builds upon -@code{rust-safetensors} and provides Python bindings.") + (description + "This package provides a fast (zero-copy) and safe (dedicated) format for +storing tensors safely.") (license license:asl2.0))) (define-public python-sentencepiece (package + (inherit sentencepiece) (name "python-sentencepiece") - (version "0.1.97") - (source - (origin - (method url-fetch) - (uri (pypi-uri "sentencepiece" version)) - (sha256 - (base32 "0v0z9ryl66432zajp099bcbnwkkldzlpjvgnjv9bq2vi19g300f9")))) - (build-system python-build-system) - (native-inputs (list pkg-config)) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "python")))))) + (native-inputs + (list pkg-config protobuf python-pytest python-setuptools)) (propagated-inputs (list sentencepiece)) - (home-page "https://github.com/google/sentencepiece") (synopsis "SentencePiece python wrapper") (description "This package provides a Python wrapper for the SentencePiece -unsupervised text tokenizer.") - (license license:asl2.0))) +unsupervised text tokenizer."))) (define-public python-sentence-transformers (package (name "python-sentence-transformers") - (version "3.0.1") + (version "5.1.0") (source (origin - (method url-fetch) - (uri (pypi-uri "sentence_transformers" version)) + (method git-fetch) + (uri (git-reference + (url "https://github.com/UKPLab/sentence-transformers/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "1xmzbyrlp6wa7adf42n67c544db17nz95b10ri603lf4gi9jqgca")))) + (base32 + "1jkj77q25b21nxrdszvlw127jnx1m7x8czldiq2mfyj76yjk0ymj")))) (build-system pyproject-build-system) (arguments - (list - #:test-flags - '(list - ;; Missing fixture / train or test data. - ;; Requires internet access. - "--ignore=tests/test_sentence_transformer.py" - "--ignore=tests/test_train_stsb.py" - "--ignore=tests/test_compute_embeddings.py" - "--ignore=tests/test_cross_encoder.py" - "--ignore=tests/test_model_card_data.py" - "--ignore=tests/test_multi_process.py" - "--ignore=tests/test_pretrained_stsb.py" - "-k" (string-append - "not test_LabelAccuracyEvaluator" - " and not test_ParaphraseMiningEvaluator" - " and not test_cmnrl_same_grad" - " and not test_paraphrase_mining" - " and not test_simple_encode")))) + (list #:tests? #f)) ;network access is required (propagated-inputs (list python-huggingface-hub python-numpy python-pillow python-pytorch + python-typing-extensions python-scikit-learn python-scipy python-tqdm @@ -1789,7 +1727,7 @@ operators and standard data types.") (patches (search-patches "onnx-optimizer-system-library.patch")) (modules '((guix build utils))) (snippet '(delete-file-recursively "third_party")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments ;; reuse build system tweaks (substitute-keyword-arguments (package-arguments onnx) @@ -1816,8 +1754,9 @@ operators and standard data types.") " and not test_fuse_transpose"))))))))) (native-inputs (append - (list cmake-minimal python-pytest python-pytest-runner - python-coverage) + (list cmake-minimal + python-pytest + python-setuptools) (filter (lambda (pkg) (member (or (%current-target-system) @@ -1840,92 +1779,186 @@ aim is to provide all such passes along with ONNX so that they can be re-used with a single function call.") (license license:expat))) -(define-public rxcpp +(define-public onnxruntime (package - (name "rxcpp") - (version "4.1.1") + (name "onnxruntime") + (version "1.22.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/ReactiveX/RxCpp") - (commit (string-append "v" version)))) + (url "https://github.com/microsoft/onnxruntime") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 - (base32 "1blyjjw6szd74pckdc15ham9i48xf0vwwz5nhl9vyjfq8z7w3piy")) - (file-name (git-file-name name version)))) + (base32 "0z2s79l4wdilssw9lmj319ypyyqi2y0dx0fpwr2yhq8bax3ci50n")))) (build-system cmake-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'remove-werror - (lambda _ - (substitute* (find-files ".") - (("-Werror") "")) - #t)) - (replace 'check - (lambda _ - (invoke "ctest")))))) + (list + #:modules '((guix build cmake-build-system) + (guix build utils) + ((guix build pyproject-build-system) #:prefix py:)) + #:imported-modules (append %cmake-build-system-modules + %pyproject-build-system-modules) + #:configure-flags + #~(list "-Donnxruntime_BUILD_UNIT_TESTS=OFF" + "-Donnxruntime_BUILD_SHARED_LIB=ON" + "-Donnxruntime_ENABLE_LTO=ON" + "-Donnxruntime_ENABLE_PYTHON=ON" + "-Donnxruntime_USE_FULL_PROTOBUF=OFF" + ;; XXX: Fixes build with gcc@14. + "-DCMAKE_CXX_FLAGS=-Wl,-z,noexecstack") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "cmake"))) + (add-after 'unpack 'relax-dependencies + (lambda _ + (with-output-to-file "cmake/external/eigen.cmake" + (lambda _ + (display "find_package(Eigen3 REQUIRED)\n"))) + (substitute* "cmake/external/abseil-cpp.cmake" + (("20240722") + (car (string-split #$(package-version + (this-package-input "abseil-cpp")) + #\.)))))) + (add-after 'install 'build-python + (lambda _ + (invoke "python3" "../setup.py" "bdist_wheel"))) + (add-after 'build-python 'install-python + (lambda* (#:key inputs #:allow-other-keys) + ((assoc-ref py:%standard-phases 'install) + #:inputs inputs + #:outputs `(("out" . ,#$output:python))))) + (add-after 'install-python 'add-install-to-pythonpath + (lambda* (#:key inputs #:allow-other-keys) + ((assoc-ref py:%standard-phases 'add-install-to-pythonpath) + #:inputs inputs + #:outputs `(("out" . ,#$output:python))))) + (delete 'check) + (add-after 'add-install-to-pythonpath 'check + (lambda* (#:key tests? #:allow-other-keys) + (with-directory-excursion "../onnxruntime/test/python" + ((assoc-ref py:%standard-phases 'check) + #:tests? tests? + #:test-flags + `(;; XXX: NotImplementedError + "--ignore-glob=quantization/*" + ;; XXX: These tests require transformer models or have + ;; import issues. + "--ignore=transformers/test_generation.py" + "--ignore=transformers/test_gpt2_benchmark.py" + "--ignore=transformers/test_gpt2_to_onnx.py" + "--ignore=transformers/test_optimizer_huggingface_bert.py" + "--ignore=transformers/test_parity_huggingface_gpt_attention.py" + "--ignore=transformers/test_shape_infer_helper.py" + ;; XXX: onnxscript ModuleNotFound + "--ignore=transformers/test_gelu_fusions.py" + "--ignore=transformers/test_gemma3_vision.py" + ;; XXX: Other failing tests. + "-k" ,(string-append + "not test_gelu_is_fused_by_default" + " and not test_inverse")))))) + (add-after 'check 'python-sanity-check + (lambda* (#:key tests? inputs #:allow-other-keys) + ((assoc-ref py:%standard-phases 'sanity-check) + #:inputs `(("sanity-check.py" . ,#$(default-sanity-check.py)) + ,@inputs) + #:outputs `(("out" . ,#$output:python)))))))) + (outputs (list "out" "python")) + (inputs + (list abseil-cpp + boost + cpuinfo + dlpack + c++-gsl + date + eigen-for-onnxruntime + flatbuffers-23.5 + googletest + nlohmann-json + onnx + protobuf + pybind11 + re2-next + safeint + zlib)) (native-inputs - (list catch-framework)) - (home-page "https://reactivex.io/") - (synopsis "Reactive Extensions for C++") + (list pkg-config + python-einops + python-wrapper + python-numpy + python-parameterized + python-psutil + python-pytest + python-pytorch + python-sentencepiece + python-setuptools)) + (propagated-inputs + (list python-coloredlogs + python-flatbuffers + python-protobuf + python-sympy)) + (home-page "https://github.com/microsoft/onnxruntime") + (synopsis "Cross-platform, high performance scoring engine for ML models") (description - "The Reactive Extensions for C++ (RxCpp) is a library of algorithms for -values-distributed-in-time. ReactiveX is a library for composing asynchronous -and event-based programs by using observable sequences. - -It extends the observer pattern to support sequences of data and/or events and -adds operators that allow you to compose sequences together declaratively while -abstracting away concerns about things like low-level threading, -synchronization, thread-safety, concurrent data structures, and non-blocking -I/O.") - (license license:asl2.0))) - + "ONNX Runtime is a performance-focused complete scoring engine +for Open Neural Network Exchange (ONNX) models, with an open +extensible architecture to continually address the latest developments +in AI and Deep Learning. ONNX Runtime stays up to date with the ONNX +standard with complete implementation of all ONNX operators, and +supports all ONNX releases (1.2+) with both future and backwards +compatibility.") + (license license:expat))) (define-public gemmlowp - (let ((commit "08e4bb339e34017a0835269d4a37c4ea04d15a69") + (let ((commit "16e8662c34917be0065110bfcd9cc27d30f52fdf") (version "0.1") - (revision "1")) + (revision "2")) (package (name "gemmlowp") (version (git-version version revision commit)) - (home-page "https://github.com/google/gemmlowp") - (source (origin - (method git-fetch) - (uri (git-reference (url home-page) (commit commit))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1q8f3w5slxd8fbn31hpm00y6wyp7gm71rzr27cmcff4b3px4ca6k")))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/google/gemmlowp") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "02xmrv921al94nihiqrvi8inlq6qc07j0zll3f9qi8322r31x83v")))) (arguments - `(#:configure-flags - (list ,@(match (%current-system) - ((or "x86_64-linux" "i686-linux") - '("-DCMAKE_CXX_FLAGS=-msse2")) - (_ '())) - "-DBUILD_SHARED_LIBS=ON") - #:phases - (modify-phases %standard-phases - ;; This directory contains the CMakeLists.txt. - (add-after 'unpack 'chdir - (lambda _ (chdir "contrib") #t)) - ;; There is no install target - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/")) - (inc (string-append out "/include/"))) - (install-file "../build/libeight_bit_int_gemm.so" lib) - (for-each (lambda (dir) - (let ((target - (string-append inc "/gemmlowp/" dir))) - (for-each (lambda (h) - (install-file h target)) - (find-files (string-append "../" dir) - "\\.h$")))) - '("meta" "profiling" "public" "fixedpoint" - "eight_bit_int_gemm" "internal")))))))) + (list + #:configure-flags + #~(list #$@(match (%current-system) + ((or "x86_64-linux" "i686-linux") + '("-DCMAKE_CXX_FLAGS=-msse2")) + (_ '())) + "-DBUILD_SHARED_LIBS=ON") + #:phases + #~(modify-phases %standard-phases + ;; This directory contains the CMakeLists.txt. + (add-after 'unpack 'chdir + (lambda _ + (chdir "contrib"))) + ;; There is no install target + (replace 'install + (lambda _ + (let ((lib (string-append #$output "/lib/"))) + (install-file "../build/libeight_bit_int_gemm.so" lib) + (for-each + (lambda (dir) + (let ((target (string-append #$output + "/include/gemmlowp/" dir))) + (for-each (lambda (h) + (install-file h target)) + (find-files (string-append "../" dir) + "\\.h$")))) + '("meta" "profiling" "public" "fixedpoint" + "eight_bit_int_gemm" "internal")))))))) (build-system cmake-build-system) + (home-page "https://github.com/google/gemmlowp") (synopsis "Small self-contained low-precision GEMM library") (description "This is a small self-contained low-precision @dfn{general matrix @@ -1935,46 +1968,6 @@ at most 8 bits. To avoid overflow, results are internally accumulated on more than 8 bits, and at the end only some significant 8 bits are kept.") (license license:asl2.0)))) -(define-public gemmlowp-for-tensorflow - ;; The commit hash is taken from "tensorflow/workspace.bzl". - (let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98") - (revision "2")) - (package - (inherit gemmlowp) - (version (git-version "0" revision commit)) - (source (origin - (method url-fetch) - (uri (string-append "https://mirror.bazel.build/" - "github.com/google/gemmlowp/archive/" - commit ".zip")) - (file-name (string-append "gemmlowp-" version ".zip")) - (sha256 - (base32 - "0n56s2g8hrssm4w8qj1v58gfm56a04n9v992ixkmvk6zjiralzxq")))) - (arguments - (substitute-keyword-arguments (package-arguments gemmlowp) - ((#:phases phases) - `(modify-phases ,phases - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib/")) - (inc (string-append out "/include/"))) - (install-file "../build/libeight_bit_int_gemm.so" lib) - (for-each (lambda (dir) - ;; Note: Install headers straight into - ;; $includedir instead of $includedir/gemmlowp. - (let ((target (string-append inc "/" dir))) - (for-each (lambda (h) - (install-file h target)) - (find-files (string-append "../" dir) - "\\.h$")))) - '("meta" "profiling" "public" "fixedpoint" - "eight_bit_int_gemm" "internal"))))))))) - (native-inputs - (list unzip)) - (properties '((hidden? . #t)))))) - (define-public dlib (package (name "dlib") @@ -2062,7 +2055,7 @@ computing environments.") (define-public python-scikit-learn (package (name "python-scikit-learn") - (version "1.6.1") + (version "1.7.0") (source (origin (method git-fetch) @@ -2071,7 +2064,7 @@ computing environments.") (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "08z1b58n31grfvl42wi6rdwrfhrdhnzkkxhg19iag3zkvkcvxqjl")))) + (base32 "105bd5n3l4db59lw0cdi6w8x9qysams017rjrly2629nklhiqx1q")))) (build-system pyproject-build-system) (arguments (list @@ -2292,32 +2285,39 @@ for scientific computing and data science (e.g. BLAS and OpenMP).") (define-public python-hdbscan (package (name "python-hdbscan") - (version "0.8.33") + (version "0.8.40") (source (origin (method url-fetch) (uri (pypi-uri "hdbscan" version)) (sha256 - (base32 "03gr70ys1zrnp15pxzhichvrdj5bj88p6p5k0wj8vx251rgvryjp")))) + (base32 "05wask431fm78n1227dhvwsmlnys9d95vxjz0y8hbvmy2zzq7qy9")))) (build-system pyproject-build-system) (arguments (list + #:test-flags + ;; XXX: Test files which fail during test collection. + #~(list "--ignore=hdbscan/tests/test_branches.py" + "--ignore=hdbscan/tests/test_hdbscan.py" + "--ignore=hdbscan/tests/test_rsl.py") #:phases #~(modify-phases %standard-phases + (add-before 'check 'pre-check + (lambda _ + (delete-file "hdbscan/tests/__init__.py"))) (add-before 'check 'build-extensions (lambda _ (invoke "python" "setup.py" "build_ext" "--inplace")))))) - (propagated-inputs (list python-joblib - python-numpy - python-scikit-learn - python-scipy)) - (native-inputs (list python-cython - python-nose - python-pytest - python-pandas - python-networkx - python-setuptools - python-wheel)) + (native-inputs + (list python-cython + python-numpy + python-pytest + python-setuptools)) + (propagated-inputs + (list python-joblib + python-numpy + python-scikit-learn + python-scipy)) (home-page "https://github.com/scikit-learn-contrib/hdbscan") (synopsis "High performance implementation of HDBSCAN clustering") (description "HDBSCAN - Hierarchical Density-Based Spatial Clustering of @@ -2395,18 +2395,24 @@ Neighbor Embedding (t-SNE), a popular dimensionality-reduction algorithm for visualizing high-dimensional data sets.") (license license:bsd-3))) +;; XXX: Potentially it is an abandonware, no releases or any updates since +;; 2021, consider to remove when become incompatible with propagated inputs. (define-public python-scikit-rebate (package (name "python-scikit-rebate") (version "0.62") - (source (origin - (method url-fetch) - (uri (pypi-uri "skrebate" version)) - (sha256 - (base32 - "0n55ghvnv7rxqa5agq6a4892ad0ghha165b0g4ghwr9gqm6ss3dj")))) - (build-system python-build-system) - (arguments '(#:tests? #f)) ;no tests on PyPI and no tags in repo + (source + (origin + (method url-fetch) + (uri (pypi-uri "skrebate" version)) + (sha256 + (base32 "0n55ghvnv7rxqa5agq6a4892ad0ghha165b0g4ghwr9gqm6ss3dj")))) + (build-system pyproject-build-system) + ;; There are no tests on PyPI, tests in git repo require an old release of + ;; python-scikit-learn + (arguments '(#:tests? #f)) + (native-inputs + (list python-setuptools)) (propagated-inputs (list python-numpy python-scipy python-scikit-learn python-joblib)) (home-page "https://epistasislab.github.io/scikit-rebate/") @@ -2519,7 +2525,7 @@ data by providing clean labels during training.") (lambda* (#:key tests? #:allow-other-keys) (when tests? (invoke "python" "-m" "cma.test"))))))) - (native-inputs (list python-pytest python-setuptools-next)) + (native-inputs (list python-pytest python-setuptools)) (propagated-inputs (list python-numpy)) (home-page "https://github.com/CMA-ES/pycma") (synopsis "Python implementation of CMA-ES") @@ -2553,7 +2559,7 @@ Covariance Matrix Adaptation Evolution Strategy (CMA-ES) for Python.") (define-public python-autograd (package (name "python-autograd") - (version "1.7.0") + (version "1.8.0") (source (origin (method git-fetch) @@ -2561,12 +2567,14 @@ Covariance Matrix Adaptation Evolution Strategy (CMA-ES) for Python.") (url "https://github.com/HIPS/autograd") (commit (string-append "v" version)))) (sha256 - (base32 "1fpnmm3mzw355iq7w751j4mjfcr0yh324cxidba1l22652gg8r8m")) + (base32 "054pkhzz0h9p1jzva8774wb9dj7rvax4rcpr8ava971kbimdr2lk")) (file-name (git-file-name name version)))) (build-system pyproject-build-system) (native-inputs (list python-hatchling - python-pytest)) + python-pytest + python-pytest-cov + python-pytest-xdist)) (propagated-inputs (list python-future python-numpy)) @@ -3210,572 +3218,10 @@ based on the Kaldi toolkit and the GStreamer framework and implemented in Python.") (license license:bsd-2)))) -;; Note that Tensorflow includes a "third_party" directory, which seems to not -;; only contain modified subsets of upstream library source code, but also -;; adapter headers provided by Google (such as the fft.h header, which is not -;; part of the upstream project code). The Tensorflow code includes headers -;; from the "third_party" directory. It does not look like we can replace -;; these headers with unmodified upstream files, so we keep them. -(define-public tensorflow - (package - (name "tensorflow") - (version "1.9.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/tensorflow/tensorflow") - (commit (string-append "v" version)))) - (file-name (string-append "tensorflow-" version "-checkout")) - (sha256 - (base32 - "0a9kwha395g3wgxfwln5j8vn9nkspmd75xldrlqdq540w996g8xa")) - (patches - (search-patches "tensorflow-c-api-fix.patch")))) - (build-system cmake-build-system) - (arguments - `(#:tests? #f ; no "check" target - #:build-type "Release" - #:configure-flags - (let ((protobuf (assoc-ref %build-inputs "protobuf")) - (protobuf:native (assoc-ref %build-inputs "protobuf:native")) - (jsoncpp (assoc-ref %build-inputs "jsoncpp")) - (snappy (assoc-ref %build-inputs "snappy")) - (sqlite (assoc-ref %build-inputs "sqlite"))) - (list - ;; Use protobuf from Guix - (string-append "-Dprotobuf_STATIC_LIBRARIES=" - protobuf "/lib/libprotobuf.so") - (string-append "-DPROTOBUF_PROTOC_EXECUTABLE=" - protobuf:native "/bin/protoc") - - ;; Use snappy from Guix - (string-append "-Dsnappy_STATIC_LIBRARIES=" - snappy "/lib/libsnappy.so") - ;; Yes, this is not actually the include directory but a prefix... - (string-append "-Dsnappy_INCLUDE_DIR=" snappy) - - ;; Use jsoncpp from Guix - (string-append "-Djsoncpp_STATIC_LIBRARIES=" - jsoncpp "/lib/libjsoncpp.so") - ;; Yes, this is not actually the include directory but a prefix... - (string-append "-Djsoncpp_INCLUDE_DIR=" jsoncpp) - - ;; Use sqlite from Guix - (string-append "-Dsqlite_STATIC_LIBRARIES=" - sqlite "/lib/libsqlite.a") - - ;; Use system libraries wherever possible. Currently, this - ;; only affects zlib. - "-Dsystemlib_ALL=ON" - "-Dtensorflow_ENABLE_POSITION_INDEPENDENT_CODE=ON" - "-Dtensorflow_BUILD_SHARED_LIB=ON" - "-Dtensorflow_OPTIMIZE_FOR_NATIVE_ARCH=OFF" - "-Dtensorflow_ENABLE_SSL_SUPPORT=OFF" - "-Dtensorflow_BUILD_CONTRIB_KERNELS=OFF")) - #:make-flags - (list "CC=gcc") - #:modules ((ice-9 ftw) - (guix build utils) - (guix build cmake-build-system) - ((guix build python-build-system) - #:select (python-version))) - #:imported-modules (,@%cmake-build-system-modules - (guix build python-build-system)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-source-file-times-to-1980 - ;; At the end of the tf_python_build_pip_package target, a ZIP - ;; archive should be generated via bdist_wheel, but it fails with - ;; "ZIP does not support timestamps before 1980". Luckily, - ;; SOURCE_DATE_EPOCH is respected, which we set to some time in - ;; 1980. - (lambda _ (setenv "SOURCE_DATE_EPOCH" "315532800"))) - (add-after 'unpack 'python3.11-compatibility - (lambda _ - ;; Py_TYPE was changed to an inline static function in Python - ;; 3.11, so it cannot be used on the left-hand side. - (substitute* "tensorflow/python/lib/core/bfloat16.cc" - (("Py_TYPE\\(&NPyBfloat16_Descr\\) = &PyArrayDescr_Type;") - "Py_SET_TYPE(&NPyBfloat16_Descr, &PyArrayDescr_Type);")) - - ;; See https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-406373913 - (substitute* '("tensorflow/python/eager/pywrap_tfe_src.cc" - "tensorflow/python/lib/core/ndarray_tensor.cc" - "tensorflow/python/lib/core/py_func.cc") - (("PyUnicode_AsUTF8") "(char *)PyUnicode_AsUTF8")) - (substitute* "tensorflow/c/eager/c_api.h" - (("unsigned char async") - "unsigned char is_async")) - - ;; Remove dependency on tensorboard, a complicated but probably - ;; optional package. - (substitute* "tensorflow/tools/pip_package/setup.py" - ((".*'tensorboard >.*") "")) - - ;; Fix the build with python-3.8, taken from rejected upstream patch: - ;; https://github.com/tensorflow/tensorflow/issues/34197 - (substitute* (find-files "tensorflow/python" ".*\\.cc$") - (("(nullptr,)(\\ +/. tp_print)" _ _ tp_print) - (string-append "NULL, " tp_print))) - - ;; Many collections classes have been moved to collections.abc - (substitute* '("tensorflow/python/framework/ops.py" - "tensorflow/python/ops/clip_ops.py" - "tensorflow/python/ops/data_flow_ops.py" - "tensorflow/python/ops/gradients_impl.py" - "tensorflow/python/training/input.py" - "tensorflow/python/training/checkpointable/data_structures.py" - "tensorflow/python/util/nest.py" - "tensorflow/python/util/protobuf/compare.py") - (("collections.Mapping") "collections.abc.Mapping") - (("collections.Sequence") "collections.abc.Sequence")) - (substitute* "tensorflow/python/feature_column/feature_column.py" - (("collections.Iterator") "collections.abc.Iterator")) - (substitute* "tensorflow/python/ops/sparse_ops.py" - (("collections.Iterable") "collections.abc.Iterable")) - (substitute* "tensorflow/python/keras/callbacks.py" - (("from collections import Iterable") - "from collections.abc import Iterable")) - (substitute* "tensorflow/python/ops/variable_scope.py" - (("collections_lib.Sequence") "collections_lib.abc.Sequence")) - - ;; XXX: it is not clear if this is a good idea, but the build - ;; system tries to overwrite the __or__ and __ror__ methods of - ;; the Tensor class. - (substitute* "tensorflow/python/framework/ops.py" - (("if not isinstance\\(existing, type\\(object.__lt__\\)\\)" m) - (string-append m - " and not isinstance(existing, type(object.__or__))"))) - - ;; ArgSpec has been replaced with FullArgSpec. - (substitute* "tensorflow/python/util/tf_inspect.py" - (("ArgSpec = _inspect.ArgSpec") "\ -ArgSpec = namedtuple('ArgSpec', [ 'args', 'varargs', 'keywords', 'defaults' ]) -def makeargspec(s): - return ArgSpec(args=s.args, varargs=s.varargs, keywords=s.varkw, defaults=s.defaults) -") - (("_inspect.getargspec\\((.*)\\)" m target) - (string-append "makeargspec(_inspect.getfullargspec(" target "))"))) - - ;; Fix the build with numpy >= 1.19. - ;; Suggested in https://github.com/tensorflow/tensorflow/issues/41086#issuecomment-656833081 - (substitute* "tensorflow/python/lib/core/bfloat16.cc" - (("void BinaryUFunc\\(char\\*\\* args, npy_intp\\* dimensions, npy_intp\\* steps,") - "void BinaryUFunc(char** args, npy_intp const* dimensions, npy_intp const* steps,") - (("void CompareUFunc\\(char\\*\\* args, npy_intp\\* dimensions, npy_intp\\* steps,") - "void CompareUFunc(char** args, npy_intp const* dimensions, npy_intp const* steps,")) - - ;; ...and for numpy >= 1.23 - (substitute* "tensorflow/python/framework/tensor_util.py" - (("np.asscalar\\(x\\[0\\]\\)") "x[0].item()") - (("np.asscalar\\(x\\)") "x.item()") - (("np.asscalar\\(v\\)") "np.ndarray.item(v)") - (("return np.asscalar") "return np.ndarray.item")) - (substitute* "tensorflow/python/kernel_tests/cwise_ops_test.py" - (("np.asscalar\\(np.random.rand\\(1\\) \\* 100.\\)") - "(np.random.rand(1) * 100.).item()")) - (substitute* '("tensorflow/python/framework/fast_tensor_util.pyx" - "tensorflow/python/estimator/canned/linear_testing_utils.py") - (("np.asscalar") "np.ndarray.item")))) - (add-after 'python3.11-compatibility 'numpy-compatibility - (lambda _ - (substitute* (cons* "tensorflow/compiler/xla/python/xla_client.py" - "tensorflow/contrib/layers/python/ops/sparse_ops_test.py" - (find-files "tensorflow/python/" "\\.py$")) - (("np.object") "object")) - (substitute* (append - '("tensorflow/compiler/tests/unary_ops_test.py" - "tensorflow/compiler/xla/python/xla_client.py" - "tensorflow/compiler/xla/python/xla_client_test.py") - (find-files "tensorflow/python/" "\\.py$") - (find-files "tensorflow/contrib/" "\\.py$")) - (("np.bool,") "bool,") - (("np.bool\\)") "bool)") - (("np.bool:") "bool:")))) - (add-after 'numpy-compatibility 'chdir - (lambda _ (chdir "tensorflow/contrib/cmake"))) - (add-after 'chdir 'disable-downloads - (lambda* (#:key inputs #:allow-other-keys) - (substitute* (find-files "external" "\\.cmake$") - (("GIT_REPOSITORY.*") "") - (("GIT_TAG.*") "") - (("PREFIX ") - "DOWNLOAD_COMMAND \"\"\nPREFIX ")) - - ;; Use packages from Guix - (let ((grpc (assoc-ref inputs "grpc"))) - (substitute* "CMakeLists.txt" - ;; Sqlite - (("include\\(sqlite\\)") "") - (("\\$\\{sqlite_STATIC_LIBRARIES\\}") - (search-input-file inputs "/lib/libsqlite3.so")) - (("sqlite_copy_headers_to_destination") "") - - ;; PNG - (("include\\(png\\)") "") - (("\\$\\{png_STATIC_LIBRARIES\\}") - (search-input-file inputs "/lib/libpng16.so")) - (("png_copy_headers_to_destination") "") - - ;; JPEG - (("include\\(jpeg\\)") "") - (("\\$\\{jpeg_STATIC_LIBRARIES\\}") - (search-input-file inputs "/lib/libjpeg.so")) - (("jpeg_copy_headers_to_destination") "") - - ;; GIF - (("include\\(gif\\)") "") - (("\\$\\{gif_STATIC_LIBRARIES\\}") - (search-input-file inputs "/lib/libgif.so")) - (("gif_copy_headers_to_destination") "") - - ;; lmdb - (("include\\(lmdb\\)") "") - (("\\$\\{lmdb_STATIC_LIBRARIES\\}") - (search-input-file inputs "/lib/liblmdb.so")) - (("lmdb_copy_headers_to_destination") "") - - ;; Protobuf - (("include\\(protobuf\\)") "") - (("protobuf_copy_headers_to_destination") "") - (("^ +protobuf") "") - - ;; gRPC - (("include\\(grpc\\)") - "find_package(grpc REQUIRED NAMES gRPC)") - (("list\\(APPEND tensorflow_EXTERNAL_DEPENDENCIES grpc\\)") "") - - ;; Eigen - (("include\\(eigen\\)") - (string-append "find_package(eigen REQUIRED NAMES Eigen3) -set(eigen_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/external/eigen_archive " - (assoc-ref inputs "eigen") "/include/eigen3)")) - (("^ +eigen") "") - - ;; snappy - (("include\\(snappy\\)") - "add_definitions(-DTF_USE_SNAPPY)") - (("list\\(APPEND tensorflow_EXTERNAL_DEPENDENCIES snappy\\)") "") - - ;; jsoncpp - (("include\\(jsoncpp\\)") "") - (("^ +jsoncpp") "")) - - (substitute* "tf_core_framework.cmake" - ((" grpc") "") - (("\\$\\{GRPC_BUILD\\}/grpc_cpp_plugin") - (which "grpc_cpp_plugin")) - ;; Link with gRPC libraries - (("add_library\\(tf_protos_cc.*" m) - (string-append m - (format #f "\ntarget_link_libraries(tf_protos_cc PRIVATE \ -~a/lib/libgrpc++_unsecure.a \ -~a/lib/libgrpc_unsecure.a \ -~a/lib/libaddress_sorting.a \ -~a/lib/libgpr.a \ -~a//lib/libcares.so -)\n" - grpc grpc grpc grpc - (assoc-ref inputs "c-ares")))))) - (substitute* "tf_tools.cmake" - (("add_dependencies\\(\\$\\{proto_text.*") "")) - ;; Remove dependency on bundled grpc - (substitute* "tf_core_distributed_runtime.cmake" - (("tf_core_cpu grpc") "tf_core_cpu")) - - ;; This directory is a dependency of many targets. - (mkdir-p "protobuf"))) - (add-after 'configure 'unpack-third-party-sources - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; This is needed to configure bundled packages properly. - (setenv "CONFIG_SHELL" (which "bash")) - (for-each - (lambda (name) - (let* ((what (assoc-ref inputs (string-append name "-src"))) - (name* (string-map (lambda (c) - (if (char=? c #\-) - #\_ c)) name)) - (where (string-append "../build/" name* "/src/" name*))) - (cond - ((string-suffix? ".zip" what) - (mkdir-p where) - (with-directory-excursion where - (invoke "unzip" what))) - ((string-suffix? ".tar.gz" what) - (mkdir-p where) - (invoke "tar" "xf" what - "-C" where "--strip-components=1")) - (else - (let ((parent (dirname where))) - (mkdir-p parent) - (with-directory-excursion parent - (when (file-exists? name*) - (delete-file-recursively name*)) - (copy-recursively what name*) - (map make-file-writable - (find-files name* ".*")))))))) - (list "boringssl" - "cub" - "double-conversion" - "farmhash" - "fft2d" - "highwayhash" - "nsync" - "re2")) - - ;; https://github.com/google/farmhash/issues/24 - (substitute* "../build/farmhash/src/farmhash/src/farmhash.cc" - (("using namespace std;") "") - (("make_pair") "std::make_pair") - (("pair<") "std::pair<")) - - (rename-file "../build/cub/src/cub/cub-1.8.0/" - "../build/cub/src/cub/cub/") - - (setenv "LDFLAGS" - (string-append "-Wl,-rpath=" - (assoc-ref outputs "out") "/lib")))) - (add-after 'unpack 'fix-python-build - (lambda* (#:key inputs outputs #:allow-other-keys) - (mkdir-p "protobuf-src") - (invoke "tar" "xf" (assoc-ref inputs "protobuf:src") - "-C" "protobuf-src" "--strip-components=1") - (mkdir-p "eigen-src") - (copy-recursively (assoc-ref inputs "eigen:src") "eigen-src") - - ;; distutils.sysconfig is deprecated and prints a deprecation - ;; warning that breaks the generated CXX_INCLUDES line. - (substitute* "tensorflow/contrib/cmake/tf_python.cmake" - (("import distutils.sysconfig; print\\(distutils.sysconfig.get_python_inc\\(\\)\\)") - "import sysconfig; print(sysconfig.get_path('include'))")) - - (substitute* "tensorflow/contrib/cmake/tf_python.cmake" - ;; Take protobuf source files from our source package. - (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/protobuf/src/protobuf/src/google") - (string-append (getcwd) "/protobuf-src/src/google"))) - - (substitute* '("tensorflow/contrib/cmake/tf_shared_lib.cmake" - "tensorflow/contrib/cmake/tf_python.cmake") - ;; Take Eigen source files from our source package. - (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/eigen/src/eigen/") - (string-append (getcwd) "/eigen-src/")) - ;; Take Eigen headers from our own package. - (("\\$\\{CMAKE_CURRENT_BINARY_DIR\\}/external/eigen_archive") - (search-input-directory inputs "/include/eigen3"))) - - ;; Correct the RUNPATH of ops libraries generated for Python. - ;; TODO: this doesn't work :( - ;; /gnu/store/...-tensorflow-1.9.0/lib/python3.7/site-packages/tensorflow/contrib/seq2seq/python/ops/lib_beam_search_ops.so: - ;; warning: RUNPATH contains bogus entries: ("/tmp/guix-build-tensorflow-1.9.0.drv-0/source/tensorflow/contrib/build") - ;; /gnu/store/...-tensorflow-1.9.0/lib/python3.7/site-packages/tensorflow/contrib/seq2seq/python/ops/lib_beam_search_ops.so: - ;; error: depends on 'libpywrap_tensorflow_internal.so', which - ;; cannot be found in RUNPATH ... - (substitute* "tensorflow/contrib/cmake/tf_cc_ops.cmake" - (("set_target_properties.*") - (string-append "set_target_properties(${_AT_TARGET} PROPERTIES \ -COMPILE_FLAGS ${target_compile_flags} \ -INSTALL_RPATH_USE_LINK_PATH TRUE \ -INSTALL_RPATH " (assoc-ref outputs "out") "/lib)\n"))))) - (add-after 'unpack 'patch-cmake-file-to-install-c-headers - (lambda _ - (substitute* "tensorflow/contrib/cmake/tf_c.cmake" - (("if\\(tensorflow_BUILD_PYTHON_BINDINGS" m) - (string-append - "install(DIRECTORY ${tensorflow_source_dir}/tensorflow/c/ \ -DESTINATION include/tensorflow/c FILES_MATCHING PATTERN \"*.h\")\n" m))))) - (add-after 'build 'build-c-bindings - (lambda* (#:key outputs parallel-build? #:allow-other-keys) - (invoke "make" "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1") - "tf_c"))) - (add-after 'install 'build-pip-package - (lambda* (#:key outputs parallel-build? #:allow-other-keys) - (invoke "make" "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1") - "tf_python_build_pip_package"))) - (add-after 'build-pip-package 'install-python - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (wheel (car (find-files "../build/tf_python/dist/" "\\.whl$"))) - (python-version (python-version - (assoc-ref inputs "python")))) - (invoke "python" "-m" "pip" "install" wheel - (string-append "--prefix=" out)) - - ;; XXX: broken RUNPATH, see fix-python-build phase. - (delete-file - (string-append - out "/lib/python" python-version - "/site-packages/tensorflow/contrib/" - "seq2seq/python/ops/lib_beam_search_ops.so")))))))) - (native-inputs - `(("pkg-config" ,pkg-config) - ("protobuf:native" ,protobuf-3.6) ; protoc - ("protobuf:src" ,(package-source protobuf-3.6)) - ("eigen:src" ,(package-source eigen-for-tensorflow)) - ;; install_pip_packages.sh wants setuptools 39.1.0 specifically. - ("python-setuptools" ,python-setuptools-for-tensorflow) - - ;; The commit hashes and URLs for third-party source code are taken - ;; from "tensorflow/workspace.bzl". - ("boringssl-src" - ,(let ((commit "ee7aa02") - (revision "1")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://boringssl.googlesource.com/boringssl") - (commit commit))) - (file-name (string-append "boringssl-0-" revision - (string-take commit 7) - "-checkout")) - (sha256 - (base32 - "1jf693q0nw0adsic6cgmbdx6g7wr4rj4vxa8j1hpn792fqhd8wgw"))))) - ("cub-src" - ,(let ((version "1.8.0")) - (origin - (method url-fetch) - (uri (string-append "https://mirror.bazel.build/github.com/NVlabs/" - "cub/archive/" version ".zip")) - (file-name (string-append "cub-" version ".zip")) - (sha256 - (base32 - "1hsqikqridb90dkxkjr2918dcry6pfh46ccnwrzawl56aamhdykb"))))) - ("double-conversion-src" - ,(let ((commit "5664746") - (revision "1")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/google/double-conversion") - (commit commit))) - (file-name - (git-file-name "double-conversion" - (string-append "0-" revision "." - (string-take commit 7)))) - (sha256 - (base32 - "1h5lppqqxcvdg5jq42i5msgwx20ryij3apvmndflngrgdpc04gn1"))))) - ("farmhash-src" - ,(let ((commit "816a4ae622e964763ca0862d9dbd19324a1eaf45")) - (origin - (method url-fetch) - (uri (string-append - "https://mirror.bazel.build/github.com/google/farmhash/archive/" - commit ".tar.gz")) - (file-name (string-append "farmhash-0-" (string-take commit 7) - ".tar.gz")) - (sha256 - (base32 - "185b2xdxl4d4cnsnv6abg8s22gxvx8673jq2yaq85bz4cdy58q35"))))) - ;; The license notice on the home page at - ;; http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html says: - ;; Copyright Takuya OOURA, 1996-2001 - ;; - ;; You may use, copy, modify and distribute this code for any purpose - ;; (include commercial use) and without fee. Please refer to this - ;; package when you modify this code. - ;; - ;; We take the identical tarball from the Bazel mirror, because the URL - ;; at the home page is not versioned and might change. - ("fft2d-src" - ,(origin - (method url-fetch) - (uri "https://mirror.bazel.build/www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz") - (file-name "fft2d.tar.gz") - (sha256 - (base32 - "15jjkfvhqvl2c0753d2di8hz0pyzn598g74wqy79awdrf1y67fsj")))) - ("highwayhash-src" - ,(let ((commit "be5edafc2e1a455768e260ccd68ae7317b6690ee") - (revision "1")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/google/highwayhash") - (commit commit))) - (file-name (string-append "highwayhash-0-" revision - (string-take commit 7) - "-checkout")) - (sha256 - (base32 - "154jwf98cyy54hldr94pgjn85zynly3abpnc1avmb8a18lzwjyb6"))))) - ("nsync-src" - ,(let ((version "0559ce013feac8db639ee1bf776aca0325d28777") - (revision "1")) - (origin - (method url-fetch) - (uri (string-append "https://mirror.bazel.build/" - "github.com/google/nsync/archive/" - version ".tar.gz")) - (file-name (string-append "nsync-0." revision - "-" (string-take version 7) - ".tar.gz")) - (sha256 - (base32 - "0qdkyqym34x739mmzv97ah5r7ph462v5xkxqxvidmcfqbi64b132"))))) - ("re2-src" - ,(let ((commit "e7efc48") - (revision "1")) - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/google/re2") - (commit commit))) - (file-name (string-append "re2-0-" revision - (string-take commit 7) - "-checkout")) - (sha256 - (base32 - "161g9841rjfsy5pn52fcis0s9hdr7rxvb06pad38j5rppfihvign"))))) - ("googletest" ,googletest) - ("swig" ,swig) - ("unzip" ,unzip))) - (propagated-inputs - (list python-absl-py - python-astor - python-gast - python-grpcio - python-numpy - python-protobuf-3.6 - python-six - python-termcolor - python-wheel)) - (inputs - `(("c-ares" ,c-ares) - ("eigen" ,eigen-for-tensorflow) - ("gemmlowp" ,gemmlowp-for-tensorflow) - ("lmdb" ,lmdb) - ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("giflib" ,giflib) - ("grpc" ,grpc-1.16.1 "static") - ("grpc:bin" ,grpc-1.16.1) - ("jsoncpp" ,jsoncpp-for-tensorflow) - ("snappy" ,snappy) - ("sqlite" ,sqlite) - ("protobuf" ,protobuf-3.6) - ("python" ,python-wrapper) - ("zlib" ,zlib))) - (home-page "https://tensorflow.org") - (synopsis "Machine learning framework") - (description - "TensorFlow is a flexible platform for building and training machine -learning models. It provides a library for high performance numerical -computation and includes high level Python APIs, including both a sequential -API for beginners that allows users to build models quickly by plugging -together building blocks and a subclassing API with an imperative style for -advanced research.") - (license license:asl2.0))) - (define-public tensorflow-lite (package (name "tensorflow-lite") - (version "2.13.1") + (version "2.14.0") (source (origin (method git-fetch) @@ -3785,16 +3231,18 @@ advanced research.") (file-name (git-file-name name version)) (sha256 (base32 - "09mfskmpvpbq919wibnw3bnhi1y3hkx3qrzm72gdr0gsivn1yb3w")) - (patches (search-patches "tensorflow-lite-unbundle.patch")))) + "07f4x4g3kwhfjz7iadhqrv97zmw0blacixvca1gdqkqqi7aipxis")))) (build-system cmake-build-system) + (outputs (list "out" "python")) (arguments (list - #:tests? #false ;tests are not building now #:build-type "Release" + #:imported-modules (append %cmake-build-system-modules + %pyproject-build-system-modules) #:modules '((ice-9 match) (guix build utils) - (guix build cmake-build-system)) + (guix build cmake-build-system) + ((guix build pyproject-build-system) #:prefix py:)) #:configure-flags #~(list ;; "-DTFLITE_KERNEL_TEST=ON" ; TODO: build tests @@ -3806,7 +3254,9 @@ advanced research.") "-DTFLITE_ENABLE_GPU=ON" "-DTFLITE_ENABLE_RUY=ON" + "-DTFLITE_ENABLE_XNNPACK=ON" + "-DSYSTEM_PTHREADPOOL=ON" ;; TODO: turn on Farmhash ;;"-DSYSTEM_FARMHASH=ON" (string-append "-Dabsl_DIR=" #$(this-package-input "abseil-cpp") @@ -3822,13 +3272,11 @@ advanced research.") "/share/cpuinfo") (string-append "-Druy_DIR=" #$(this-package-input "ruy") "/lib/cmake/ruy") - - ;; TODO: The build system attempts to build xnnpack from source. We - ;; would like to use our xnnpack package here, but this requires more - ;; work. - "-DTFLITE_ENABLE_XNNPACK=OFF" + (string-append "-DML_DTYPES_LIBRARY_DIRS=" + #$(this-package-input "python-ml-dtypes") "/lib") ;; Don't fetch the sources. We have these already + "-Dml_dtypes_POPULATED=ON" "-Dgemmlowp_POPULATED=TRUE" "-Degl_headers_POPULATED=TRUE" "-Dfp16_headers_POPULATED=TRUE" @@ -3839,6 +3287,7 @@ advanced research.") "-Dgoogle_benchmark_POPULATED=TRUE" "-Dnsync_POPULATED=TRUE" "-Dre2_POPULATED=TRUE" + "-Dxnnpack_POPULATED=TRUE" "-DFFT2D_SOURCE_DIR=/tmp/fft2d" "-DFARMHASH_SOURCE_DIR=/tmp/farmhash" @@ -3847,22 +3296,28 @@ advanced research.") #~(modify-phases %standard-phases (add-after 'unpack 'chdir (lambda _ (chdir "tensorflow/lite"))) + (add-after 'chdir 'unbundle-gemmlowp + (lambda _ + (call-with-output-file "tools/cmake/modules/gemmlowp.cmake" + (lambda (port) + (display "\ +add_library(gemmlowp INTERFACE IMPORTED) +include_directories(\"${gemmlowp_ROOT}/include/gemmlowp\")" port))) + (call-with-output-file "tools/cmake/modules/ml_dtypes.cmake" + (lambda (port) + (display "\ +add_library(ml_dtypes INTERFACE IMPORTED) +find_library(ML_DTYPES_LIBRARIES + NAMES ml_dtypes.so + PATHS \"${ML_DTYPES_LIBRARY_DIRS}\" + NO_DEFAULT_PATH)" port))))) (add-after 'chdir 'copy-sources (lambda* (#:key inputs #:allow-other-keys) - ;; TODO: properly use Guix's pthreaqdpool. We are not using - ;; pthreadpool because we are not enabling xnnpack - (substitute* "CMakeLists.txt" - (("if\\(NOT DEFINED PTHREADPOOL_SOURCE_DIR\\)") - "if(false)")) - (substitute* "CMakeLists.txt" - (("if\\(NOT TARGET pthreadpool\\)") - "if(false)")) - ;; Don't fetch source code; we already have everything we need. (substitute* '("tools/cmake/modules/fft2d.cmake" "tools/cmake/modules/farmhash.cmake" "tools/cmake/modules/gemmlowp.cmake") - (("OverridableFetchContent_Populate.*") "")) + (("^ *OverridableFetchContent_Populate.*") "")) (mkdir-p "/tmp/farmhash") (with-directory-excursion "/tmp/farmhash" @@ -3873,6 +3328,26 @@ advanced research.") (with-directory-excursion "/tmp/fft2d" (invoke "tar" "--strip-components=1" "-xf" (assoc-ref inputs "fft2d-src"))))) + (add-after 'copy-sources 'opencl-fix + (lambda _ (substitute* "delegates/gpu/cl/opencl_wrapper.h" + (("cl_ndrange_kernel_command_properties_khr") + "cl_command_properties_khr")))) + (add-after 'opencl-fix 'absl-fix + (lambda _ (substitute* '( + "delegates/gpu/cl/cl_operation.h" + "delegates/gpu/common/task/qcom_thin_filter_desc.cc" + "delegates/gpu/common/tasks/special/thin_pointwise_fuser.cc") + (("#include <vector>") + "#include <vector>\n\n#include \"absl/strings/str_cat.h\"\n")))) + (add-after 'opencl-fix 'stdint-fix + (lambda _ (substitute* "kernels/internal/spectrogram.cc" + (("#include <math.h>") + "#include <math.h>\n#include <cstdint>\n")))) + (add-after 'stdint-fix 'gemmlowp-fix + (lambda _ + (substitute* "kernels/internal/common.h" + (("#include \"fixedpoint/fixedpoint\\.h\"") + "#include <fixedpoint/fixedpoint.h>")))) (add-after 'build 'build-shared-library (lambda* (#:key configure-flags #:allow-other-keys) (mkdir-p "c") @@ -3884,40 +3359,75 @@ advanced research.") (lambda _ (invoke "cmake" "--build" "." "--target" "benchmark_model" "-j" (number->string (parallel-job-count))))) - + (add-after 'build-benchmark-model 'build-python + (lambda* (#:key configure-flags #:allow-other-keys) + (let ((script (string-append "../lite/tools/pip_package/" + "build_pip_package_with_cmake.sh"))) + (substitute* script + (("\"\\$\\{TENSORFLOW_LITE_DIR\\}\"" all) + (string-append "${CMAKE_ADDITIONAL_CONFIGURE_FLAGS} " + all))) + (setenv "BUILD_NUM_JOBS" (number->string (parallel-job-count))) + (setenv "CMAKE_ADDITIONAL_CONFIGURE_FLAGS" + (string-join configure-flags " ")) + (invoke "sh" script)))) (add-after 'install 'install-extra - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib")) - (bin (string-append out "/bin"))) - (install-file "../build/c/libtensorflowlite_c.so" lib) - (install-file "../build/tools/benchmark/benchmark_model" bin)))) + (lambda _ + (install-file "../build/c/libtensorflowlite_c.so" + (string-append #$output "/lib")) + (install-file "../build/tools/benchmark/benchmark_model" + (string-append #$output "/bin")))) + (add-after 'install-extra 'install-python + (lambda* (#:key inputs outputs #:allow-other-keys) + (with-directory-excursion + "../lite/tools/pip_package/gen/tflite_pip/python3" + ((assoc-ref py:%standard-phases 'install) + #:inputs inputs + #:outputs `(("out" . ,#$output:python)))))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? - (invoke "ctest" "-L" "plain"))))))) + (invoke "ctest" "-L" "plain")))) + (add-after 'install-python 'add-install-to-pythonpath + (lambda* (#:key inputs #:allow-other-keys) + ((assoc-ref py:%standard-phases 'add-install-to-pythonpath) + #:inputs inputs + #:outputs `(("out" . ,#$output:python))))) + (add-after 'add-install-to-pythonpath 'python-sanity-check + (lambda* (#:key tests? inputs #:allow-other-keys) + ((assoc-ref py:%standard-phases 'sanity-check) + #:inputs `(("sanity-check.py" . ,#$(default-sanity-check.py)) + ,@inputs) + #:outputs `(("out" . ,#$output:python)))))))) (inputs - `(("abseil-cpp" ,abseil-cpp-20200923.3) - ("cpuinfo" ,cpuinfo) - ("eigen" ,eigen) - ("fp16" ,fp16) - ("flatbuffers" ,flatbuffers-23.1) - ("gemmlowp" ,gemmlowp) - ("mesa-headers" ,mesa-headers) - ("neon2sse" ,neon2sse) - ("nsync" ,nsync) - ("opencl-clhpp" ,opencl-clhpp) - ("opencl-headers" ,opencl-headers) - ("opencl-icd-loader" ,opencl-icd-loader) - ("pthreadpool" ,pthreadpool) - ("python" ,python) - ("ruy" ,ruy) - ("re2" ,re2) - ;;("xnnpack" ,xnnpack) ; TODO: use Guix's copy of xnnpack - ("vulkan-headers" ,vulkan-headers))) + (list abseil-cpp + cpuinfo + eigen + fp16 + flatbuffers-23.5 + gemmlowp + mesa-headers + neon2sse + nsync + opencl-clhpp + opencl-headers + opencl-icd-loader + pthreadpool + python-wrapper + python-ml-dtypes + ruy + re2 + xnnpack + vulkan-headers + zlib)) + (propagated-inputs + (list python-numpy)) (native-inputs `(("pkg-config" ,pkg-config) ("googletest" ,googletest) + ("pybind11" ,pybind11) + ("python-wheel" ,python-wheel) + ("swig" ,swig) ("farmhash-src" ,(let ((commit "816a4ae622e964763ca0862d9dbd19324a1eaf45")) (origin @@ -3947,6 +3457,22 @@ learning models. This package provides the \"lite\" variant for mobile devices.") (license license:asl2.0))) +(define-public python-tflite-runtime + (package + (inherit tensorflow-lite) + (name "python-tflite-runtime") + (source #f) + (build-system trivial-build-system) + (outputs (list "out")) + (arguments + (list + #:builder + #~(begin + (mkdir #$output) + (symlink (string-append #$tensorflow-lite:python "/lib") + (string-append #$output "/lib"))))) + (native-inputs '()))) + (define-public dmlc-core (package (name "dmlc-core") @@ -3962,11 +3488,10 @@ devices.") (base32 "1x4ad1jhn84fywlk031fmv1kxyiscclmrqn9hhj8gz0mh7z9vcrh")))) (build-system cmake-build-system) (arguments - `(#:configure-flags - (list "-DGOOGLE_TEST=ON"))) + (list + #:configure-flags #~(list "-DGOOGLE_TEST=ON"))) (native-inputs - `(("googletest" ,googletest) - ("python" ,python-wrapper))) + (list googletest python-wrapper)) (home-page "https://github.com/dmlc/dmlc-core") (synopsis "Common bricks library for machine learning") (description @@ -4090,11 +3615,11 @@ in a fast and accurate way.") (sha256 (base32 "1k8szlpm19rcwcxdny9qdm3gmaqq8akb4xlvrzyz8c2d679aak6l")))) - (build-system python-build-system) + (build-system pyproject-build-system) (propagated-inputs (list python-ipython python-numpy python-pandas python-scipy)) (native-inputs - (list python-nose)) + (list python-nose python-setuptools)) (home-page "https://github.com/interpretable-ml/iml") (synopsis "Interpretable Machine Learning (iML) package") (description "Interpretable ML (iML) is a set of data type objects, @@ -4106,8 +3631,8 @@ project, and it will potentially also do the same for the Lime project.") (define-public gloo (let ((version "0.0.0") ; no proper version tag - (commit "81925d1c674c34f0dc34dd9a0f2151c1b6f701eb") - (revision "2")) + (commit "c7b7b022c124d9643957d9bd55f57ac59fce8fa2") + (revision "3")) (package (name "gloo") (version (git-version version revision commit)) @@ -4120,7 +3645,7 @@ project, and it will potentially also do the same for the Lime project.") (file-name (git-file-name name version)) (sha256 (base32 - "16zs8ndbiv9nppn8bv6lfanzyyssz7g5pawxiqcnafwq3nvxpj9m")))) + "0xsp2m2if3g85l0c3cx9l0j3kz36j3kbmz9mai6kchdhrs13r7d5")))) (build-system cmake-build-system) (native-inputs (list googletest)) @@ -4195,7 +3720,7 @@ methodxs at scale on CPU or GPU.") (define-public python-umap-learn (package (name "python-umap-learn") - (version "0.5.8") + (version "0.5.9") (source (origin (method git-fetch) ;no tests in pypi release @@ -4204,7 +3729,7 @@ methodxs at scale on CPU or GPU.") (commit (string-append "release-" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0pdlb6qn9vnvabksiabxmcj30j8ff7526mz1qszrbdl5kh2sl7sm")))) + (base32 "0pkniia9lccdbshwl4sh2iria7dny13qk0flkk67msb777sm5bmn")))) (build-system pyproject-build-system) (arguments (list @@ -4354,7 +3879,8 @@ on quantized 8-bit tensors.") (srfi srfi-26))) (snippet '(begin - (delete-file-recursively "bench/models") + (when (directory-exists? "bench/models") + (delete-file-recursively "bench/models")) ;; Remove autogenerated files, which contain the string ;; "Auto-generated file" (for-each @@ -4368,30 +3894,26 @@ on quantized 8-bit tensors.") (get-string-all port) "Auto-generated file"))) (delete-file path)))) - (scandir dir (negate (cut member <> '("." ".." "simd")))))) + (or (scandir dir (negate (cut member <> '("." ".." "simd")))) + '()))) (cons* - "test" "bench" "src/enums" "src/xnnpack" - "gen" "cmake/gen" - (filter - identity - (map - (lambda (dir) - (let ((path - (string-append "src/" dir "/gen"))) - (and (file-exists? path) path))) - (scandir "src" (negate (cut member <> '("." "..")))))))))))) + "test" "bench" "src/enums" "src/xnnpack" "gen" "cmake/gen" + (filter file-exists? + (map (cut string-append "src/" <> "/gen") + (scandir "src"))))))))) (build-system cmake-build-system) (arguments (list #:build-type "Release" ;; Debugging symbols require a lot of disk space - #:configure-flags ''("-DXNNPACK_USE_SYSTEM_LIBS=YES" - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" - "-DXNNPACK_LIBRARY_TYPE=shared" - "-DXNNPACK_BUILD_BENCHMARKS=FALSE" - ;; Tests fail to build with -DXNNPACK_LIBRARY_TYPE=shared: - ;; https://github.com/google/XNNPACK/issues/6285 - "-DXNNPACK_BUILD_TESTS=OFF") + #:configure-flags + #~(list "-DXNNPACK_USE_SYSTEM_LIBS=YES" + "-DBUILD_SHARED_LIBS=ON" + "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" + "-DXNNPACK_LIBRARY_TYPE=shared" + "-DXNNPACK_BUILD_BENCHMARKS=FALSE" + ;; Tests fail to build with -DXNNPACK_LIBRARY_TYPE=shared: + ;; https://github.com/google/XNNPACK/issues/6285 + "-DXNNPACK_BUILD_TESTS=OFF") #:tests? #f #:modules '((ice-9 ftw) (guix build cmake-build-system) @@ -4417,14 +3939,18 @@ on quantized 8-bit tensors.") (string-suffix? ".sh" name)) (let ((file (string-append "scripts/" name))) (substitute* file - ;; Turn the commands into targets and remove trailing - ;; '&' characters - (("(.*(\\.sh|\\.py|-o |--output)[^&]*)&?[[:space:]]*$" _ command) + ;; Turn the commands into targets. Avoid comments and + ;; lines starting with - (rest of multilines). + (("\ +^[[:space:]]*([^ #-].*/.*(\\.sh|\\.py|-o |--output)[^&]*).*$" + _ command) (begin (set! counter (+ counter 1)) - (string-append "target" (number->string counter) + (string-append "\ntarget" (number->string counter) ":" target-deps - "\n\t" command "\n"))) + "\n\t" command))) + ;; Remove trailing '&' characters. + (("&?[[:space:]]*$") "\n") (("[[:space:]]*wait[[:space:]]*") "") ;; The commands after this line depend on the ;; previous commands in the file. @@ -4450,12 +3976,15 @@ on quantized 8-bit tensors.") (invoke "python3" "tools/generate-lut-norm-test.py" "--spec" "test/u8-lut32norm.yaml" "--output" "test/u8-lut32norm.cc") - (invoke "python3" "tools/generate-gemm-test.py" - "--spec" "test/qd8-f16-qb4w-gemm-minmax.yaml" - "--output-test" "test/qd8-f16-qb4w-gemm-minmax.cc") - (invoke "python3" "tools/generate-gemm-test.py" - "--spec" "test/qd8-f32-qb4w-gemm-minmax.yaml" - "--output-test" "test/qd8-f32-qb4w-gemm-minmax.cc")))))) + ;; Check existence to avoid doubling the phase for r-torch. + (when (file-exists? "test/qd8-f16-qb4w-gemm-minmax.yaml") + (invoke "python3" "tools/generate-gemm-test.py" + "--spec" "test/qd8-f16-qb4w-gemm-minmax.yaml" + "--output-test" "test/qd8-f16-qb4w-gemm-minmax.cc")) + (when (file-exists? "test/qd8-f32-qb4w-gemm-minmax.yaml") + (invoke "python3" "tools/generate-gemm-test.py" + "--spec" "test/qd8-f32-qb4w-gemm-minmax.yaml" + "--output-test" "test/qd8-f32-qb4w-gemm-minmax.cc"))))))) (inputs (list clog cpuinfo @@ -4556,7 +4085,7 @@ TensorFlow.js, PyTorch, and MediaPipe.") (define-public fbgemm (package (name "fbgemm") - (version "1.0.0") + (version "1.2.0") (source (origin (method git-fetch) (uri (git-reference @@ -4565,7 +4094,7 @@ TensorFlow.js, PyTorch, and MediaPipe.") (file-name (git-file-name name version)) (sha256 (base32 - "1a5g5f32377fad99xsfggqkwvl7vh5gc1wj77swa06x06lc1qwyw")) + "0fjs7179iq5hy6nl4nyswnmk90fz87zsg14p7i5bk2vbd2vrq8a3")) (patches (search-patches "fbgemm-use-system-libraries.patch")))) (build-system cmake-build-system) (arguments @@ -4775,7 +4304,7 @@ PyTorch.") (base32 "0hdpkhcjry22fjx2zg2r48v7f4ljrclzj0li2pgk76kvyblfbyvm")))))) -(define %python-pytorch-version "2.7.0") +(define %python-pytorch-version "2.8.0") (define %python-pytorch-src (origin @@ -4786,7 +4315,7 @@ PyTorch.") (file-name (git-file-name "python-pytorch" %python-pytorch-version)) (sha256 (base32 - "19prdpzx34n8y2q6wx9dn9vyms6zidjvfgh58d28rfcf5z7z5ra5")) + "0am8mx0mq3hqsk1g99a04a4fdf865g93568qr1f247pl11r2jldl")) (patches (search-patches "python-pytorch-system-libraries.patch" "python-pytorch-runpath.patch" "python-pytorch-without-kineto.patch" @@ -4830,8 +4359,9 @@ PyTorch.") (for-each delete-file (find-files dir "\\.cu$"))) - '("aten/src/ATen/native/transformers/cuda/flash_attn/kernels" - "aten/src/ATen/native/transformers/cuda/mem_eff_attention/kernels")))))) + '("aten/src/ATen/native/transformers/cuda/flash_attn" + "aten/src/ATen/native/transformers/cuda/mem_eff_attention" + "aten/src/ATen/native/transformers/hip/flash_attn")))))) (define-public qnnpack-pytorch (package @@ -4913,7 +4443,7 @@ PyTorch.") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'cmake-patches - (lambda _ + (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "cmake/Dependencies.cmake" (("#POCKETFFT_INCLUDE_DIR") (string-append @@ -4921,6 +4451,8 @@ PyTorch.") (("#FP16_INCLUDE_DIR") (string-append #$(this-package-input "fp16") "/include")) + (("#CONCURRENTQUEUE_INCLUDE_DIR") + (search-input-directory inputs "include/concurrentqueue")) ;; Disable opentelemetry ((".*(add_library|target_include_directories).*opentelemetry.*") "")) @@ -4929,9 +4461,11 @@ PyTorch.") ;; Fix Python install directory (substitute* "caffe2/CMakeLists.txt" (("\\$\\{Python_SITELIB\\}") - (string-append #$output "/lib/python" - #$(version-major+minor (package-version python)) - "/site-packages"))))) + (site-packages inputs outputs))) + ;; Ensure httplib::httplib is defined when used. + (substitute* "cmake/Caffe2Config.cmake.in" + (("include *\\(.*Caffe2Targets\\.cmake.*\\)" all) + (string-append "find_package(httplib REQUIRED)\n" all))))) ;; This entry point is broken, because it refers to a module that is ;; (intentionally) not installed ;; (https://github.com/pytorch/pytorch/pull/134729), which causes @@ -4954,6 +4488,12 @@ PyTorch.") "caffe2/serialize/inline_container.cc" "torch/csrc/inductor/aoti_package/model_package_loader.cpp")) + ;; Fix moodycamel/concurrentqueue includes for system package + (substitute* '("c10/util/Semaphore.h" + "c10/test/util/Semaphore_test.cpp") + (("<moodycamel/concurrentqueue\\.h>") "<concurrentqueue.h>") + (("<moodycamel/lightweightsemaphore\\.h>") "<lightweightsemaphore.h>")) + (substitute* "aten/src/ATen/native/vulkan/api/Allocator.h" (("<include/vk_mem_alloc.h>") "<vk_mem_alloc.h>")) @@ -4992,14 +4532,14 @@ PyTorch.") (package-transitive-supported-systems qnnpack))) (setenv "USE_QNNPACK" "0")) (substitute* '("requirements.txt" "setup.py") - (("sympy==1\\.13\\.1") + (("sympy>=1\\.13\\.3") "sympy>=1.13.1")))) (add-after 'use-system-libraries 'skip-nccl-call (lambda _ ;; Comment-out `checkout_nccl()` invokation in build_pytorch(). (substitute* "tools/build_pytorch_libs.py" (("^[[:blank:]]*checkout_nccl\\(\\)" all) - (string-append "# " all " # Guix: use system NCCL\n"))))) + (string-append "# " all "\n pass"))))) ;; PyTorch is still built with AVX2 and AVX-512 support selected at ;; runtime, but these dependencies require it (nnpack only for ;; x86_64). @@ -5079,9 +4619,8 @@ PyTorch.") (find-files python-site "(^test_cpp_rpc|_test)$"))))) (add-after 'install2 'remove-caffe2-onnx-scripts - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin"))) + (lambda _ + (let ((bin (string-append #$output "/bin"))) ;; Remove 'convert-caffe2-to-onnx' and ;; 'convert-onnx-to-caffe2': they seem to be ;; deprecated and they cause a failure of the @@ -5093,7 +4632,7 @@ PyTorch.") (for-each delete-file (find-files bin "^convert-.*caffe2")) - (substitute* (find-files out "^entry_points\\.txt$") + (substitute* (find-files #$output "^entry_points\\.txt$") (("^convert-.*" all) (string-append "# " all "\n"))))))) @@ -5108,7 +4647,7 @@ PyTorch.") pocketfft-cpp python-expecttest python-pytest-flakefinder - python-pytest-rerunfailures-13 + python-pytest-rerunfailures python-pytest-shard python-pytest-xdist python-hypothesis @@ -5120,6 +4659,7 @@ PyTorch.") (list asmjit brotli ; for cpp-httplib clog + concurrentqueue cpp-httplib eigen flatbuffers @@ -5141,6 +4681,7 @@ PyTorch.") pybind11 ;; qnnpack qnnpack-pytorch + rdma-core sleef tensorpipe vulkan-headers @@ -5194,6 +4735,83 @@ PyTorch when needed. Note: currently this package does not provide GPU support.") (license license:bsd-3))) +(define-public python-torchaudio + (package + (name "python-torchaudio") + (version %python-pytorch-version) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pytorch/audio") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0snrn6bhc7hcfzs5y4h61dl4dmwxymkf46dygjq6c09nc1jvmxj8")))) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list + ;; XXX: Those packages require additional inputs. + "--ignore=\ +test/torchaudio_unittest/prototype/hifi_gan/hifi_gan_cpu_test.py" + "--ignore=\ +test/torchaudio_unittest/prototype/hifi_gan/hifi_gan_gpu_test.py" + "--ignore=test/torchaudio_unittest/kaldi_io_test.py" + "--ignore=test/torchaudio_unittest/test_load_save_torchcodec.py" + "--ignore-glob=test/torchaudio_unittest/backend/dispatcher/ffmpeg" + ;; XXX: We don't really want to run those tests. + "--ignore-glob=test/torchaudio_unittest/example" + ;; XXX: Integration tests require additional data / models. + "--ignore-glob=test/integration_tests" + ;; XXX: Those tests are very costly. + "--ignore-glob=test/torchaudio_unittest/functional" + "--ignore-glob=test/torchaudio_unittest/models" + "--ignore=test/torchaudio_unittest/models/models_test.py" + "--ignore=test/torchaudio_unittest/transforms/autograd_cpu_test.py" + "-k" (string-append "not test_torchscript_fails" ; requires BUILD_SOX=1 + ;; XXX: Unmatching harmless warning message. + " and not test_unknown_subtype_warning")) + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (setenv "BUILD_SOX" "0") + (setenv "USE_FFMPEG" "0") + (substitute* "tools/setup_helpers/extension.py" + (("^( *)\"-DCMAKE_VERBOSE_MAKEFILE=ON\"," all blank) + (string-append + blank "f\"-DCMAKE_INSTALL_RPATH=" + (site-packages inputs + `(("out" . + ,(assoc-ref inputs "python-pytorch")))) + "/torch/lib;" + (site-packages inputs outputs) "/torchaudio/lib\",\n" + blank "\"-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON\",\n" + all)))))))) + (native-inputs + (list cmake + ninja + oneapi-dnnl + python-expecttest + python-parameterized + python-pytest + python-scipy + python-setuptools + python-wheel + sox)) + (inputs (package-inputs python-pytorch)) + (propagated-inputs (list python-soundfile python-pytorch)) + (home-page "https://pytorch.org/audio") + (synopsis + "Data manipulation and transformation for audio signal processing") + (description + "This package provides a machine learning library of popular datasets, +model architectures, and common transformations to apply @code{python-pytorch} +in the audio domain.") + (license license:bsd-2))) + ;; This package variant includes the dependencies requiring at least AVX2 or ;; AVX-512. (define-public python-pytorch-avx @@ -5361,7 +4979,8 @@ Note: currently this package does not provide GPU support.") python-tqdm python-xxhash)) (native-inputs - (list python-flit-core-next + (list openssl + python-flit-core python-pytest python-pytest-cov)) (home-page "https://pyg.org") @@ -5413,10 +5032,11 @@ AI services.") (base32 "1xg9cngdz9dsxwcpcmzf28q306i15hw58h54allhb41q4wzziqip")))) (build-system pyproject-build-system) + (arguments + (list #:tests? #f)) ;XXX: broken tests (native-inputs (list python-coverage - python-setuptools - python-wheel)) + python-setuptools)) (propagated-inputs (list python-importlib-metadata python-packaging @@ -5430,7 +5050,7 @@ Actions for the Lightning suite of libraries.") (define-public python-captum (package (name "python-captum") - (version "0.7.0") + (version "0.8.0") (source (origin (method git-fetch) (uri (git-reference @@ -5439,35 +5059,32 @@ Actions for the Lightning suite of libraries.") (file-name (git-file-name name version)) (sha256 (base32 - "0bgfwnlsi50hbmknn7qljiy93fi6ggwz3k7yk9kj7s37mhzaylym")))) + "066sal7hzpk9gsb6pk61sa9x01ckjbjb2mc8c69nc7aghqqrpqjs")))) (build-system pyproject-build-system) (arguments (list #:test-flags - '(list "-k" (string-append - ;; These two tests (out of more than 1000 tests) fail because of - ;; accuracy problems. - "not test_softmax_classification_batch_multi_target" - " and not test_softmax_classification_batch_zero_baseline" - ;; This test fails with PyTorch 2.7.0 due to stricter - ;; torch.load weights_only behavior. - " and not test_exp_sets_with_diffent_lengths")))) + #~(list "-k" (string-append + ;; These two tests (out of more than 1000 tests) fail + ;; because of accuracy problems. + "not test_softmax_classification_batch_multi_target" + " and not test_softmax_classification_batch_zero_baseline" + ;; This test fails with PyTorch 2.7.0 due to stricter + ;; torch.load weights_only behavior. + " and not test_exp_sets_with_diffent_lengths") + "tests"))) + (native-inputs + (list python-flask + python-pytest + python-flask-compress + python-parameterized + python-scikit-learn + python-setuptools)) (propagated-inputs - (list python-matplotlib python-numpy python-pytorch python-tqdm)) - (native-inputs (list jupyter - python-annoy - python-black - python-flake8 - python-flask - python-flask-compress - python-ipython - python-ipywidgets - python-mypy - python-parameterized - python-pytest - python-pytest-cov - python-scikit-learn - python-setuptools)) + (list python-matplotlib + python-numpy + python-pytorch + python-tqdm)) (home-page "https://captum.ai") (synopsis "Model interpretability for PyTorch") (description "Captum is a model interpretability and understanding library @@ -5480,24 +5097,23 @@ as torchvision, torchtext, and others.") (define-public python-readchar (package (name "python-readchar") - (version "4.0.5") - (source (origin - (method url-fetch) - (uri (pypi-uri "readchar" version)) - (sha256 - (base32 - "09n8vl2jjbnbnrzfvkynijrnwrqvc91bb2267zg8r261sz15d908")))) + (version "4.2.1") + (source + (origin + ;; There is no tests data in PyPI archive. + (method git-fetch) + (uri (git-reference + (url "https://github.com/magmax/python-readchar/") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "16ypci664l54ka6ickwkpaa2id14h9h00y7z24z0bv0szld4mrxg")))) (build-system pyproject-build-system) - (arguments - (list - #:phases - '(modify-phases %standard-phases - ;; This one file requires the msvcrt module, which we don't have. - (add-after 'unpack 'delete-windows-file - (lambda _ - (delete-file "readchar/_win_read.py")))))) - (propagated-inputs (list python-setuptools)) - (native-inputs (list python-wheel)) + (native-inputs + (list python-pytest + python-pytest-cov + python-setuptools)) (home-page "https://github.com/magmax/python-readchar") (synopsis "Library to easily read single chars and key strokes") (description "This package provides a Python library to easily read single @@ -5617,7 +5233,8 @@ feedback.") python-pytest python-psutil python-requests-mock - python-scikit-learn)) + python-scikit-learn + python-setuptools)) (home-page "https://lightning.ai/") (synopsis "Deep learning framework to train, deploy, and ship AI products") (description @@ -5685,7 +5302,7 @@ implementations and an easy-to-use API to create custom metrics. It offers: (define-public python-torchvision (package (name "python-torchvision") - (version "0.22.0") + (version "0.23.0") (source (origin (method git-fetch) (uri (git-reference @@ -5695,7 +5312,7 @@ implementations and an easy-to-use API to create custom metrics. It offers: (file-name (git-file-name name version)) (sha256 (base32 - "0hz6v8796vq8kinafzyq2v2wir5s3hykfn0rnlwx7qcsz62i3ggv")) + "1d09xwblldgzmzfdlrsyx6mgv939z4yi1hqanm9yx63cs2mr7w85")) (modules '((guix build utils))) (snippet '(begin @@ -5740,24 +5357,37 @@ and common image transformations for computer vision.") (license license:bsd-3))) (define-public python-torchfile - (package - (name "python-torchfile") - (version "0.1.0") - (source (origin - (method url-fetch) - (uri (pypi-uri "torchfile" version)) - (sha256 - (base32 - "0vhklj6krl9r0kdynb4kcpwp8y1ihl2zw96byallay3k9c9zwgd5")))) - (build-system python-build-system) - (arguments '(#:tests? #false)) ;there are no tests - (propagated-inputs - (list python-numpy)) - (home-page "https://github.com/bshillingford/python-torchfile") - (synopsis "Torch7 binary serialized file parser") - (description "This package enables you to deserialize Lua torch-serialized objects from -Python.") - (license license:bsd-3))) + ;; Latest release is nine years old. + (let ((commit "fbd434a5b5562c88b91a95e6476e11dbb7735436") + (revision "0")) + (package + (name "python-torchfile") + (version (git-version "0.1.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/bshillingford/python-torchfile/") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1f03ks5n3i3cdh16wx5ysxsxh0ai9vpf0k5pdx759vf31f4niz36")))) + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python3" "tests.py"))))))) + (propagated-inputs + (list python-numpy python-setuptools)) + (home-page "https://github.com/bshillingford/python-torchfile") + (synopsis "Torch7 binary serialized file parser") + (description "This package enables you to deserialize Lua +torch-serialized objects from Python.") + (license license:bsd-3)))) (define-public python-geomloss (package @@ -5790,158 +5420,6 @@ definite approximations of Optimal Transport (Wasserstein) distances. @end itemize") (license license:expat))) -(define-public rust-esaxx-rs-0.1 - (package - (name "rust-esaxx-rs") - (version "0.1.10") - (source - (origin - (method url-fetch) - (uri (crate-uri "esaxx-rs" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "1rm6vm5yr7s3n5ly7k9x9j6ra5p2l2ld151gnaya8x03qcwf05yq")))) - (build-system cargo-build-system) - (arguments - `(#:cargo-inputs (("rust-cc" ,rust-cc-1)))) - (home-page "https://github.com/Narsil/esaxx-rs") - (synopsis "Wrapper for sentencepiece's esaxxx library") - (description - "This package provides a wrapper around sentencepiece's esaxxx library.") - (license license:asl2.0))) - -(define-public rust-spm-precompiled-0.1 - (package - (name "rust-spm-precompiled") - (version "0.1.4") - (source - (origin - (method url-fetch) - (uri (crate-uri "spm_precompiled" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "09pkdk2abr8xf4pb9kq3rk80dgziq6vzfk7aywv3diik82f6jlaq")))) - (build-system cargo-build-system) - (arguments - `(#:cargo-inputs - (("rust-base64" ,rust-base64-0.13) - ("rust-nom" ,rust-nom-7) - ("rust-serde" ,rust-serde-1) - ("rust-unicode-segmentation" ,rust-unicode-segmentation-1)))) - (home-page "https://github.com/huggingface/spm_precompiled") - (synopsis "Emulate sentencepiece's DoubleArray") - (description - "This crate aims to emulate -@url{https://github.com/google/sentencepiece,sentencepiece} -Dart::@code{DoubleArray} struct and it's Normalizer. This crate is highly -specialized and not intended for general use.") - (license license:asl2.0))) - -(define-public rust-hf-hub-0.3 - (package - (name "rust-hf-hub") - (version "0.3.2") - (source - (origin - (method url-fetch) - (uri (crate-uri "hf-hub" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "0cnpivy9fn62lm1fw85kmg3ryvrx8drq63c96vq94gabawshcy1b")))) - (build-system cargo-build-system) - (arguments - `(#:tests? #f ; require network connection - #:cargo-inputs - (("rust-dirs" ,rust-dirs-5) - ("rust-futures" ,rust-futures-0.3) - ("rust-indicatif" ,rust-indicatif-0.17) - ("rust-log" ,rust-log-0.4) - ("rust-native-tls" ,rust-native-tls-0.2) - ("rust-num-cpus" ,rust-num-cpus-1) - ("rust-rand" ,rust-rand-0.8) - ("rust-reqwest" ,rust-reqwest-0.11) - ("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1) - ("rust-thiserror" ,rust-thiserror-1) - ("rust-tokio" ,rust-tokio-1) - ("rust-ureq" ,rust-ureq-2)) - #:cargo-development-inputs - (("rust-hex-literal" ,rust-hex-literal-0.4) - ("rust-sha2" ,rust-sha2-0.10) - ("rust-tokio-test" ,rust-tokio-test-0.4)))) - (native-inputs - (list pkg-config)) - (inputs - (list openssl)) - (home-page "https://github.com/huggingface/hf-hub") - (synopsis "Interact with HuggingFace in Rust") - (description - "This crates aims ease the interaction with -@url{https://huggingface.co/,huggingface}. It aims to be compatible with -@url{https://github.com/huggingface/huggingface_hub/,huggingface_hub} -python package, but only implements a smaller subset of functions.") - (license license:asl2.0))) - -(define-public rust-tokenizers - (package - (name "rust-tokenizers") - (version "0.19.1") - (source - (origin - (method url-fetch) - (uri (crate-uri "tokenizers" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "1zg6ffpllygijb5bh227m9p4lrhf0pjkysky68kddwrsvp8zl075")) - (modules '((guix build utils))) - (snippet - #~(substitute* "Cargo.toml" - (("0.1.12") ; rust-monostate requires a rust-syn-2 update - "0.1.11") - (("version = \"6.4\"") ; rust-onig - "version = \"6.1.1\""))))) - (build-system cargo-build-system) - (arguments - (list - #:tests? #f ; tests are relying on missing data. - #:cargo-inputs - `(("rust-aho-corasick" ,rust-aho-corasick-1) - ("rust-derive-builder" ,rust-derive-builder-0.20) - ("rust-esaxx-rs" ,rust-esaxx-rs-0.1) - ("rust-fancy-regex" ,rust-fancy-regex-0.13) - ("rust-getrandom" ,rust-getrandom-0.2) - ("rust-hf-hub" ,rust-hf-hub-0.3) - ("rust-indicatif" ,rust-indicatif-0.17) - ("rust-itertools" ,rust-itertools-0.12) - ("rust-lazy-static" ,rust-lazy-static-1) - ("rust-log" ,rust-log-0.4) - ("rust-macro-rules-attribute" ,rust-macro-rules-attribute-0.2) - ("rust-monostate" ,rust-monostate-0.1) - ("rust-onig" ,rust-onig-6) - ("rust-paste" ,rust-paste-1) - ("rust-rand" ,rust-rand-0.8) - ("rust-rayon" ,rust-rayon-1) - ("rust-rayon-cond" ,rust-rayon-cond-0.3) - ("rust-regex" ,rust-regex-1) - ("rust-regex-syntax" ,rust-regex-syntax-0.8) - ("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1) - ("rust-spm-precompiled" ,rust-spm-precompiled-0.1) - ("rust-thiserror" ,rust-thiserror-1) - ("rust-unicode-normalization-alignments" ,rust-unicode-normalization-alignments-0.1) - ("rust-unicode-segmentation" ,rust-unicode-segmentation-1) - ("rust-unicode-categories" ,rust-unicode-categories-0.1)) - #:cargo-development-inputs - `(("rust-assert-approx-eq" ,rust-assert-approx-eq-1) - ("rust-criterion" ,rust-criterion-0.5) - ("rust-tempfile" ,rust-tempfile-3)))) - (home-page "https://github.com/huggingface/tokenizers") - (synopsis "Implementation of various popular tokenizers") - (description - "This package provides a Rust implementation of today's most used -tokenizers, with a focus on performances and versatility.") - (license license:asl2.0))) - (define-public python-tokenizers (package (name "python-tokenizers") @@ -5964,49 +5442,22 @@ tokenizers, with a focus on performances and versatility.") (unless (member file '("." "..")) (rename-file (string-append "bindings/python/" file) file))) (scandir "bindings/python")) - (delete-file-recursively ".cargo"))))) + (delete-file-recursively ".cargo") + (substitute* "Cargo.toml" + (("^path = .*") + (format #f "version = ~s~%" #$version))))))) (build-system cargo-build-system) (arguments (list + #:install-source? #f #:cargo-test-flags ''("--no-default-features") #:imported-modules `(,@%cargo-build-system-modules ,@%pyproject-build-system-modules) #:modules '((guix build cargo-build-system) ((guix build pyproject-build-system) #:prefix py:) - (guix build utils) - (ice-9 regex) - (ice-9 textual-ports)) + (guix build utils)) #:phases #~(modify-phases %standard-phases - (add-after 'unpack-rust-crates 'inject-tokenizers - (lambda _ - (substitute* "Cargo.toml" - (("\\[dependencies\\]") - (format #f " -[dev-dependencies] -tempfile = ~s -pyo3 = { version = ~s, features = [\"auto-initialize\"] } - -[dependencies] -tokenizers = ~s" - #$(package-version rust-tempfile-3) - #$(package-version rust-pyo3-0.21) - #$(package-version rust-tokenizers)))) - (let ((file-path "Cargo.toml")) - (call-with-input-file file-path - (lambda (port) - (let* ((content (get-string-all port)) - (top-match (string-match - "\\[dependencies.tokenizers" content))) - (call-with-output-file file-path - (lambda (out) - (format out "~a" (match:prefix top-match)))))))))) - (add-after 'patch-cargo-checksums 'loosen-requirements - (lambda _ - (substitute* "Cargo.toml" - (("version = \"6.4\"") - (format #f "version = ~s" - #$(package-version rust-onig-6)))))) (add-after 'check 'python-check (lambda _ (copy-file "target/release/libtokenizers.so" @@ -6029,28 +5480,16 @@ tokenizers = ~s" (copy-file "PKG-INFO" (string-append info "/METADATA")) (copy-recursively "py_src/tokenizers" - (string-append lib "tokenizers")))))) - #:cargo-inputs - `(("rust-rayon" ,rust-rayon-1) - ("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1) - ("rust-libc" ,rust-libc-0.2) - ("rust-env-logger" ,rust-env-logger-0.11) - ("rust-pyo3" ,rust-pyo3-0.21) - ("rust-numpy" ,rust-numpy-0.21) - ("rust-ndarray" ,rust-ndarray-0.15) - ("rust-onig" ,rust-onig-6) - ("rust-itertools" ,rust-itertools-0.12) - ("rust-tokenizers" ,rust-tokenizers)) - #:cargo-development-inputs - `(("rust-tempfile" ,rust-tempfile-3)))) + (string-append lib "tokenizers")))))))) (native-inputs - (list python-minimal python-pytest)) + (list pkg-config python-minimal python-pytest)) + (inputs + (cons oniguruma (cargo-inputs 'python-tokenizers))) (home-page "https://huggingface.co/docs/tokenizers") (synopsis "Implementation of various popular tokenizers") (description - "This package provides bindings to a Rust implementation of the most used -tokenizers, @code{rust-tokenizers}.") + "This package provides an implementation of today’s most used tokenizers, +with a focus on performance and versatility.") (license license:asl2.0))) (define-public python-transformers @@ -6345,23 +5784,25 @@ algorithm for dense (LAPJV) or sparse (LAPMOD) matrices.") (define-public python-visdom (package (name "python-visdom") - (version "0.1.8.9") - (source (origin - (method url-fetch) - (uri (pypi-uri "visdom" version)) - (sha256 - (base32 - "09kiczx2i5asqsv214fz7sx8wlyldgbqvxwrd0alhjn24cvx4fn7")))) - (build-system python-build-system) + (version "0.2.4") + (source + (origin + (method url-fetch) + (uri (pypi-uri "visdom" version)) + (sha256 + (base32 "0x05faxh45bh1zz8afjhzjy49jrqv4dkhaw1ainhajl1r39i3ac4")))) + (build-system pyproject-build-system) + (arguments (list #:tests? #f)) ;tests require launching the server + (native-inputs + (list python-setuptools)) (propagated-inputs (list python-jsonpatch + python-networkx python-numpy python-pillow - python-pyzmq python-requests python-scipy python-six - python-torchfile python-tornado python-websocket-client)) (home-page "https://github.com/fossasia/visdom") @@ -6375,20 +5816,25 @@ and Numpy.") (package (name "python-pyro-api") (version "0.1.2") - (source (origin - (method url-fetch) - (uri (pypi-uri "pyro-api" version)) - (sha256 - (base32 - "086r2h6x9i5d9ayl1x65lx6p84rlydzsn8xingxc588ab3ch1fd1")))) - (build-system python-build-system) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pyro-ppl/pyro-api") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "17x7niagx43cajqq67dxmssr7q94db6axyg154y7vqdxzp25hf7g")))) + (build-system pyproject-build-system) (arguments '(#:tests? #false)) ;requires pyro (native-inputs (list python-flake8 python-ipython python-pytest + python-setuptools python-sphinx - python-sphinx-rtd-theme)) + python-sphinx-rtd-theme + python-wheel)) (home-page "https://github.com/pyro-ppl/pyro-api") (synopsis "Generic API for dispatch to Pyro backends") (description "This package provides a generic API for dispatch to Pyro backends.") @@ -6493,7 +5939,7 @@ linear algebra routines needed for structured matrices (or operators).") (define-public python-botorch (package (name "python-botorch") - (version "0.14.0") + (version "0.15.1") (source (origin (method git-fetch) ;no tests in PyPI (uri (git-reference @@ -6502,10 +5948,17 @@ linear algebra routines needed for structured matrices (or operators).") (file-name (git-file-name name version)) (sha256 (base32 - "1hgjjzdqcs8y0z20vkdzzpbm0nvnxmrav4mfvbpp0gny8pk64913")))) + "1c6p5h5gypiyj59820q2w3k7rx715r3vxxcr5mnwdjbhi4l2q47a")))) (build-system pyproject-build-system) (arguments - (list #:test-flags #~(list "-k" "not test_all_cases_covered") + ;; 7 failed, 1502 passed, 1 skipped, 1 deselected, 807 warnings + (list #:test-flags #~(list "-k" + (string-append + "not test_all_cases_covered" + " and not test_input_constructors" + " and not test_gen" + " and not test_mock" + " and not test_evaluation")) #:phases #~(modify-phases %standard-phases (add-before 'build 'pretend-version @@ -6592,7 +6045,7 @@ linear algebra routines needed for structured matrices (or operators).") (lambda (x) (install-file x src)) (find-files "." "\\.h$")))))))) (inputs (list kaldi openfst openblas)) - (home-page "https://alphacephei.com/vosk") + (home-page "https://alphacephei.com/vosk/") (synopsis "Speech recognition toolkit based on @code{kaldi}") (description "This package provides a speech recognition toolkit based on @code{kaldi}. It supports more than 20 languages and dialects - English, @@ -6613,10 +6066,12 @@ simple speech recognition.") (package (inherit vosk-api) (name "python-vosk") - (build-system python-build-system) + (build-system pyproject-build-system) (propagated-inputs (list python-cffi python-requests python-tqdm python-srt python-websockets)) (inputs (list vosk-api)) + (native-inputs + (list python-setuptools python-wheel)) (arguments (list #:tests? #f ;; TODO There are tests but not run through Makefile. @@ -6650,8 +6105,8 @@ simple speech recognition.") "lib."))))))))) (define-public nerd-dictation - (let* ((commit "0eb44b7fd0927d69c92de5566e5807ed2c2e20b7") - (revision "1")) + (let* ((commit "03ce043a6d569a5bb9a715be6a8e45d8ba0930fd") + (revision "2")) (package (name "nerd-dictation") (version (git-version "0" revision commit)) @@ -6659,22 +6114,27 @@ simple speech recognition.") (origin (method git-fetch) (uri (git-reference - (url "https://github.com/ideasman42/nerd-dictation") - (commit commit))) + (url "https://github.com/ideasman42/nerd-dictation") + (commit commit))) (file-name (git-file-name name version)) (sha256 - (base32 "0frdpswv6w3cwj3c7wd5w8gj3s1hvpdwd48qhfhfxf7imahz9bqf")))) - (build-system python-build-system) + (base32 "0ksnlpy2jcldxamq7bsbcgxgafcmgxkbjccd4fwmmn0y814kkz9k")))) + (build-system pyproject-build-system) (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda _ (chdir "package/python")))))) + (list + #:test-backend #~'custom + #:test-flags #~(list "../../tests/from_words_to_digits.py") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "package/python")))))) + (native-inputs (list python-setuptools)) (propagated-inputs (list python-vosk)) (home-page "https://github.com/ideasman42/nerd-dictation") (synopsis "Offline speech-to-text for desktop Linux") - (description "\ -This package provides simple access speech to text for using in + (description + "This package provides simple access speech to text for using in Linux without being tied to a desktop environment, using the @code{vosk-api}. The user configuration lets you manipulate text using Python string operations. It has zero overhead, as this relies on manual activation and @@ -6963,15 +6423,23 @@ diverse set of reference environments (formerly Gym).") ;; better that way. (define-public python-dlib (package - (inherit dlib) - (name "python-dlib") - (build-system pyproject-build-system) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'subst - (lambda _ - (substitute* "tools/python/CMakeLists.txt" - (("add_subdirectory[(][.][.]/[.][.]/dlib/external/pybind11 pybind11_build[)]") - "find_package(pybind11 CONFIG)"))))))) - (native-inputs (list python-setuptools python-wheel cmake-minimal perl pkg-config pybind11)))) + (inherit dlib) + (name "python-dlib") + (build-system pyproject-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'subst + (lambda _ + (substitute* "tools/python/CMakeLists.txt" + (("\ +add_subdirectory[(][.][.]/[.][.]/dlib/external/pybind11 pybind11_build[)]") + "find_package(pybind11 CONFIG)"))))))) + (native-inputs + (list cmake-minimal + perl + pkg-config + pybind11 + python-pytest + python-setuptools)))) |