diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2021-08-02 12:17:38 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-08-02 18:11:33 +0200 |
commit | 6da2b35b60aee8086c7ad1ee1c1492ed5e730a92 (patch) | |
tree | 57deffaf057ae6d1028dccb2853ad8b0f95b884a /gnu/packages/machine-learning.scm | |
parent | 92d99aa5dc6829a1d66e3f4c03d145ebcf641192 (diff) | |
download | guix-6da2b35b60aee8086c7ad1ee1c1492ed5e730a92.tar.gz guix-6da2b35b60aee8086c7ad1ee1c1492ed5e730a92.zip |
gnu: Add onnx-optimizer.
* gnu/packages/machine-learning.scm (onnx-optimizer): New variable.
* gnu/packages/patches/onnx-optimizer-system-library.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r-- | gnu/packages/machine-learning.scm | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 177d1aaa4f..b32e5ef289 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -675,6 +675,50 @@ standard data types.") ;; headers, hence the name change. (deprecated-package "python-onnx" onnx)) +(define-public onnx-optimizer + (package + (name "onnx-optimizer") + ;; Note: 0.2.x is *more* recent than 1.5.0. + (version "0.2.6") + (home-page "https://github.com/onnx/optimizer") + (source (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit (string-append "v" version)))) + (sha256 + (base32 + "1wkqqdxcxpfbf8zpbdfdd3zz5jkw775g31gyykj11z4y6pp659l6")) + (file-name (git-file-name name version)) + (patches (search-patches "onnx-optimizer-system-library.patch")) + (modules '((guix build utils))) + (snippet '(delete-file-recursively "third_party")))) + (build-system python-build-system) + (arguments (package-arguments onnx)) ;reuse build system tweaks + (native-inputs + `(("cmake" ,cmake) + ("python-pytest" ,python-pytest) + ("python-pytest-runner" ,python-pytest-runner) + ("python-nbval" ,python-nbval) + ("python-coverage" ,python-coverage))) + (inputs + `(("onnx" ,onnx) + ("protobuf" ,protobuf) + ("pybind11" ,pybind11))) + (propagated-inputs + `(("python-numpy" ,python-numpy))) + (synopsis "Library to optimize ONNX models") + (description + "This package provides a C++ and Python library for performing arbitrary +optimizations on ONNX models, as well as a growing list of prepackaged +optimization passes. + +Not all possible optimizations can be directly implemented on ONNX graphs--- +some will need additional backend-specific information---but many can, and the +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 (package (name "rxcpp") |