diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2023-12-27 23:32:21 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2024-01-01 14:35:12 +0100 |
commit | 1e5faccecd6bdb24cc6b23221dc3080c5bc00699 (patch) | |
tree | b44cb764a9b4d2845610e2748ef09e785ff5d6a4 /gnu/packages/machine-learning.scm | |
parent | 6055bb3163414f84c818926e1573a7cc17669bc5 (diff) | |
download | guix-1e5faccecd6bdb24cc6b23221dc3080c5bc00699.tar.gz guix-1e5faccecd6bdb24cc6b23221dc3080c5bc00699.zip |
gnu: python-pytorch-for-r-torch: Update to 2.0.1.
* gnu/packages/machine-learning.scm (python-pytorch-for-r-torch): Update to 2.0.1.
* gnu/packages/patches/python-pytorch2-system-libraries.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
Change-Id: I97551d543e50f6e511aa0529c097d156cf3f96de
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r-- | gnu/packages/machine-learning.scm | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 6455fcc024..3ddd56f69b 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -4085,7 +4085,59 @@ PyTorch when needed. Note: currently this package does not provide GPU support.") (license license:bsd-3))) -(define-public python-pytorch-for-r-torch python-pytorch) +(define-public python-pytorch-for-r-torch + (package + (inherit python-pytorch) + (name "python-pytorch") + (version "2.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pytorch/pytorch") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "14m7v54zyd2qg2xk9mqdpbf4ps7091mdzinzh4vq9p5k4bpznj65")) + (patches (search-patches "python-pytorch2-system-libraries.patch" + "python-pytorch-runpath.patch")) + (modules '((guix build utils))) + (snippet + '(begin + ;; XXX: Let's be clear: this package is a bundling fest. We + ;; delete as much as we can, but there's still a lot left. + (for-each (lambda (directory) + (delete-file-recursively + (string-append "third_party/" directory))) + '("benchmark" "cpuinfo" "eigen" + + ;; FIXME: QNNPACK (of which XNNPACK is a fork) + ;; needs these. + ;; "FP16" "FXdiv" "gemmlowp" "psimd" + + "gloo" "googletest" "ios-cmake" "NNPACK" + "onnx" "protobuf" "pthreadpool" + "pybind11" "python-enum" "python-peachpy" + "python-six" "tbb" "XNNPACK" "zstd")) + (substitute* "caffe2/CMakeLists.txt" + (("target_link_libraries\\(\\$\\{test_name\\}_\\$\\{CPU_CAPABILITY\\} c10 sleef gtest_main\\)") + "target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest gtest_main)")) + (substitute* "functorch/CMakeLists.txt" + (("\\$\\{_rpath_portable_origin\\}/../torch/lib") + "$ORIGIN/../torch/lib")))))) + (inputs + (modify-inputs (package-inputs python-pytorch) + (replace "xnnpack" xnnpack-for-torch2))) + (propagated-inputs + (modify-inputs (package-propagated-inputs python-pytorch) + (append python-filelock + python-jinja2 + python-networkx + python-opt-einsum + python-sympy) + (replace "onnx" onnx-for-torch2) + (replace "onnx-optimizer" onnx-optimizer-for-torch2))))) (define-public python-lightning-cloud (package |