[PATCH 00/24] Update PyTorch and dependencies

  • Done
  • quality assurance status badge
Details
2 participants
  • David Elsing
  • Ludovic Courtès
Owner
unassigned
Submitted by
David Elsing
Severity
normal
D
D
David Elsing wrote on 4 Aug 23:53 +0200
(address . guix-patches@gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804220847.15842-1-david.elsing@posteo.net
Hello,

this patch series updates python-pytorch to version 2.4.0 and some of
its dependencies and dependent packages.

I noticed that on Linux, upstream does not support 32-bit architectures
anyway, so I set supported-systems to x86_64-linux and aarch64-linux,
but tested only the former.

For onnx and onnx-optimizer, I referenced the patches in
https://issues.guix.gnu.org/65630and therefore added a "Co-authored-by"
line for Andy Tai. Is that correct to do?

r-torch still depends on version 2.0.1 of PyTorch, so it is kept.

Cheers,
David

David Elsing (24):
gnu: asmjit: Update to commit 062e69c.
gnu: Remove python-typing-extensions-4.10.
gnu: python-optree: Update to 0.11.0.
gnu: flatbuffers-next: Update to 24.3.25.
gnu: pthreadpool: Update to commit 560c60d.
gnu: cpuinfo: Update to commit 05332fd.
gnu: nnpack: Depend on python-peachpy only for x86_64.
gnu: oneapi-dnnl: Update to 3.5.3.
gnu: fbgemm: Update to 0.7.0.
gnu: xnnpack: Update to commit 08f1489.
gnu: Add xnnpack-for-r-torch.
gnu: python-nbval: Update to 0.11.0.
gnu: Add python-parameterized-next.
gnu: Remove onnx-optimizer-for-torch2.
gnu: Remove onnx-for-torch2.
gnu: onnx: Update to 1.16.2.
gnu: onnx-optimizer: Update to 0.3.19.
gnu: gloo: Update to commit 81925d1.
gnu: cpp-httplib: Update to 0.16.0.
gnu: python-pytorch: Update to 2.4.0.
gnu: python-torchvision: Update to 0.19.0.
gnu: python-lightning-utilities: Update to 0.11.6.
gnu: python-torchmetrics: Update to 1.4.1.
gnu: python-pytorch-lightning: Update to commit 2064887.

gnu/local.mk | 3 -
gnu/packages/check.scm | 22 +
gnu/packages/cpp.scm | 8 +-
gnu/packages/machine-learning.scm | 778 +++--
gnu/packages/parallel.scm | 16 +-
.../onnx-optimizer-system-library.patch | 60 +-
.../patches/onnx-shared-libraries.patch | 18 +-
.../patches/onnx-skip-model-downloads.patch | 16 +-
.../patches/onnx-use-system-googletest.patch | 57 -
.../patches/python-pytorch-fix-codegen.patch | 26 +-
.../patches/python-pytorch-runpath.patch | 19 +-
.../python-pytorch-system-libraries.patch | 122 +-
.../python-pytorch-without-kineto.patch | 10 +-
.../patches/xnnpack-remove-broken-tests.patch | 337 ---
.../patches/xnnpack-system-libraries.patch | 2660 -----------------
gnu/packages/python-build.scm | 12 -
gnu/packages/python-check.scm | 27 +-
gnu/packages/python-xyz.scm | 9 +-
gnu/packages/serialization.scm | 4 +-
19 files changed, 641 insertions(+), 3563 deletions(-)
delete mode 100644 gnu/packages/patches/onnx-use-system-googletest.patch
delete mode 100644 gnu/packages/patches/xnnpack-remove-broken-tests.patch
delete mode 100644 gnu/packages/patches/xnnpack-system-libraries.patch

--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 01/24] gnu: asmjit: Update to commit 062e69c.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-1-david.elsing@posteo.net
* gnu/packages/cpp.scm (asmjit): Update to commit 062e69c.
---
gnu/packages/cpp.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index c1c2a4028b..6b46465abf 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -158,7 +158,7 @@ (define-public argagg
(license license:expat))))
(define-public asmjit
- (let ((commit "3ca5c186bf8922e5fe3018432e93651fd2fa4053")
+ (let ((commit "062e69ca81defa35eb0ee15f7412f49a0dad3cdb")
(revision "1"))
(package
(name "asmjit")
@@ -172,7 +172,7 @@ (define-public asmjit
(commit commit)))
(file-name (git-file-name name version))
(sha256
- (base32 "10k1zc0w8m0vnh52id9qlm1sb99qmpvr6k0ha8ag2h223n0d591g"))))
+ (base32 "0lcwqzbv2628g3c7sflkwagyh49lp471px8bhg7lr77w9y94srqq"))))
(build-system cmake-build-system)
(arguments
(list #:configure-flags #~(list "-DASMJIT_TEST=TRUE")))
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 02/24] gnu: Remove python-typing-extensions-4.10.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-2-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (python-typing-extensions-4.10): Delete
variable.
* gnu/packages/machine-learning.scm (python-pytorch)[native-inputs] Replace
python-typing-extensions-4.10 with python-typing-extensions.
---
gnu/packages/machine-learning.scm | 2 +-
gnu/packages/python-build.scm | 12 ------------
2 files changed, 1 insertion(+), 13 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 4c5b713cbf..418bfb5d03 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4666,7 +4666,7 @@ (define-public python-pytorch
python-pytest-xdist
python-hypothesis
python-types-dataclasses
- python-typing-extensions-4.10
+ python-typing-extensions
shaderc
valgrind))
(inputs
diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 72da369208..43fc018d4c 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -264,18 +264,6 @@ (define-public python-typing-extensions
@end enumerate\n")
(license license:psfl)))
-(define-public python-typing-extensions-4.10
- (package
- (inherit python-typing-extensions)
- (version "4.10.0")
- (source
- (origin
- (method url-fetch)
- (uri (pypi-uri "typing_extensions" version))
- (sha256
- (base32
- "1jxkj4pni8pdyrn79sq441lsp40xzw363n0qvfc6zfcgkv4dgaxh"))))))
-
;;;
;;; Python builder packages.
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 04/24] gnu: flatbuffers-next: Update to 24.3.25.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-4-david.elsing@posteo.net
* gnu/packages/serialization.scm (flatbuffers-next): Update to 24.3.25.
---
gnu/packages/serialization.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 6aaf416467..8c7e7d9116 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -902,7 +902,7 @@ (define-public flatbuffers
(define-public flatbuffers-next
(package
(inherit flatbuffers)
- (version "23.5.26")
+ (version "24.3.25")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -911,7 +911,7 @@ (define-public flatbuffers-next
(file-name (git-file-name "flatbuffers" version))
(sha256
(base32
- "0cd12dvkzqdafz46q4302mzgpzbz589zmmiga7bq07f2sqy4vrvv"))))))
+ "0q066x1h0x9225aj25jv40gxgz46yvwmiqc2g6q06mkkg1144kxq"))))))
(define-public python-flatbuffers
(package
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 03/24] gnu: python-optree: Update to 0.11.0.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-3-david.elsing@posteo.net
* gnu/packages/python-xyz.scm (python-optree): Update to 0.11.0.
[arguments]<#:test-flags>: Disable failing test.
---
gnu/packages/python-xyz.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ce33b330a3..ae34bd7dcb 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12300,7 +12300,7 @@ (define-public python-treelib
(define-public python-optree
(package
(name "python-optree")
- (version "0.10.0")
+ (version "0.11.0")
(source
(origin
(method git-fetch)
@@ -12310,9 +12310,14 @@ (define-public python-optree
(file-name (git-file-name name version))
(sha256
(base32
- "1q3wljk7cyl5rsam02sfsj8zjrqx4c3x9vic8j6xx13p8czpsisg"))
+ "0sk5lm1xyxi7z0yjckip77qvbidyb7i1znmn9fz96q74hl9ffyan"))
(patches (search-patches "python-optree-fix-32-bit.patch"))))
(build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags
+ ;; This test fails due to a circular import
+ ''("-k" "not test_treespec_pickle_missing_registration")))
(propagated-inputs (list python-typing-extensions))
(native-inputs
(list python-pytest
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 05/24] gnu: pthreadpool: Update to commit 560c60d.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-5-david.elsing@posteo.net
* gnu/packages/parallel.scm (pthreadpool): Update to commit 560c60d.
---
gnu/packages/parallel.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index 2e00701582..ca1e92963a 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -488,9 +488,9 @@ (define-public python-slurm-magic
(define-public pthreadpool
;; This repository has only one tag, 0.1, which is older than what users
;; such as XNNPACK expect.
- (let ((commit "178e3e0646cc671708bf78e77c273940130ac637")
+ (let ((commit "560c60d342a76076f0557a3946924c6478470044")
(version "0.1")
- (revision "2"))
+ (revision "3"))
(package
(name "pthreadpool")
(version (git-version version revision commit))
@@ -501,7 +501,7 @@ (define-public pthreadpool
(file-name (git-file-name name version))
(sha256
(base32
- "1s86lnq9bahacf5wxn7y14w70jh3g9lq1l7y16ijwhifd01nc2km"))
+ "0l82ix1h8pmjikf15bvmlap355gmyfjpahmgz4lbd6g40ab3ls5c"))
(patches (search-patches "pthreadpool-system-libraries.patch"))))
(build-system cmake-build-system)
(arguments '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 06/24] gnu: cpuinfo: Update to commit 05332fd.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-6-david.elsing@posteo.net
Also disable tests on aarch64, because they fail in the build container.

* gnu/packages/parallel.scm (cpuinfo): Update to commit 05332fd.
[arguments]<#:tests?>: Disable on aarch64.
[supported-systems]: Remove field.
---
gnu/packages/parallel.scm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index ca1e92963a..9be6e993e7 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -519,7 +519,7 @@ (define-public cpuinfo
;; There's currently no tag on this repo.
(let ((version "0.0")
(revision "3")
- (commit "aa4b2163b99ac9534194520f70b93eeefb0b3b4e"))
+ (commit "05332fd802d9109a2a151ec32154b107c1e5caf9"))
(package
(name "cpuinfo")
(version (git-version version revision commit))
@@ -530,10 +530,13 @@ (define-public cpuinfo
(file-name (git-file-name name version))
(sha256
(base32
- "12x4krkyzxngf1l2ck33lnsp8pyzf6gyjj9mp9cnka9mw3h6617m"))))
+ "0w0kfc1fn9viirkhbr8dgfy9m5clfsg3k9p6kdxhzqpyjhgd252n"))))
(build-system cmake-build-system)
(arguments
(list
+ ;; cpuinfo does not work in the build container for aarch64:
+ ;; https://github.com/pytorch/cpuinfo/issues/143
+ #:tests? (not (target-aarch64?))
#:configure-flags
'(list "-DBUILD_SHARED_LIBS=ON"
"-DUSE_SYSTEM_LIBS=ON")
@@ -552,9 +555,6 @@ (define-public cpuinfo
"The cpuinfo library provides a C/C++ and a command-line interface to
obtain information about the CPU being used: supported instruction set,
processor name, cache information, and topology information.")
- ;; On aarch64-linux, there is a bug reported upstream:
- ;; https://github.com/pytorch/cpuinfo/issues/14
- (supported-systems '("armhf-linux" "i686-linux" "x86_64-linux"))
(license license:bsd-2))))
(define-public clog
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 10/24] gnu: xnnpack: Update to commit 08f1489.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-10-david.elsing@posteo.net
More tests fail when building the shared library, so they are disabled. The
scripts to generate the autogenerated files run all commands at once, so they
are converted to Makefiles first.

* gnu/packages/machine-learning.scm (xnnpack): Update to commit 08f1489.
[source]: Remove patch. Adjust snippet.
[arguments]<#:configure-flags>: Add "-DXNNPACK_BUILD_TESTS=OFF".
<#:tests?>: Disable tests.
<#:phases>: Adjust 'fix-cmake' phase. Convert code generation scripts to
Makefiles and run them. Run different missing scripts.
* gnu/packages/patches/xnnpack-remove-broken-tests.patch: Remove file.
* gnu/packages/patches/xnnpack-system-libraries.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove them.
---
gnu/local.mk | 2 -
gnu/packages/machine-learning.scm | 102 +-
.../patches/xnnpack-remove-broken-tests.patch | 337 ---
.../patches/xnnpack-system-libraries.patch | 2660 -----------------
4 files changed, 65 insertions(+), 3036 deletions(-)
delete mode 100644 gnu/packages/patches/xnnpack-remove-broken-tests.patch
delete mode 100644 gnu/packages/patches/xnnpack-system-libraries.patch

Toggle diff (190 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 6d2b14e72d..fd8262de55 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2259,8 +2259,6 @@ dist_patch_DATA = \
%D%/packages/patches/xfce4-settings-defaults.patch \
%D%/packages/patches/xgboost-use-system-dmlc-core.patch \
%D%/packages/patches/xmonad-dynamic-linking.patch \
- %D%/packages/patches/xnnpack-remove-broken-tests.patch \
- %D%/packages/patches/xnnpack-system-libraries.patch \
%D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \
%D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \
%D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 5a909311e2..6fcfc1d167 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4106,7 +4106,7 @@ (define-public qnnpack
(define-public xnnpack
;; There's currently no tag on this repo.
(let ((version "0.0")
- (commit "51a987591a6fc9f0fc0707077f53d763ac132cbf")
+ (commit "08f1489fc815e8f121d4d2676c4863d2b51bfe73")
(revision "3"))
(package
(name "xnnpack")
@@ -4119,34 +4119,14 @@ (define-public xnnpack
(file-name (git-file-name name version))
(sha256
(base32
- "1rzby82xq8d0rl1d148yz88jh9cpsw5c8b2yw7yg39mi7qmr55rm"))
- ;; Some tests fail to link as they use internal symbols, which are
- ;; not included in the shared library.
- ;; XXX: Additionally, these tests fail on i686 due to incorrect results:
- ;; 171 - f32-vlrelu-test (Failed)
- ;; 211 - qs8-gavgpool-minmax-fp32-test (Failed)
- ;; 224 - qu8-avgpool-minmax-fp32-test (Failed)
- ;; 228 - qu8-gavgpool-minmax-fp32-test (Failed)
- ;; 263 - x32-packx-test (Failed)
- (patches (search-patches "xnnpack-remove-broken-tests.patch"))
+ "00jjhz0nfggbdnqqvcznba03pcyy7gssd24yhhzjhincnz9qh8jr"))
(modules '((guix build utils)
(ice-9 ftw)
(ice-9 textual-ports)
(srfi srfi-26)))
(snippet
'(begin
- ;; Remove autogenerated files
- (for-each
- (lambda (dir)
- (let ((gendir (string-append "src/" dir "/gen")))
- (when (file-exists? gendir)
- (delete-file-recursively gendir)
- ;; Needed for the scripts generating the files
- (mkdir gendir))))
- (scandir "src" (negate (cut member <> '("." "..")))))
- (delete-file-recursively "google3")
- (delete-file "cmake/microkernels.cmake")
- ;; Additional autogenerated files which contain the string
+ ;; Remove autogenerated files, which contain the string
;; "Auto-generated file"
(for-each
(lambda (dir)
@@ -4159,8 +4139,18 @@ (define-public xnnpack
(get-string-all port)
"Auto-generated file")))
(delete-file path))))
- (scandir dir (negate (cut member <> '("." ".."))))))
- '("test" "bench" "eval" "models" "src/enums" "src/xnnpack"))))))
+ (scandir dir (negate (cut member <> '("." ".." "simd"))))))
+ (cons*
+ "test" "bench" "eval" "models" "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 <> '("." ".."))))))))))))
(build-system cmake-build-system)
(arguments
(list
@@ -4169,7 +4159,11 @@ (define-public xnnpack
"-DBUILD_SHARED_LIBS=ON"
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
"-DXNNPACK_LIBRARY_TYPE=shared"
- "-DXNNPACK_BUILD_BENCHMARKS=FALSE")
+ "-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)
(guix build utils))
@@ -4179,27 +4173,61 @@ (define-public xnnpack
(lambda _
(substitute* "CMakeLists.txt"
(("TARGET_INCLUDE_DIRECTORIES\\((pthreadpool|cpuinfo).*") "")
- ((".*IF\\(NOT TARGET gtest\\).*")
- "IF(FALSE)\n")
- (("SET\\(CMAKE_CXX_STANDARD 11\\)")
- "SET(CMAKE_CXX_STANDARD 14)")
(("AMD64") "x86_64"))))
(add-after 'patch-source-shebangs 'generate-files
(lambda _
+ ;; This script just calls two other scripts.
+ (delete-file "scripts/generate-tests-and-benchmarks.sh")
+ ;; The bash scripts run all jobs at once and then wait, so we
+ ;; convert them to Makefiles.
(for-each
(lambda (name)
+ (define counter 0) ; For the targets
+ (define target-deps "")
(when (and (string-prefix? "generate" name)
- (string-suffix? ".sh" name)
- (not (equal? "generate-amalgamation.sh" name)))
- (display (string-append name "\n"))
- (invoke "bash" (string-append "scripts/" name))))
+ (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)
+ (begin
+ (set! counter (+ counter 1))
+ (string-append "target" (number->string counter)
+ ":" target-deps
+ "\n\t" command "\n")))
+ (("[[:space:]]*wait[[:space:]]*") "")
+ ;; The commands after this line depend on the
+ ;; previous commands in the file.
+ (("JIT requires assembly files to be generated first.*" all)
+ (begin
+ (set! target-deps
+ (string-append
+ target-deps " target"
+ (string-join
+ (map number->string (iota counter 1)) " target")))
+ all)))
+ (display (string-append "Running " name "\n"))
+ (apply invoke "make" "-s" "-f" file "-j"
+ (number->string (parallel-job-count))
+ (map
+ (lambda (i)
+ (string-append "target" (number->string i)))
+ (iota counter 1))))))
(scandir "scripts"))
;; These need to run after the above scripts
(display "Remaining files\n")
(invoke "python3" "tools/update-microkernels.py")
- (substitute* "tools/amalgamate-microkernels.py"
- (("BUILD") "BUILD.bazel"))
- (invoke "bash" "scripts/generate-amalgamation.sh"))))))
+ (invoke "python3" "tools/update-microkernels.py" "-a")
+ (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"))))))
(inputs
(list clog
cpuinfo
diff --git a/gnu/packages/patches/xnnpack-remove-broken-tests.patch b/gnu/packages/patches/xnnpack-remove-broken-tests.patch
deleted file mode 100644
index 91b7ca9998..0000000000
--- a/gnu/packages/patches/xnnpack-remove-broken-tests.patch
+++ /dev/null
@@ -1,337 +0,0 @@
-These tests fail to build because we are building a shared library.
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 95df99eae..ab57d5efa 100755
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -978,16 +978,6 @@ IF(XNNPACK_BUILD_TESTS)
- TARGET_LINK_LIBRARIES(add-nd-eager-test PRIVATE XNNPACK fp16 gtest gtest_main)
- ADD_TEST(NAME add-nd-eager-test COMMAND add-nd-eager-test)
-
-- ADD_EXECUTABLE(argmax-pooling-nhwc-test test/argmax-pooling-nhwc.cc)
-- TARGET_INCLUDE_DIRECTORIES(argmax-pooling-nhwc-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(argmax-pooling-nhwc-test PRIVATE XNNPACK gtest gtest_main)
-- ADD_TEST(NAME argmax-pooling-nhwc-test COMMAND argmax-pooling-nhwc-test)
--
-- ADD_EXECUTABLE(average-pooling-nhwc-test test/average-pooling-nhwc.cc)
-- TARGET_INCLUDE_DIRECTORIES(average-pooling-nhwc-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(average-pooling-nhwc-test PRIVATE XNNPACK fp16 gtest gtest_main)
-- ADD_TEST(NAME average-pooling-nhwc-test COMMAND average-pooling-nhwc-test)
--
- ADD_EXECUTABLE(bankers-rounding-nc-test test/bankers-rounding-nc.cc)
- TARGET_INCLUDE_DIRECTORIES(bankers-rounding-nc-test PRIVATE src test)
- TARGET_LINK_LIBRARIES(bankers-rounding-nc-test PRIVATE XNNPACK fp16 gtest gtest_main)
-@@ -1066,11 +1056,6 @@ IF(XNNPACK_BUILD_TESTS)
- TARGET_LINK_LIBRARIES(copy-nc-eager-test PRIVATE XNNPACK gtest gtest_main)
- ADD_TEST(NAME copy-nc-eager-test COMMAND copy-nc-eager-test)
-
-- ADD_EXECUTABLE(deconvolution-nhwc-test test/deconvolution-nhwc.cc)
-- TARGET_INCLUDE_DIRECTORIES(deconvolution-nhwc-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(deconvolution-nhwc-test PRIVATE XNNPACK fp16 gtest gtest_main)
-- ADD_TEST(NAME deconvolution-nhwc-test COMMAND deconvolution-nhwc-test)
--
- ADD_EXECUTABLE(depth-to-space-nchw2nhwc-test test/depth-to-space-nchw2nhwc.cc)
- TARGET_INCLUDE_DIRECTORIES(depth-to-space-nchw2nhwc-test PRIVATE src test)
- TARGET_LINK_LIBRARIES(depth-to-space-nchw2nhwc-test PRIVATE XNNPACK gtest gtest_main)
-@@ -1116,11 +1101,6 @@ IF(XNNPACK_BUILD_TESTS)
- TARGET_LINK_LIBRARIES(floor-nc-eager-test PRIVATE XNNPACK fp16 gtest gtest_main)
- ADD_TEST(NAME floor-nc-eager-test COMMAND floor-nc-eager-test)
-
-- ADD_EXECUTABLE(global-average-pooling-nwc-test test/global-average-pooling-nwc.cc)
-- TARGET_INCLUDE_DIRECTORIES(global-average-pooling-nwc-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(global-average-pooling-nwc-test PRIVATE XNNPACK fp16 gtest gtest_main)
-- ADD_TEST(NAME global-average-pooling-nwc-test COMMAND global-average-pooling-nwc-test)
--
- ADD_EXECUTABLE(global-average-pooling-ncw-test test/global-average-pooling-ncw.cc)
- TARGET_INCLUDE_DIRECTORIES(global-average-pooling-ncw-test PRIVATE src test)
- TARGET_LINK_LIBRARIES(global-average-pooling-ncw-test PRIVATE XNNPACK fp16 gtest gtest_main)
-@@ -1146,11 +1126,6 @@ IF(XNNPACK_BUILD_TESTS)
- TARGET_LINK_LIBRARIES(leaky-relu-nc-eager-test PRIVATE XNNPACK fp16 gtest gtest_main)
- ADD_TEST(NAME leaky-relu-nc-eager-test COMMAND leaky-relu-nc-eager-test)
-
-- ADD_EXECUTABLE(max-pooling-nhwc-test test/max-pooling-nhwc.cc)
-- TARGET_INCLUDE_DIRECTORIES(max-pooling-nhwc-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(max-pooling-nhwc-test PRIVATE XNNPACK fp16 gtest gtest_main)
-- ADD_TEST(NAME max-pooling-nhwc-test COMMAND max-pooling-nhwc-test)
--
- ADD_EXECUTABLE(maximum-nd-test test/maximum-nd.cc)
- TARGET_INCLUDE_DIRECTORIES(maximum-nd-test PRIVATE src test)
- TARGET_LINK_LIBRARIES(maximum-nd-test PRIVATE XNNPACK fp16 gtest gtest_main)
-@@ -1191,11 +1166,6 @@ IF(XNNPACK_BUILD_TESTS)
- TARGET_LINK_LIBRARIES(negate-nc-eager-test PRIVATE XNNPACK fp16 gtest gtest_main)
- ADD_TEST(NAME negate-nc-eager-test COMMAND negate-nc-eager-test)
-
-- ADD_EXECUTABLE(prelu-nc-test test/prelu-nc.cc)
-- TARGET_INCLUDE_DIRECTORIES(prelu-nc-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(prelu-nc-test PRIVATE XNNPACK fp16 gtest gtest_main)
-- ADD_TEST(NAME prelu-nc-test COMMAND prelu-nc-test)
--
- ADD_EXECUTABLE(resize-bilinear-nhwc-test test/resize-bilinear-nhwc.cc)
- TARGET_INCLUDE_DIRECTORIES(resize-bilinear-nhwc-test PRIVATE src test)
- TARGET_LINK_LIBRARIES(resize-bilinear-nhwc-test PRIVATE XNNPACK fp16 gtest gtest_main)
-@@ -1312,16 +1282,6 @@ IF(XNNPACK_BUILD_TESTS)
- TARGET_LINK_LIBRARIES(fusion-test PRIVATE XNNPACK gtest gtest_main)
- ADD_TEST(NAME fusion-test COMMAND fusion-test)
-
-- ADD_EXECUTABLE(memory-planner-test test/memory-planner-test.cc)
-- TARGET_INCLUDE_DIRECTORIES(memory-planner-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(memory-planner-test PRIVATE XNNPACK gtest gtest_main)
-- ADD_TEST(NAME memory-planner-test COMMAND memory-planner-test)
--
-- ADD_EXECUTABLE(subgraph-fp16-test test/subgraph-fp16.cc)
-- TARGET_INCLUDE_DIRECTORIES(subgraph-fp16-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(subgraph-fp16-test PRIVATE XNNPACK gtest gtest_main)
-- ADD_TEST(NAME subgraph-fp16-test COMMAND subgraph-fp16-test)
--
- ADD_EXECUTABLE(subgraph-nchw-test test/subgraph-nchw.cc)
- TARGET_INCLUDE_DIRECTORIES(subgraph-nchw-test PRIVATE src test)
- TARGET_LINK_LIBRARIES(subgraph-nchw-test PRIVATE XNNPACK gtest gtest_main)
-@@ -1347,226 +1307,6 @@ IF(XNNPACK_BUILD_TESTS)
- TARGET_INCLUDE_DIRECTORIES(argmax-pooling-2d-test PRIVATE src test)
- TARGET_LINK_LIBRARIES(argmax-pooling-2d-test PRIVATE XNNPACK gtest gtest_main)
- ADD_TEST(NAME argmax-pooling-2d-test COMMAND argmax-pooling-2d-test)
--
-- ADD_EXECUTABLE(average-pooling-2d-test test/average-pooling-2d.cc)
-- TARGET_INCLUDE_DIRECTORIES(average-pooling-2d-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(average-pooling-2d-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph)
-- ADD_TEST(NAME average-pooling-2d-test COMMAND average-pooling-2d-test)
--
-- ADD_EXECUTABLE(bankers-rounding-test test/bankers-rounding.cc)
-- TARGET_INCLUDE_DIRECTORIES(bankers-rounding-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(bankers-rounding-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph)
-- ADD_TEST(NAME bankers-rounding-test COMMAND bankers-rounding-test)
--
-- ADD_EXECUTABLE(ceiling-test test/ceiling.cc)
-- TARGET_INCLUDE_DIRECTORIES(ceiling-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(ceiling-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph)
-- ADD_TEST(NAME ceiling-test COMMAND ceiling-test)
--
-- ADD_EXECUTABLE(clamp-test test/clamp.cc)
-- TARGET_INCLUDE_DIRECTORIES(clamp-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(clamp-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph)
-- ADD_TEST(NAME clamp-test COMMAND clamp-test)
--
-- ADD_EXECUTABLE(concatenate2-test test/concatenate2.cc)
-- TARGET_INCLUDE_DIRECTORIES(concatenate2-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(concatenate2-test PRIVATE XNNPACK gtest gtest_main subgraph)
-- ADD_TEST(NAME concatenate2-test COMMAND concatenate2-test)
--
-- ADD_EXECUTABLE(concatenate3-test test/concatenate3.cc)
-- TARGET_INCLUDE_DIRECTORIES(concatenate3-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(concatenate3-test PRIVATE XNNPACK gtest gtest_main subgraph)
-- ADD_TEST(NAME concatenate3-test COMMAND concatenate3-test)
--
-- ADD_EXECUTABLE(concatenate4-test test/concatenate4.cc)
-- TARGET_INCLUDE_DIRECTORIES(concatenate4-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(concatenate4-test PRIVATE XNNPACK gtest gtest_main subgraph)
-- ADD_TEST(NAME concatenate4-test COMMAND concatenate4-test)
--
-- ADD_EXECUTABLE(convert-test test/convert.cc)
-- TARGET_INCLUDE_DIRECTORIES(convert-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(convert-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph)
-- ADD_TEST(NAME convert-test COMMAND convert-test)
--
-- ADD_EXECUTABLE(convolution-2d-test test/convolution-2d.cc)
-- SET_TARGET_PROPERTIES(convolution-2d-test PROPERTIES CXX_EXTENSIONS YES)
-- TARGET_INCLUDE_DIRECTORIES(convolution-2d-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(convolution-2d-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph convolution-test-helpers)
-- ADD_TEST(NAME convolution-2d-test COMMAND convolution-2d-test)
--
-- ADD_EXECUTABLE(copy-test test/copy.cc)
-- TARGET_INCLUDE_DIRECTORIES(copy-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(copy-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph)
-- ADD_TEST(NAME copy-test COMMAND copy-test)
--
-- ADD_EXECUTABLE(deconvolution-2d-test test/deconvolution-2d.cc)
-- SET_TARGET_PROPERTIES(deconvolution-2d-test PROPERTIES CXX_EXTENSIONS YES)
-- TARGET_INCLUDE_DIRECTORIES(deconvolution-2d-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(deconvolution-2d-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph convolution-test-helpers)
-- ADD_TEST(NAME deconvolution-2d-test COMMAND deconvolution-2d-test)
--
-- ADD_EXECUTABLE(depth-to-space-test test/depth-to-space.cc)
-- TARGET_INCLUDE_DIRECTORIES(depth-to-space-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(depth-to-space-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph)
-- ADD_TEST(NAME depth-to-space-test COMMAND depth-to-space-test)
--
-- ADD_EXECUTABLE(depthwise-convolution-2d-test test/depthwise-convolution-2d.cc)
-- SET_TARGET_PROPERTIES(depthwise-convolution-2d-test PROPERTIES CXX_EXTENSIONS YES)
-- TARGET_INCLUDE_DIRECTORIES(depthwise-convolution-2d-test PRIVATE src test)
-- TARGET_LINK_LIBRARIES(depthwise-convolution-2d-test PRIVATE XNNPACK fp16 gtest gtest_main subgraph convolution-test-helpers)
-- ADD_TEST(NAME depthwise-convolution-2d-test COMMAND depth
This message was truncated. Download the full message here.
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 11/24] gnu: Add xnnpack-for-r-torch.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-11-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (xnnpack-for-r-torch): New variable.
(xnnpack)[inputs]: Use xnnpack-for-r-torch instead of xnnpack.
---
gnu/packages/machine-learning.scm | 71 ++++++++++++++++++++++++++++++-
1 file changed, 70 insertions(+), 1 deletion(-)

Toggle diff (91 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 6fcfc1d167..71683c4df6 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4251,6 +4251,74 @@ (define target-deps "")
"i686-linux" "x86_64-linux"))
(license license:bsd-3))))
+(define-public xnnpack-for-r-torch
+ (let ((version "0.0")
+ (commit "51a987591a6fc9f0fc0707077f53d763ac132cbf")
+ (revision "2"))
+ (package
+ (inherit xnnpack)
+ (version (git-version version revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference (url (package-home-page xnnpack)) (commit commit)))
+ (file-name (git-file-name (package-name xnnpack) version))
+ (sha256
+ (base32
+ "1rzby82xq8d0rl1d148yz88jh9cpsw5c8b2yw7yg39mi7qmr55rm"))
+ (modules '((guix build utils)
+ (ice-9 ftw)
+ (ice-9 textual-ports)
+ (srfi srfi-26)))
+ (snippet
+ '(begin
+ ;; Remove autogenerated files
+ (for-each
+ (lambda (dir)
+ (let ((gendir (string-append "src/" dir "/gen")))
+ (when (file-exists? gendir)
+ (delete-file-recursively gendir)
+ ;; Needed for the scripts generating the files
+ (mkdir gendir))))
+ (scandir "src" (negate (cut member <> '("." "..")))))
+ (delete-file-recursively "google3")
+ (delete-file "cmake/microkernels.cmake")
+ ;; Additional autogenerated files which contain the string
+ ;; "Auto-generated file"
+ (for-each
+ (lambda (dir)
+ (for-each
+ (lambda (name)
+ (let ((path (string-append dir "/" name)))
+ (when (call-with-input-file path
+ (lambda (port)
+ (string-contains
+ (get-string-all port)
+ "Auto-generated file")))
+ (delete-file path))))
+ (scandir dir (negate (cut member <> '("." ".."))))))
+ '("test" "bench" "eval" "models" "src/enums" "src/xnnpack"))))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments xnnpack)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (replace 'generate-files
+ (lambda _
+ (for-each
+ (lambda (name)
+ (when (and (string-prefix? "generate" name)
+ (string-suffix? ".sh" name)
+ (not (equal? "generate-amalgamation.sh" name)))
+ (display (string-append name "\n"))
+ (invoke "bash" (string-append "scripts/" name))))
+ (scandir "scripts"))
+ ;; These need to run after the above scripts
+ (display "Remaining files\n")
+ (invoke "python3" "tools/update-microkernels.py")
+ (substitute* "tools/amalgamate-microkernels.py"
+ (("BUILD") "BUILD.bazel"))
+ (invoke "bash" "scripts/generate-amalgamation.sh"))))))))))
+
;; Warning: This package requires AVX2 or AVX-512 instructions.
(define-public fbgemm
(package
@@ -4851,7 +4919,8 @@ (define-public python-pytorch-for-r-torch
(inputs
(modify-inputs (package-inputs python-pytorch)
(replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch)
- (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)))
+ (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)
+ (replace "xnnpack" xnnpack-for-r-torch)))
(propagated-inputs
(modify-inputs (package-propagated-inputs python-pytorch)
(append python-filelock
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 12/24] gnu: python-nbval: Update to 0.11.0.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-12-david.elsing@posteo.net
* gnu/packages/python-check.scm (python-nbval): Update to 0.11.0.
[arguments]<#:phases>: Adjust 'check' phase.
[native-inputs]: Remove python-pytest.
[propagated-inputs]: Add python-coverage and python-pytest. Remove
python-six.
---
gnu/packages/python-check.scm | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)

Toggle diff (53 lines)
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 74e833686f..6b42d3c45c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -1585,13 +1585,13 @@ (define-public python-nbmake
(define-public python-nbval
(package
(name "python-nbval")
- (version "0.9.6")
+ (version "0.11.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "nbval" version))
(sha256
- (base32 "0h3xrnw0mj1srigrx2rfnd73h8s0xjycclmjs0vx7qkfyqpcvvyg"))))
+ (base32 "154h6xpf9h6spgg3ax6k79fd40j197ipwnfjmf5rc2kvc2bmgjbp"))))
(build-system python-build-system)
(arguments
`(#:phases
@@ -1605,21 +1605,16 @@ (define-public python-nbval
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
- (invoke "pytest" "-vv" "-k"
- (string-append
- ;; This only works with Pytest < 5.
- "not nbdime_reporter"
- ;; https://github.com/computationalmodelling/nbval/pull/148.
- " and not test_timeouts"
- ;; It seems the output format has changed; the following
- ;; test fails with "Unexpected output fields from
- ;; running code: {'text/plain'}".
- " and not test_conf_ignore_stderr "))))))))
- (native-inputs
- (list python-pytest python-pytest-cov python-sympy))
+ (invoke "pytest" "-vv"
+ ;; nbdime forms a dependency cycle
+ "--ignore=tests/test_nbdime_reporter.py")))))))
+ (native-inputs (list python-pytest-cov python-sympy))
(propagated-inputs
- (list python-ipykernel python-jupyter-client python-nbformat
- python-six))
+ (list python-coverage
+ python-ipykernel
+ python-jupyter-client
+ python-nbformat
+ python-pytest))
(home-page "https://github.com/computationalmodelling/nbval")
(synopsis "Pytest plugin to validate Jupyter notebooks")
(description
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 13/24] gnu: Add python-parameterized-next.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-13-david.elsing@posteo.net
* gnu/packages/check.scm (python-parameterized-next): New variable.
---
gnu/packages/check.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 21a975f340..9d8772fd4d 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -1222,6 +1222,28 @@ (define-public python-parameterized
for every Python test framework. It supports nose, py.test, and unittest.")
(license license:bsd-2)))
+(define-public python-parameterized-next
+ (package
+ (inherit python-parameterized)
+ (version "0.9.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "parameterized" version))
+ (sha256
+ (base32 "1c89vc40zj5aj2zvbvw875wqpyf0x6xrqhm3q5jg797g5hkhbjbz"))))
+ (build-system pyproject-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (substitute* "parameterized/test.py"
+ (("import mock") "from unittest import mock"))
+ (invoke "python3" "-m" "unittest")))))))
+ (native-inputs (list python-jinja2))))
+
(define-public python-minimock
(package
(name "python-minimock")
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 15/24] gnu: Remove onnx-for-torch2.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-15-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (onnx-for-torch2): Delete variable.
---
gnu/packages/machine-learning.scm | 29 -----------------------------
1 file changed, 29 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index b9a128dd1b..b1b11b5410 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1417,35 +1417,6 @@ (define args
operators and standard data types.")
(license license:expat)))
-(define-public onnx-for-torch2
- (package
- (inherit onnx)
- (name "onnx")
- (version "1.13.1")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/onnx/onnx")
- (commit (string-append "v" version))))
- (sha256
- (base32
- "16967dbq2j40diqd0s37r19llsab8q8vbxkg1ppgy0p9fpdhfhyp"))
- (file-name (git-file-name name version))
- (patches (search-patches "onnx-1.13.1-use-system-googletest.patch"
- "onnx-shared-libraries.patch"))
- (modules '((guix build utils)))
- (snippet
- '(begin
- (delete-file-recursively "third_party")
- (substitute* "onnx/backend/test/runner/__init__.py"
- (("urlretrieve\\(.*") "raise unittest.SkipTest('Skipping download')\n"))))))
- (arguments
- ;; reuse build system tweaks
- (substitute-keyword-arguments (package-arguments onnx)
- ((#:phases phases)
- #~(modify-phases #$phases
- (delete 'relax-requirements)))))))
-
(define-public python-onnx
;; This used to be called "python-onnx" because it provided nothing but
;; Python bindings. The package now provides shared libraries and C++
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 07/24] gnu: nnpack: Depend on python-peachpy only for x86_64.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-7-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (nnpack)[native-inputs]: Provide
python-peachpy only when 'target-x86-64?'.
---
gnu/packages/machine-learning.scm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Toggle diff (17 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 418bfb5d03..99f0185942 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4045,7 +4045,9 @@ (define-public nnpack
pthreadpool
googletest))
(native-inputs
- (list python python-peachpy python-six))
+ `(,python
+ ,@(if (target-x86-64?) (list python-peachpy) '())
+ ,python-six))
;; Supported for Linux.
(supported-systems '("x86_64-linux" "armhf-linux" "aarch64-linux"))
(license license:bsd-2))))
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 14/24] gnu: Remove onnx-optimizer-for-torch2.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-14-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (onnx-optimizer-for-torch2): Delete variable.
---
gnu/packages/machine-learning.scm | 8 --------
1 file changed, 8 deletions(-)

Toggle diff (21 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 71683c4df6..b9a128dd1b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1496,14 +1496,6 @@ (define-public onnx-optimizer
with a single function call.")
(license license:expat)))
-(define-public onnx-optimizer-for-torch2
- (hidden-package
- (package
- (inherit onnx-optimizer)
- (inputs
- (modify-inputs (package-inputs onnx-optimizer)
- (replace "onnx" onnx-for-torch2))))))
-
(define-public rxcpp
(package
(name "rxcpp")
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 08/24] gnu: oneapi-dnnl: Update to 3.5.3.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-8-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (oneapi-dnnl): Update to 3.5.3.
---
gnu/packages/machine-learning.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 99f0185942..1de08eda66 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -5903,7 +5903,7 @@ (define-public python-brian2tools
(define-public oneapi-dnnl
(package
(name "oneapi-dnnl")
- (version "3.3.5")
+ (version "3.5.3")
(source
(origin
(method git-fetch)
@@ -5912,7 +5912,7 @@ (define-public oneapi-dnnl
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "05ra5zziys2hvn29y6ysiqzsf4jr9bf2bci5sc3swvf3bs2y5ihf"))))
+ (base32 "1m2d7qlbfk86rmvmpvx2k3rc2k0l9hf9qpa54jl44670ls9n8i7w"))))
(build-system cmake-build-system)
(arguments (if (target-riscv64?)
(list #:configure-flags #~'("-DDNNL_CPU_RUNTIME=SEQ"))
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 09/24] gnu: fbgemm: Update to 0.7.0.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-9-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (fbgemm): Update to 0.7.0.
---
gnu/packages/machine-learning.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 1de08eda66..5a909311e2 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4227,7 +4227,7 @@ (define-public xnnpack
(define-public fbgemm
(package
(name "fbgemm")
- (version "0.6.0")
+ (version "0.7.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -4236,7 +4236,7 @@ (define-public fbgemm
(file-name (git-file-name name version))
(sha256
(base32
- "0mw30v55aicqdbh3xwfj9p8f38nw70ks5cxiwpgwjsk0dylah9rf"))
+ "1dzw9w82ca0hss1lvshix6piwsd0k11lyq9pzm8yg8k7j56hmyig"))
(patches (search-patches "fbgemm-use-system-libraries.patch"))
(modules '((guix build utils)))
(snippet
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 19/24] gnu: cpp-httplib: Update to 0.16.0.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-19-david.elsing@posteo.net
* gnu/packages/cpp.scm (cpp-httplib): Update to 0.16.0.
---
gnu/packages/cpp.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 6b46465abf..2c80bd8ba5 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1086,7 +1086,7 @@ (define-public cpp-httplib
;; header
(package
(name "cpp-httplib")
- (version "0.12.5")
+ (version "0.16.0")
(source
(origin
(method git-fetch)
@@ -1094,7 +1094,7 @@ (define-public cpp-httplib
(url "https://github.com/yhirose/cpp-httplib")
(commit (string-append "v" version))))
(sha256
- (base32 "1m1p6h1dsxg4kg5zziffb6xl8zgjbkw7gmgmmlnrhpl3bswam87n"))
+ (base32 "0n4ribq7c6lqj0hn50pdvy7wml62fqbgrgysb038fq1qc6xyw3np"))
(file-name (git-file-name name version))))
(build-system cmake-build-system)
(arguments
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:16 +0200
[PATCH 22/24] gnu: python-lightning-utilities: Update to 0.11.6.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-22-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (python-lightning-utilities): Update to
0.11.6.
[source] Adjust URI.
[build-system]: Move to pyproject-build-system.
---
gnu/packages/machine-learning.scm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Toggle diff (25 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 006e31892c..85db721ebd 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -5040,14 +5040,14 @@ (define-public python-lightning-cloud
(define-public python-lightning-utilities
(package
(name "python-lightning-utilities")
- (version "0.8.0")
+ (version "0.11.6")
(source (origin
(method url-fetch)
- (uri (pypi-uri "lightning-utilities" version))
+ (uri (pypi-uri "lightning_utilities" version))
(sha256
(base32
- "084pn8fizxrcn1699jb8x2jsg4wcx01l65bwxpgnq0kzqp3rapcf"))))
- (build-system python-build-system)
+ "016zikn39apig3y6xyipw34w0w02c73z483radddbf68ivpjgz3r"))))
+ (build-system pyproject-build-system)
(propagated-inputs (list python-importlib-metadata python-packaging
python-typing-extensions))
(native-inputs (list python-coverage))
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:16 +0200
[PATCH 23/24] gnu: python-torchmetrics: Update to 1.4.1.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-23-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (python-torchmetrics): Update to 1.4.1.
[source]: Switch to GitHub repository.
[arguments]: New field.
[propagated-inputs]: Add python-lightning-utilities.
[home-page]: Update URL.
---
gnu/packages/machine-learning.scm | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)

Toggle diff (46 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 85db721ebd..5449e884d5 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -5281,17 +5281,25 @@ (define-public python-pytorch-lightning
(define-public python-torchmetrics
(package
(name "python-torchmetrics")
- (version "0.11.4")
+ (version "1.4.1")
(source (origin
- (method url-fetch)
- (uri (pypi-uri "torchmetrics" version))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Lightning-AI/torchmetrics")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
(sha256
(base32
- "150lcy6c20n42rwxl4d3m1b8s4js9ddds5wh3685vmjdnha5mr0z"))))
+ "0371kx2fpp46rlhzkafa7397kp1lirgykpzk9g12kxsqypb67v1l"))))
(build-system pyproject-build-system)
+ (arguments
+ (list
+ ;; Tests require many additional dependencies
+ #:tests? #f))
(propagated-inputs
(list python-numpy python-packaging python-pytorch
- python-typing-extensions))
+ python-typing-extensions
+ python-lightning-utilities))
(native-inputs
(list python-cloudpickle
python-coverage
@@ -5311,7 +5319,7 @@ (define-public python-torchmetrics
python-scipy
python-types-protobuf
python-types-setuptools))
- (home-page "https://github.com/Lightning-AI/metrics")
+ (home-page "https://github.com/Lightning-AI/torchmetrics")
(synopsis "Machine learning metrics for PyTorch applications")
(description "TorchMetrics is a collection of 100+ PyTorch metrics
implementations and an easy-to-use API to create custom metrics. It offers:
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 18/24] gnu: gloo: Update to commit 81925d1.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-18-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (gloo): Update to commit 81925d1.
[arguments]: Add -DCMAKE_CXX_STANDARD=17 to #:configure-flags.
[supported-systems]: New field.
---
gnu/packages/machine-learning.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index eb7315730a..b66071effc 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3888,8 +3888,8 @@ (define-public python-keras
(define-public gloo
(let ((version "0.0.0") ; no proper version tag
- (commit "c22a5cfba94edf8ea4f53a174d38aa0c629d070f")
- (revision "1"))
+ (commit "81925d1c674c34f0dc34dd9a0f2151c1b6f701eb")
+ (revision "2"))
(package
(name "gloo")
(version (git-version version revision commit))
@@ -3902,7 +3902,7 @@ (define-public gloo
(file-name (git-file-name name version))
(sha256
(base32
- "1crmqgybzkgkpbmcx16912gsl5qsj49swa0ikx6mhqgph0chrh11"))))
+ "16zs8ndbiv9nppn8bv6lfanzyyssz7g5pawxiqcnafwq3nvxpj9m"))))
(build-system cmake-build-system)
(native-inputs
(list googletest))
@@ -3914,6 +3914,7 @@ (define-public gloo
(arguments
(list #:configure-flags #~'("-DBUILD_SHARED_LIBS=ON"
"-DBUILD_TEST=1"
+ "-DCMAKE_CXX_STANDARD=17"
#$@(if (this-package-input "rdma-core")
#~("-DUSE_IBVERBS=ON")
#~()))
@@ -3929,6 +3930,7 @@ (define-public gloo
number of collective algorithms useful for machine learning applications.
These include a barrier, broadcast, and allreduce.")
(home-page "https://github.com/facebookincubator/gloo")
+ (supported-systems %64bit-supported-systems)
(license license:bsd-3))))
(define-public python-tensorly
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 17/24] gnu: onnx-optimizer: Update to 0.3.19.
(address . 72471@debbugs.gnu.org)
20240804221635.3805-17-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (onnx-optimizer): Update to 0.3.19.
* gnu/packages/patches/onnx-optimizer-system-library.patch: Adjust patch.

Co-authored-by: Andy Tai <atai@atai.org>
---
gnu/packages/machine-learning.scm | 47 +++++++++++----
.../onnx-optimizer-system-library.patch | 60 +++++++++----------
2 files changed, 66 insertions(+), 41 deletions(-)

Toggle diff (182 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index fff7a8c24a..eb7315730a 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1361,8 +1361,7 @@ (define-public onnx
(lambda* (#:key outputs tests? #:allow-other-keys)
;; For derived package use
(substitute* "CMakeLists.txt"
- (("set\\(ONNX_ROOT.*")
- (string-append "set(ONNX_ROOT "#$(package-source this-package) ")\n"))
+ (("set\\(ONNX_ROOT.*") "")
(("\\$\\{ROOT_DIR\\}(/tools.*)" _ rest)
(string-append "${PROJECT_SOURCE_DIR}" rest)))
;; Pass options to the CMake-based build process.
@@ -1382,14 +1381,15 @@ (define args
(string-append "-DONNX_BUILD_TESTS="
(if tests? "ON" "OFF"))
"-DBUILD_SHARED_LIBS=ON"
- "-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"))
+ "-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
+ (string-append
+ "-DONNX_ROOT=" #$(package-source this-package))))
;; This environment variable is honored by 'setup.py',
;; which passes it down to 'cmake'.
(setenv "CMAKE_ARGS" (string-join args))
- ;; This one is honored by 'setup.py' and passed to 'make
- ;; -j'.
+ ;; This one is honored by 'setup.py' and passed to 'make -j'.
(setenv "MAX_JOBS"
(number->string (parallel-job-count)))))
(add-before 'check 'make-test-directory-writable
@@ -1445,8 +1445,8 @@ (define-public python-onnx
(define-public onnx-optimizer
(package
(name "onnx-optimizer")
- ;; Note: 0.2.x is *more* recent than 1.5.0.
- (version "0.2.6")
+ ;; Note: 0.3.x is *more* recent than 1.5.0.
+ (version "0.3.19")
(home-page "https://github.com/onnx/optimizer")
(source (origin
(method git-fetch)
@@ -1455,7 +1455,7 @@ (define-public onnx-optimizer
(commit (string-append "v" version))))
(sha256
(base32
- "1wkqqdxcxpfbf8zpbdfdd3zz5jkw775g31gyykj11z4y6pp659l6"))
+ "1mx3hsl42na6fr05nh2x3j9kxm56cpfmwk6lwl2cfq9zs3gv929w"))
(file-name (git-file-name name version))
(patches (search-patches "onnx-optimizer-system-library.patch"))
(modules '((guix build utils)))
@@ -1466,10 +1466,35 @@ (define-public onnx-optimizer
(substitute-keyword-arguments (package-arguments onnx)
((#:phases phases)
#~(modify-phases #$phases
- (delete 'relax-requirements)))))
+ (add-after 'pass-cmake-arguments
+ 'pass-onnx-optimizer-cmake-arguments
+ (lambda _
+ (setenv
+ "CMAKE_ARGS"
+ (string-append
+ (getenv "CMAKE_ARGS")
+ " -DONNX_OPT_USE_SYSTEM_PROTOBUF=ON"
+ " -DCMAKE_CXX_FLAGS=\"-DONNX_ML=1 -DONNX_NAMESPACE=onnx\""))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (if tests?
+ (invoke "pytest" "-vv" "-k"
+ ;; These tests fail with upstream ONNX:
+ ;; https://github.com/onnx/optimizer/issues/138
+ (string-append
+ "not test_fuse_matmul"
+ " and not test_fuse_consecutive"
+ " and not test_fuse_transpose")))))))))
(native-inputs
- (list cmake python-pytest python-pytest-runner python-nbval
- python-coverage))
+ (append
+ (list cmake-minimal python-pytest python-pytest-runner
+ python-coverage)
+ (filter
+ (lambda (pkg)
+ (member (or (%current-target-system)
+ (%current-system))
+ (package-transitive-supported-systems pkg)))
+ (list python-nbval))))
(inputs
(list onnx protobuf pybind11))
(propagated-inputs
diff --git a/gnu/packages/patches/onnx-optimizer-system-library.patch b/gnu/packages/patches/onnx-optimizer-system-library.patch
index 5c592597e0..513623fe05 100644
--- a/gnu/packages/patches/onnx-optimizer-system-library.patch
+++ b/gnu/packages/patches/onnx-optimizer-system-library.patch
@@ -1,53 +1,53 @@
-Arrange so that onnx-optimizer (1) uses our own ONNX build,
-(2) builds as a shared library, and (3) links against the shared
-libraries of ONNX.
+Arrange so that onnx-optimizer uses our own ONNX build, and links against the
+shared libraries of ONNX.
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c2e48b35..8af51076 100644
+index 00633856..76a73853 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -9,8 +9,6 @@ endif(NOT MSVC)
+@@ -27,8 +27,6 @@ if(NOT ONNX_OPT_USE_SYSTEM_PROTOBUF)
+ endif()
- set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-set(ONNX_ROOT ${PROJECT_SOURCE_DIR}/third_party/onnx)
--add_subdirectory(${ONNX_ROOT})
+-add_subdirectory_if_no_target(${ONNX_ROOT} ${ONNX_TARGET_NAME})
file(READ "${PROJECT_SOURCE_DIR}/VERSION_NUMBER" ONNX_OPTIMIZER_VERSION)
string(STRIP "${ONNX_OPTIMIZER_VERSION}" ONNX_OPTIMIZER_VERSION)
-@@ -21,14 +19,18 @@ file(GLOB_RECURSE onnx_opt_srcs "onnxoptimizer/*.cc"
+@@ -41,14 +39,14 @@ file(GLOB onnx_opt_srcs "onnxoptimizer/*.cc"
list(REMOVE_ITEM onnx_opt_srcs "${PROJECT_SOURCE_DIR}/onnxoptimizer/cpp2py_export.cc")
- add_library(onnx_optimizer ${onnx_opt_srcs})
--target_link_libraries(onnx_optimizer PUBLIC onnx)
-+target_link_libraries(onnx_optimizer PUBLIC onnx onnx_proto)
+ onnxopt_add_library(onnx_optimizer ${onnx_opt_srcs})
+-target_link_libraries(onnx_optimizer PUBLIC ${ONNX_TARGET_NAME})
++target_link_libraries(onnx_optimizer PUBLIC ${ONNX_TARGET_NAME} onnx_proto)
target_include_directories(onnx_optimizer PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
-+# These cpp macros must be defined so the ONNX headers behave
-+# correctly.
-+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DONNX_ML=1 -DONNX_NAMESPACE=onnx")
-+
- add_executable(onnx_optimizer_exec examples/onnx_optimizer_exec.cpp)
+ onnxopt_add_executable(onnx_optimizer_exec examples/onnx_optimizer_exec.cpp)
-target_link_libraries(onnx_optimizer_exec onnx_optimizer)
-+target_link_libraries(onnx_optimizer_exec onnx_optimizer protobuf)
-
- if(BUILD_ONNX_PYTHON)
- if("${PY_EXT_SUFFIX}" STREQUAL "")
-@@ -79,11 +81,10 @@ if(BUILD_ONNX_PYTHON)
- PRIVATE $<TARGET_OBJECTS:onnx_optimizer>)
- else()
- # Assume everything else is like gcc
-- target_link_libraries(onnx_opt_cpp2py_export
-- PRIVATE "-Wl,--whole-archive" $<TARGET_FILE:onnx_optimizer>
-- "-Wl,--no-whole-archive")
-+ target_link_libraries(onnx_opt_cpp2py_export PRIVATE onnx_optimizer)
++target_link_libraries(onnx_optimizer_exec onnx_optimizer onnx_proto)
+
+
+ file(GLOB onnx_opt_c_api_srcs "onnxoptimizer/c_api/*.cc"
+@@ -116,7 +114,8 @@ if(BUILD_ONNX_PYTHON)
+ PRIVATE "-Wl,--whole-archive" $<TARGET_FILE:onnx_optimizer>
+ "-Wl,--no-whole-archive")
set_target_properties(onnx_opt_cpp2py_export
- PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
-+ PROPERTIES LINK_FLAGS
-+ "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib")
++ PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL,-rpath=${CMAKE_INSTALL_PREFIX}/lib")
++
endif()
target_link_libraries(onnx_opt_cpp2py_export PRIVATE onnx_optimizer)
+diff --git a/cmake/utils.cmake b/cmake/utils.cmake
+index 6cca9f36..8e39d5c4 100644
+--- a/cmake/utils.cmake
++++ b/cmake/utils.cmake
+@@ -1,4 +1,4 @@
+-include(${PROJECT_SOURCE_DIR}/third_party/onnx/cmake/Utils.cmake)
++include(${ONNX_ROOT}/cmake/Utils.cmake)
+
+ # Poor man's FetchContent
+ function(add_subdirectory_if_no_target dir target)
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 21/24] gnu: python-torchvision: Update to 0.19.0.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-21-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (python-torchvision): Update to 0.19.0.
[arguments]: Add 'setenv' phase for finding libjpeg-turbo.
[inputs]: Add ffmpeg.
---
gnu/packages/machine-learning.scm | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)

Toggle diff (49 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 822881f15a..006e31892c 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -5330,7 +5330,7 @@ (define-public python-torchmetrics
(define-public python-torchvision
(package
(name "python-torchvision")
- (version "0.17.1")
+ (version "0.19.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -5340,7 +5340,7 @@ (define-public python-torchvision
(file-name (git-file-name name version))
(sha256
(base32
- "094jz0ryzh0yjxf687r61r482fdh3bax8ix2csghraps0z1sns1b"))
+ "15zyq2k4x9yapx7qfghhslznz1mwybhf086pirsr98c4l891sp1r"))
(modules '((guix build utils)))
(snippet
'(begin
@@ -5348,10 +5348,21 @@ (define-public python-torchvision
(delete-file-recursively "ios")))))
(build-system pyproject-build-system)
(arguments
- (list #:tests? #false)) ;the test suite is expensive and there is no easy
- ;way to subset it.
+ (list
+ ;; The test suite is expensive and there is no easy way to subset it.
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'setenv
+ (lambda _
+ (let ((jpegdir #$(this-package-input "libjpeg-turbo")))
+ (setenv "TORCHVISION_INCLUDE"
+ (string-append jpegdir "/include/"))
+ (setenv "TORCHVISION_LIBRARY"
+ (string-append jpegdir "/lib/"))))))))
(inputs
- (list libpng
+ (list ffmpeg
+ libpng
libjpeg-turbo))
(propagated-inputs
(list python-numpy
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 16/24] gnu: onnx: Update to 1.16.2.
(address . 72471@debbugs.gnu.org)
20240804221635.3805-16-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (onnx): Update to 1.16.2.
[source]: Remove patch.
[build-system]: Move to pyproject-build-system.
[arguments]<#:tests?>: Disable for systems where python-nbval is not
supported.
<#:phases>: Remove 'relax-requirements' phase. Pass "-DONNX_BUILD_TESTS" to
CMake depending on tests?.
[native-inputs]: Add python-fb-re2 and python-parameterized-next. Remove
python-nbval on unsupported systems.
* gnu/packages/patches/onnx-shared-libraries.patch: Adjust patch.
* gnu/packages/patches/onnx-skip-model-downloads.patch: Adjust patch.
* gnu/packages/patches/onnx-use-system-googletest.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove it.

Co-authored-by: Andy Tai <atai@atai.org>
---
gnu/local.mk | 1 -
gnu/packages/machine-learning.scm | 139 ++++++++++--------
.../patches/onnx-shared-libraries.patch | 18 ++-
.../patches/onnx-skip-model-downloads.patch | 16 +-
.../patches/onnx-use-system-googletest.patch | 57 -------
5 files changed, 97 insertions(+), 134 deletions(-)
delete mode 100644 gnu/packages/patches/onnx-use-system-googletest.patch

Toggle diff (314 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index fd8262de55..61fb2f4816 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1792,7 +1792,6 @@ dist_patch_DATA = \
%D%/packages/patches/onionshare-cli-async-mode.patch \
%D%/packages/patches/online-judge-tools.patch \
%D%/packages/patches/onnx-optimizer-system-library.patch \
- %D%/packages/patches/onnx-use-system-googletest.patch \
%D%/packages/patches/onnx-1.13.1-use-system-googletest.patch \
%D%/packages/patches/onnx-shared-libraries.patch \
%D%/packages/patches/onnx-skip-model-downloads.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index b1b11b5410..fff7a8c24a 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -28,6 +28,7 @@
;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
;;; Copyright © 2024 Spencer King <spencer.king@geneoscopy.com>
;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
+;;; Copyright © 2024 Andy Tai <atai@atai.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1331,7 +1332,7 @@ (define (delete-ifdefs file)
(define-public onnx
(package
(name "onnx")
- (version "1.12.0")
+ (version "1.16.2")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -1339,70 +1340,88 @@ (define-public onnx
(commit (string-append "v" version))))
(sha256
(base32
- "1g9f1hviksbn7gi6fnd0dsm7nf0w3yia0mjj33d9mggklrl0db6x"))
+ "0f5h204ksfz4ir3qq38ckxja1jfhf1vn5xzwrj83vkkbfjq6fv16"))
(file-name (git-file-name name version))
- (patches (search-patches "onnx-use-system-googletest.patch"
- "onnx-shared-libraries.patch"
- "onnx-skip-model-downloads.patch"))
+ (patches (search-patches
+ "onnx-shared-libraries.patch"
+ "onnx-skip-model-downloads.patch"))
(modules '((guix build utils)))
(snippet '(delete-file-recursively "third_party"))))
- (build-system python-build-system)
+ (build-system pyproject-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
- (add-after 'unpack 'relax-requirements
- (lambda _
- ;; Does this difference really matter?
- (substitute* "requirements.txt"
- (("3.20.1") "3.20.2"))))
- (add-before 'build 'pass-cmake-arguments
- (lambda* (#:key outputs #:allow-other-keys)
- ;; Pass options to the CMake-based build process.
- (define out
- (assoc-ref outputs "out"))
-
- (define args
- ;; Copy arguments from 'cmake-build-system', plus ask
- ;; for shared libraries.
- (list "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
- (string-append "-DCMAKE_INSTALL_PREFIX=" out)
- "-DCMAKE_INSTALL_LIBDIR=lib"
- "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
- (string-append "-DCMAKE_INSTALL_RPATH=" out
- "/lib")
- "-DCMAKE_VERBOSE_MAKEFILE=ON"
-
- "-DBUILD_SHARED_LIBS=ON"))
-
- ;; This environment variable is honored by 'setup.py',
- ;; which passes it down to 'cmake'.
- (setenv "CMAKE_ARGS" (string-join args))
-
- ;; This one is honored by 'setup.py' and passed to 'make
- ;; -j'.
- (setenv "MAX_JOBS"
- (number->string (parallel-job-count)))))
- (add-before 'check 'make-test-directory-writable
- (lambda _
- ;; Make things writable for tests.
- (setenv "HOME" (getcwd))
- (for-each make-file-writable
- (find-files "onnx/examples" "."
- #:directories? #t))))
- (add-after 'install 'install-from-cmake
- (lambda _
- ;; Run "make install" in the build tree 'setup.py'
- ;; created for CMake so that libonnx.so,
- ;; libonnx_proto.so, etc. are installed.
- (invoke "make" "install"
- "-C" ".setuptools-cmake-build"))))))
+ (list
+ ;; python-nbval depends transitively on Rust.
+ #:tests?
+ (->bool (member (or (%current-target-system)
+ (%current-system))
+ (package-transitive-supported-systems python-nbval)))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'build 'pass-cmake-arguments
+ (lambda* (#:key outputs tests? #:allow-other-keys)
+ ;; For derived package use
+ (substitute* "CMakeLists.txt"
+ (("set\\(ONNX_ROOT.*")
+ (string-append "set(ONNX_ROOT "#$(package-source this-package) ")\n"))
+ (("\\$\\{ROOT_DIR\\}(/tools.*)" _ rest)
+ (string-append "${PROJECT_SOURCE_DIR}" rest)))
+ ;; Pass options to the CMake-based build process.
+ (define out
+ (assoc-ref outputs "out"))
+
+ (define args
+ ;; Copy arguments from 'cmake-build-system', plus ask
+ ;; for shared libraries.
+ (list "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
+ (string-append "-DCMAKE_INSTALL_PREFIX=" out)
+ "-DCMAKE_INSTALL_LIBDIR=lib"
+ "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
+ (string-append "-DCMAKE_INSTALL_RPATH=" out
+ "/lib")
+ "-DCMAKE_VERBOSE_MAKEFILE=ON"
+ (string-append "-DONNX_BUILD_TESTS="
+ (if tests? "ON" "OFF"))
+ "-DBUILD_SHARED_LIBS=ON"
+ "-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"))
+
+ ;; This environment variable is honored by 'setup.py',
+ ;; which passes it down to 'cmake'.
+ (setenv "CMAKE_ARGS" (string-join args))
+
+ ;; This one is honored by 'setup.py' and passed to 'make
+ ;; -j'.
+ (setenv "MAX_JOBS"
+ (number->string (parallel-job-count)))))
+ (add-before 'check 'make-test-directory-writable
+ (lambda _
+ ;; Make things writable for tests.
+ (setenv "HOME" (getcwd))
+ (for-each make-file-writable
+ (find-files "onnx/examples" "."
+ #:directories? #t))))
+ (add-after 'install 'install-from-cmake
+ (lambda _
+ ;; Run "make install" in the build tree 'setup.py'
+ ;; created for CMake so that libonnx.so,
+ ;; libonnx_proto.so, etc. are installed.
+ (invoke "make" "install"
+ "-C" ".setuptools-cmake-build"))))))
(native-inputs
- (list cmake
- googletest
- pybind11
- python-coverage
- python-nbval
- python-pytest
- python-pytest-runner))
+ (append
+ (list cmake-minimal
+ googletest
+ pybind11
+ python-coverage
+ python-fb-re2
+ python-parameterized-next
+ python-pytest
+ python-pytest-runner)
+ (filter
+ (lambda (pkg)
+ (member (or (%current-target-system)
+ (%current-system))
+ (package-transitive-supported-systems pkg)))
+ (list python-nbval))))
(inputs
(list protobuf))
(propagated-inputs
diff --git a/gnu/packages/patches/onnx-shared-libraries.patch b/gnu/packages/patches/onnx-shared-libraries.patch
index 00583b35da..5a3fd658d0 100644
--- a/gnu/packages/patches/onnx-shared-libraries.patch
+++ b/gnu/packages/patches/onnx-shared-libraries.patch
@@ -1,13 +1,12 @@
-These linker options for the 'onnx_cpp2py_export.cpython-38-*-gnu.so'
-(or similar) extension are meant to be used when building 'libonn.a',
-a static archive. This patch adapts the link flags to linking with
-'libonnx.so'.
+These linker options for the 'onnx_cpp2py_export.cpython-310-*-gnu.so' (or
+similar) extension are meant to be used when building 'libonn.a', a static
+archive. This patch adapts the link flags to linking with 'libonnx.so'.
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index cede3073..52f846ed 100644
+index b666eec4..1525b219 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -475,11 +475,10 @@ if(BUILD_ONNX_PYTHON)
+@@ -585,16 +585,15 @@ if(BUILD_ONNX_PYTHON)
PRIVATE $<TARGET_OBJECTS:onnx>)
else()
# Assume everything else is like gcc
@@ -15,10 +14,15 @@ index cede3073..52f846ed 100644
- PRIVATE "-Wl,--whole-archive" $<TARGET_FILE:onnx>
- "-Wl,--no-whole-archive")
+ target_link_libraries(onnx_cpp2py_export PRIVATE onnx)
+ # Prevent "undefined symbol: _ZNSt10filesystem7__cxx114path14_M_split_cmptsEv"
+ # (std::filesystem::__cxx11::path::_M_split_cmpts()) on gcc 8
+ if (CMAKE_CXX_STANDARD EQUAL 17 AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+ target_link_libraries(onnx_cpp2py_export PRIVATE "-lstdc++fs")
+ endif()
set_target_properties(onnx_cpp2py_export
- PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
+ PROPERTIES LINK_FLAGS
-+ "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib")
++ "-Wl,-rpath=${CMAKE_INSTALL_PREFIX}/lib")
endif()
target_link_libraries(onnx_cpp2py_export PRIVATE onnx)
diff --git a/gnu/packages/patches/onnx-skip-model-downloads.patch b/gnu/packages/patches/onnx-skip-model-downloads.patch
index 4ab55b4ceb..55925a3ebf 100644
--- a/gnu/packages/patches/onnx-skip-model-downloads.patch
+++ b/gnu/packages/patches/onnx-skip-model-downloads.patch
@@ -1,16 +1,14 @@
-A few tests require downloading models from URLs such as
- <https://s3.amazonaws.com/download.onnx/models/opset_9/zfnet512.tar.gz>.
-Skip those.
+A few tests require downloading models. Skip those.
diff --git a/onnx/backend/test/runner/__init__.py b/onnx/backend/test/runner/__init__.py
-index 049ed57b..f236f1bf 100644
+index 5b60e7c0..838c7ba5 100644
--- a/onnx/backend/test/runner/__init__.py
+++ b/onnx/backend/test/runner/__init__.py
-@@ -202,6 +202,7 @@ class Runner(object):
- print('Start downloading model {} from {}'.format(
- model_test.model_name,
- model_test.url))
+@@ -236,6 +236,7 @@ class Runner:
+ print(
+ f"Start downloading model {model_test.model_name} from {model_test.url}"
+ )
+ raise unittest.SkipTest('Skipping download')
urlretrieve(model_test.url, download_file.name)
- print('Done')
+ print("Done")
with tarfile.open(download_file.name) as t:
diff --git a/gnu/packages/patches/onnx-use-system-googletest.patch b/gnu/packages/patches/onnx-use-system-googletest.patch
deleted file mode 100644
index 5dfcbc6dc3..0000000000
--- a/gnu/packages/patches/onnx-use-system-googletest.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-ONNX will build googletest from a Git checkout. Patch CMake to use our
-googletest package and enable tests by default.
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0aa9fda2..a573170c 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -22,7 +22,7 @@ option(BUILD_ONNX_PYTHON "Build Python binaries" OFF)
- option(ONNX_GEN_PB_TYPE_STUBS "Generate protobuf python type stubs" ON)
- option(ONNX_WERROR "Build with Werror" OFF)
- option(ONNX_COVERAGE "Build with coverage instrumentation" OFF)
--option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" OFF)
-+option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" ON)
- option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF)
- option(ONNXIFI_ENABLE_EXT "Enable onnxifi extensions." OFF)
- if(NOT DEFINED ONNX_ML)
-@@ -82,8 +82,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
- endif()
-
- if(ONNX_BUILD_TESTS)
-- list(APPEND CMAKE_MODULE_PATH ${ONNX_ROOT}/cmake/external)
-- include(googletest)
-+ find_package(GTest REQUIRED)
-+ if(NOT GTest_FOUND)
-+ message(FATAL_ERROR "cannot find googletest")
-+ endif()
- endif()
-
- if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
-diff --git a/cmake/unittest.cmake b/cmake/unittest.cmake
-index e29a93ff..ae146390 100644
---- a/cmake/unittest.cmake
-+++ b/cmake/unittest.cmake
-@@ -6,8 +6,8 @@ include(${ONNX_ROOT}/cmake/Utils.cmake)
-
- find_package(Threads)
-
--set(${UT_NAME}_libs ${googletest_STATIC_LIBRARIES})
--set(${ONNXIFI_TEST_DRIVER}_libs ${googletest_STATIC_LIBRARIES})
-+set(${UT_NAME}_libs ${GTEST_LIBRARIES})
-+set(${ONNXIFI_TEST_DRIVER}_libs ${GTEST_LIBRARIES})
-
- list(APPEND ${UT_NAME}_libs onnx)
- list(APPEND ${UT_NAME}_libs onnx_proto)
-@@ -31,10 +31,10 @@ function(AddTest)
- list(REMOVE_DUPLICATES _UT_SOURCES)
-
- add_executable(${_UT_TARGET} ${_UT_SOURCES})
-- add_dependencies(${_UT_TARGET} onnx onnx_proto googletest)
-+ add_dependencies(${_UT_TARGET} onnx onnx_proto)
-
- target_include_directories(${_UT_TARGET}
-- PUBLIC ${googletest_INCLUDE_DIRS}
-+ PUBLIC ${GTEST_INCLUDE_DIRS}
- ${ONNX_INCLUDE_DIRS}
- ${PROTOBUF_INCLUDE_DIRS}
- ${ONNX_ROOT}
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:16 +0200
[PATCH 24/24] gnu: python-pytorch-lightning: Update to commit 2064887.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-24-david.elsing@posteo.net
* gnu/packages/machine-learning.scm (python-pytorch-lightning): Update to
commit 2064887.
[source]: Update URL.
[arguments]<#:tests-flags>: Skip additional failing tests.
<#:phases>: Adjust 'patch-version-detection' phase.
---
gnu/packages/machine-learning.scm | 249 ++++++++++++++++--------------
1 file changed, 130 insertions(+), 119 deletions(-)

Toggle diff (263 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 5449e884d5..73bb520ffc 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -5157,126 +5157,137 @@ (define-public python-inquirer
(license license:expat)))
(define-public python-pytorch-lightning
- (package
- (name "python-pytorch-lightning")
- (version "2.0.2")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/Lightning-AI/lightning")
- (commit version)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "1w4lajiql4y5nnhqf6i5wii1mrwnhp5f4bzbwdzb5zz0d0lysb1i"))))
- (build-system pyproject-build-system)
- (arguments
- (list
- #:test-flags
- '(list "-m" "not cloud and not tpu" "tests/tests_pytorch"
- ;; we don't have onnxruntime
- "--ignore=tests/tests_pytorch/models/test_onnx.py"
-
- ;; We don't have tensorboard, so we skip all those tests that
- ;; require it for logging.
- "--ignore=tests/tests_pytorch/checkpointing/test_model_checkpoint.py"
- "--ignore=tests/tests_pytorch/loggers/test_all.py"
- "--ignore=tests/tests_pytorch/loggers/test_logger.py"
- "--ignore=tests/tests_pytorch/loggers/test_tensorboard.py"
- "--ignore=tests/tests_pytorch/models/test_cpu.py"
- "--ignore=tests/tests_pytorch/models/test_hparams.py"
- "--ignore=tests/tests_pytorch/models/test_restore.py"
- "--ignore=tests/tests_pytorch/profilers/test_profiler.py"
- "--ignore=tests/tests_pytorch/trainer/flags/test_fast_dev_run.py"
- "--ignore=tests/tests_pytorch/trainer/logging_/test_eval_loop_logging.py"
- "--ignore=tests/tests_pytorch/trainer/logging_/test_train_loop_logging.py"
- "--ignore=tests/tests_pytorch/trainer/properties/test_loggers.py"
- "--ignore=tests/tests_pytorch/trainer/properties/test_log_dir.py"
- "--ignore=tests/tests_pytorch/trainer/test_trainer.py"
-
- ;; This needs internet access
- "--ignore=tests/tests_pytorch/helpers/test_models.py"
- "--ignore=tests/tests_pytorch/helpers/test_datasets.py"
- "--ignore=tests/tests_pytorch/helpers/datasets.py"
-
- ;; We have no legacy checkpoints
- "--ignore=tests/tests_pytorch/checkpointing/test_legacy_checkpoints.py"
-
- ;; TypeError: _FlakyPlugin._make_test_flaky() got an unexpected keyword argument 'reruns'
- "--ignore=tests/tests_pytorch/models/test_amp.py"
- "--ignore=tests/tests_pytorch/profilers/test_profiler.py"
-
- "--ignore=tests/tests_pytorch/graveyard/test_legacy_import_unpickler.py"
-
- "-k"
- (string-append
- ;; We don't have tensorboard
- "not test_property_logger"
- " and not test_cli_logger_shorthand"
- ;; Something wrong with Flaky
- " and not test_servable_module_validator_with_trainer"))
- #:phases
- '(modify-phases %standard-phases
- (add-after 'unpack 'patch-version-detection
- (lambda _
- ;; We do have pytorch 1.13.1, but the version comparison fails.
- (substitute* "src/lightning/fabric/utilities/imports.py"
- (("_TORCH_GREATER_EQUAL_1_13 =.*")
- "_TORCH_GREATER_EQUAL_1_13 = True\n"))))
- (add-before 'build 'pre-build
- (lambda _ (setenv "PACKAGE_NAME" "lightning")))
- (add-after 'install 'pre-build-pytorch
- (lambda _
- ;; pyproject-build-system only tolerates unicycles.
- (for-each delete-file (find-files "dist" "\\.whl"))
- (setenv "PACKAGE_NAME" "pytorch")))
- (add-after 'pre-build-pytorch 'build-pytorch
- (assoc-ref %standard-phases 'build))
- (add-after 'build-pytorch 'install-pytorch
- (assoc-ref %standard-phases 'install))
- (add-before 'check 'pre-check
- (lambda _
- ;; We don't have Tensorboard
- (substitute* "tests/tests_pytorch/test_cli.py"
- ((" TensorBoardLogger\\(\".\"\\)") "")))))))
- (propagated-inputs
- (list python-arrow
- python-beautifulsoup4
- python-croniter
- python-dateutils
- python-deepdiff
- python-fastapi-for-pytorch-lightning
- python-fsspec
- python-inquirer
- python-jsonargparse
- python-lightning-cloud
- python-lightning-utilities
- python-numpy
- python-packaging
- python-pytorch
- python-pyyaml
- python-starsessions-for-pytorch-lightning
- python-torchmetrics
- python-torchvision
- python-tqdm
- python-traitlets
- python-typing-extensions))
- (native-inputs
- (list python-aiohttp
- python-cloudpickle
- python-coverage
- python-flaky
- python-pympler
- python-pytest
- python-psutil
- python-requests-mock
- python-scikit-learn))
- (home-page "https://lightning.ai/")
- (synopsis "Deep learning framework to train, deploy, and ship AI products")
- (description
- "PyTorch Lightning is just organized PyTorch; Lightning disentangles
+ (let ((commit "2064887b12dd934a5f9a2bf45897f29e3bfc74d1")
+ (revision "0"))
+ (package
+ (name "python-pytorch-lightning")
+ (version (git-version "2.3.3" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Lightning-AI/pytorch-lightning")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1pfmwgzh21i21i4ixank488615q7j8nkvlxd82kmmam97gsd6krg"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags
+ '(list "-m" "not cloud and not tpu" "tests/tests_pytorch"
+ ;; we don't have onnxruntime
+ "--ignore=tests/tests_pytorch/models/test_onnx.py"
+
+ ;; We don't have tensorboard, so we skip all those tests that
+ ;; require it for logging.
+ "--ignore=tests/tests_pytorch/checkpointing/test_model_checkpoint.py"
+ "--ignore=tests/tests_pytorch/loggers/test_all.py"
+ "--ignore=tests/tests_pytorch/loggers/test_logger.py"
+ "--ignore=tests/tests_pytorch/loggers/test_tensorboard.py"
+ "--ignore=tests/tests_pytorch/loggers/test_wandb.py"
+ "--ignore=tests/tests_pytorch/models/test_cpu.py"
+ "--ignore=tests/tests_pytorch/models/test_hparams.py"
+ "--ignore=tests/tests_pytorch/models/test_restore.py"
+ "--ignore=tests/tests_pytorch/profilers/test_profiler.py"
+ "--ignore=tests/tests_pytorch/test_cli.py"
+ "--ignore=tests/tests_pytorch/trainer/flags/test_fast_dev_run.py"
+ "--ignore=tests/tests_pytorch/trainer/logging_/test_eval_loop_logging.py"
+ "--ignore=tests/tests_pytorch/trainer/logging_/test_train_loop_logging.py"
+ "--ignore=tests/tests_pytorch/trainer/properties/test_loggers.py"
+ "--ignore=tests/tests_pytorch/trainer/properties/test_log_dir.py"
+ "--ignore=tests/tests_pytorch/trainer/test_trainer.py"
+
+ ;; This needs internet access
+ "--ignore=tests/tests_pytorch/helpers/test_models.py"
+ "--ignore=tests/tests_pytorch/helpers/test_datasets.py"
+ "--ignore=tests/tests_pytorch/helpers/datasets.py"
+
+ ;; We have no legacy checkpoints
+ "--ignore=tests/tests_pytorch/checkpointing/test_legacy_checkpoints.py"
+
+ ;; TypeError: _FlakyPlugin._make_test_flaky() got an unexpected
+ ;; keyword argument 'reruns'
+ "--ignore=tests/tests_pytorch/models/test_amp.py"
+ "--ignore=tests/tests_pytorch/utilities/test_all_gather_grad.py"
+
+ ;; Requires CUDA
+ "--ignore=tests/tests_pytorch/plugins/precision/test_bitsandbytes.py"
+
+ "-k"
+ (string-append
+ ;; We don't have tensorboard
+ "not test_property_logger"
+ " and not test_cli_logger_shorthand"
+ ;; Wrong module appears in sys.modules
+ " and not test_patch_legacy_imports_unified"
+ ;; Missing log message
+ " and not test_should_stop_early_stopping_conditions_met"
+ " and not test_fit_loop_done_log_messages"
+ ;; Something wrong with Flaky
+ " and not test_servable_module_validator_with_trainer"))
+ #:phases
+ '(modify-phases %standard-phases
+ (add-after 'unpack 'patch-version-detection
+ (lambda _
+ ;; We do have pytorch 2.4.0, but the version comparison fails.
+ (substitute* "src/lightning/fabric/utilities/imports.py"
+ (("_TORCH_GREATER_EQUAL_2_4 =.*")
+ "_TORCH_GREATER_EQUAL_2_4 = True\n"))))
+ (add-before 'build 'pre-build
+ (lambda _ (setenv "PACKAGE_NAME" "lightning")))
+ (add-after 'install 'pre-build-pytorch
+ (lambda _
+ ;; pyproject-build-system only tolerates unicycles.
+ (for-each delete-file (find-files "dist" "\\.whl"))
+ (setenv "PACKAGE_NAME" "pytorch")))
+ (add-after 'pre-build-pytorch 'build-pytorch
+ (assoc-ref %standard-phases 'build))
+ (add-after 'build-pytorch 'install-pytorch
+ (assoc-ref %standard-phases 'install))
+ (add-before 'check 'pre-check
+ (lambda _
+ ;; We don't have Tensorboard
+ (substitute* "tests/tests_pytorch/test_cli.py"
+ ((" TensorBoardLogger\\(\".\"\\)") "")))))))
+ (propagated-inputs
+ (list python-arrow
+ python-beautifulsoup4
+ python-croniter
+ python-dateutils
+ python-deepdiff
+ python-fastapi-for-pytorch-lightning
+ python-fsspec
+ python-inquirer
+ python-jsonargparse
+ python-lightning-cloud
+ python-lightning-utilities
+ python-numpy
+ python-packaging
+ python-pytorch
+ python-pyyaml
+ python-starsessions-for-pytorch-lightning
+ python-torchmetrics
+ python-torchvision
+ python-tqdm
+ python-traitlets
+ python-typing-extensions))
+ (native-inputs
+ (list python-aiohttp
+ python-cloudpickle
+ python-coverage
+ python-flaky
+ python-pympler
+ python-pytest
+ python-psutil
+ python-requests-mock
+ python-scikit-learn))
+ (home-page "https://lightning.ai/")
+ (synopsis "Deep learning framework to train, deploy, and ship AI products")
+ (description
+ "PyTorch Lightning is just organized PyTorch; Lightning disentangles
PyTorch code to decouple the science from the engineering.")
- (license license:asl2.0)))
+ (license license:asl2.0))))
(define-public python-torchmetrics
(package
--
2.45.1
D
D
David Elsing wrote on 5 Aug 00:15 +0200
[PATCH 20/24] gnu: python-pytorch: Update to 2.4.0.
(address . 72471@debbugs.gnu.org)(name . David Elsing)(address . david.elsing@posteo.net)
20240804221635.3805-20-david.elsing@posteo.net
This also updates the qnnpack-pytorch package.

* gnu/packages/machine-learning.scm (%python-pytorch-version): Set to 2.4.0.
(%python-pytorch-src): Adjust hash accordingly.
[source]: Remove obsolete file deletions in snippet.
(python-pytorch)[arguments]<#:phases>: Disable telemetry and set Python
install directory. Remove obsolete USE_FFMPEG, USE_OPENCV and
USE_PYTORCH_QNNPACK environment variables.
[native-inputs]: Remove python-typing-extensions.
[inputs]: Add brotli, cpp-httplib and zlib. Remove qnnpack. Use oneapi-dnnl,
qnnpack-pytorch and xnnpack for all systems.
[propagated-inputs]: Add onnx and python-typing-extensions. Use cpuinfo for
all systems.
[supported-systems]: New field.
(python-pytorch-for-r-torch)[inputs]: Add qnnpack.
* gnu/packages/patches/python-pytorch-fix-codegen.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-runpath.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-system-libraries.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-without-kineto.patch: Adjust patch.
---
gnu/packages/machine-learning.scm | 76 +++++------
.../patches/python-pytorch-fix-codegen.patch | 26 ++--
.../patches/python-pytorch-runpath.patch | 19 +--
.../python-pytorch-system-libraries.patch | 122 +++++++++---------
.../python-pytorch-without-kineto.patch | 10 +-
5 files changed, 119 insertions(+), 134 deletions(-)

Toggle diff (416 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index b66071effc..822881f15a 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4466,7 +4466,7 @@ (define-public ideep-pytorch-for-r-torch
(base32
"0hdpkhcjry22fjx2zg2r48v7f4ljrclzj0li2pgk76kvyblfbyvm"))))))
-(define %python-pytorch-version "2.2.1")
+(define %python-pytorch-version "2.4.0")
(define %python-pytorch-src
(origin
@@ -4477,7 +4477,7 @@ (define %python-pytorch-src
(file-name (git-file-name "python-pytorch" %python-pytorch-version))
(sha256
(base32
- "03mm0pwwb5lxdsmmiw3cch9fijgjw81kmmc4ln9rlyazkm7l1r48"))
+ "18hdhzr12brj0b7ppyiscax0dbra30207qx0cckw78midfkcn7cn"))
(patches (search-patches "python-pytorch-system-libraries.patch"
"python-pytorch-runpath.patch"
"python-pytorch-without-kineto.patch"
@@ -4505,14 +4505,6 @@ (define %python-pytorch-src
delete-file
'("aten/src/ATen/nnapi/nnapi_wrapper.cpp"
"aten/src/ATen/nnapi/nnapi_wrapper.h"
- "caffe2/mobile/contrib/ios/mpscnn/mpscnn_kernels.h"
- "caffe2/proto/caffe2_legacy_pb2.pyi"
- "caffe2/proto/caffe2_pb2.pyi"
- "caffe2/proto/hsm_pb2.pyi"
- "caffe2/proto/metanet_pb2.pyi"
- "caffe2/proto/predictor_consts_pb2.pyi"
- "caffe2/proto/prof_dag_pb2.pyi"
- "caffe2/proto/torch_pb2.pyi"
;; These files contain just lists of floating point values and
;; might be as well hand-written.
;; "test/cpp/api/init_baseline.h"
@@ -4619,7 +4611,18 @@ (define-public python-pytorch
#$(this-package-native-input "pocketfft-cpp") "/include"))
(("#FP16_INCLUDE_DIR")
(string-append
- #$(this-package-input "fp16") "/include")))))
+ #$(this-package-input "fp16") "/include"))
+ ;; Disable opentelemetry
+ ((".*(add_library|target_include_directories).*opentelemetry.*")
+ ""))
+ (substitute* "torch/CMakeLists.txt"
+ ((".*opentelemetry.*") ""))
+ ;; Fix Python install directory
+ (substitute* "caffe2/CMakeLists.txt"
+ (("\\$\\{Python_SITELIB\\}")
+ (string-append #$output "/lib/python"
+ #$(version-major+minor (package-version python))
+ "/site-packages")))))
(add-before 'build 'use-system-libraries
(lambda _
(substitute* '("caffe2/serialize/crc.cc"
@@ -4641,9 +4644,7 @@ (define-public python-pytorch
name))
'("compat_bindings.cpp" "timer_callgrind_template.cpp")))
(("<callgrind.h>") "<valgrind/callgrind.h>"))
- (setenv "USE_FFMPEG" "1")
(setenv "USE_VULKAN" "1")
- (setenv "USE_OPENCV" "1")
;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
;; want to use "system libraries" instead of the bundled
;; ones.
@@ -4659,8 +4660,7 @@ (define-public python-pytorch
(or (%current-target-system)
(%current-system))
(package-transitive-supported-systems qnnpack)))
- (setenv "USE_QNNPACK" "0")
- (setenv "USE_PYTORCH_QNNPACK" "0"))))
+ (setenv "USE_QNNPACK" "0"))))
;; PyTorch is still built with AVX2 and AVX-512 support selected at
;; runtime, but these dependencies require it (nnpack only for
;; x86_64).
@@ -4773,15 +4773,15 @@ (define-public python-pytorch
python-pytest-xdist
python-hypothesis
python-types-dataclasses
- python-typing-extensions
shaderc
valgrind))
(inputs
(append
(list asmjit
+ brotli ; for cpp-httplib
clog
+ cpp-httplib
eigen
- ffmpeg
flatbuffers-next
fmt
foxi
@@ -4793,38 +4793,33 @@ (define-public python-pytorch
googlebenchmark
libuv
miniz-for-pytorch
+ oneapi-dnnl
openblas
- opencv
openmpi
+ openssl ; for cpp-httplib
pthreadpool
protobuf
pybind11
+ ;; qnnpack
+ qnnpack-pytorch
sleef
tensorpipe
vulkan-headers
vulkan-loader
vulkan-memory-allocator
+ xnnpack
+ zlib ; for cpp-httplib
zstd)
- ;; TODO: fix build on 32 bit systems once Rust is available.
- (filter
- (lambda (pkg)
- (member (or (%current-target-system)
- (%current-system))
- (package-transitive-supported-systems pkg)))
- (list oneapi-dnnl
- qnnpack
- qnnpack-pytorch
- xnnpack))
;; nnpack requires AVX2 for x86_64-linux
- (filter
- (lambda (pkg)
- (member (or (%current-target-system)
- (%current-system))
- '("armhf-linux" "aarch64-linux")))
- (list nnpack))))
+ (if (equal? (or (%current-target-system)
+ (%current-system))
+ '("aarch64-linux"))
+ (list nnpack)
+ '())))
(propagated-inputs
(append
- (list onnx ;propagated for its Python modules
+ (list cpuinfo
+ onnx ;propagated for its Python modules
onnx-optimizer
python-astunparse
python-click
@@ -4841,15 +4836,11 @@ (define-public python-pytorch
python-pyyaml
python-requests
python-sympy
- python-typing-extensions)
- (filter
- (lambda (pkg)
- (member (or (%current-target-system)
- (%current-system))
- (package-transitive-supported-systems pkg)))
- (list cpuinfo))))
+ python-typing-extensions)))
(home-page "https://pytorch.org/")
(synopsis "Python library for tensor computation and deep neural networks")
+ ;; TODO: Support other 64-bit systems.
+ (supported-systems '("x86_64-linux" "aarch64-linux"))
(description
"PyTorch is a Python package that provides two high-level features:
@@ -4927,6 +4918,7 @@ (define-public python-pytorch-for-r-torch
(replace "ideep-pytorch" ideep-pytorch-for-r-torch)))
(inputs
(modify-inputs (package-inputs python-pytorch)
+ (prepend qnnpack)
(replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch)
(replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)
(replace "xnnpack" xnnpack-for-r-torch)))
diff --git a/gnu/packages/patches/python-pytorch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-fix-codegen.patch
index cb246b25de..b30094de09 100644
--- a/gnu/packages/patches/python-pytorch-fix-codegen.patch
+++ b/gnu/packages/patches/python-pytorch-fix-codegen.patch
@@ -6,7 +6,7 @@ is later corrected. codegen_external.py is patched to avoid duplicate
functions and add the static keyword as in the existing generated file.
diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
-index cc0263dbbf..ac34e84b82 100644
+index cc0263d..ac34e84 100644
--- a/tools/gen_flatbuffers.sh
+++ b/tools/gen_flatbuffers.sh
@@ -1,13 +1,13 @@
@@ -32,10 +32,10 @@ index cc0263dbbf..ac34e84b82 100644
-c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
-index bc69b05162..0f8df81de3 100644
+index 5dcf1b2..0e20b0c 100644
--- a/torch/csrc/jit/tensorexpr/codegen_external.py
+++ b/torch/csrc/jit/tensorexpr/codegen_external.py
-@@ -20,9 +20,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+@@ -21,9 +21,14 @@ def gen_external(native_functions_path, tags_path, external_path):
native_functions = parse_native_yaml(native_functions_path, tags_path)
func_decls = []
func_registrations = []
@@ -51,7 +51,7 @@ index bc69b05162..0f8df81de3 100644
args = schema.arguments
# Only supports extern calls for functions with out variants
if not schema.is_out_fn():
-@@ -62,7 +67,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+@@ -63,7 +68,7 @@ def gen_external(native_functions_path, tags_path, external_path):
# print(tensor_decls, name, arg_names)
func_decl = f"""\
@@ -61,7 +61,7 @@ index bc69b05162..0f8df81de3 100644
void** buf_data,
int64_t* buf_ranks,
diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
-index 7cfbb803f9..2e69bb1868 100644
+index 7a0024f..6b2445f 100644
--- a/torchgen/decompositions/gen_jit_decompositions.py
+++ b/torchgen/decompositions/gen_jit_decompositions.py
@@ -1,8 +1,12 @@
@@ -88,12 +88,12 @@ index 7cfbb803f9..2e69bb1868 100644
write_decomposition_util_file(str(upgrader_path))
diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
-index dab1568580..55c58715fc 100644
+index 2907076..6866332 100644
--- a/torchgen/operator_versions/gen_mobile_upgraders.py
+++ b/torchgen/operator_versions/gen_mobile_upgraders.py
-@@ -2,10 +2,12 @@
- import os
+@@ -3,10 +3,12 @@ import os
from enum import Enum
+ from operator import itemgetter
from pathlib import Path
+import sys
from typing import Any, Dict, List
@@ -106,7 +106,7 @@ index dab1568580..55c58715fc 100644
from torchgen.code_template import CodeTemplate
from torchgen.operator_versions.gen_mobile_upgraders_constant import (
-@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+@@ -263,7 +265,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
def construct_version_maps(
upgrader_bytecode_function_to_index_map: Dict[str, Any]
) -> str:
@@ -115,10 +115,10 @@ index dab1568580..55c58715fc 100644
+ version_map = torch._C._get_operator_version_map()
+ else:
+ version_map = {}
- sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0]) # type: ignore[no-any-return]
+ sorted_version_map_ = sorted(version_map.items(), key=itemgetter(0)) # type: ignore[no-any-return]
sorted_version_map = dict(sorted_version_map_)
-@@ -378,7 +383,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+@@ -379,7 +384,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
def main() -> None:
@@ -131,12 +131,12 @@ index dab1568580..55c58715fc 100644
for up in sorted_upgrader_list:
print("after sort upgrader : ", next(iter(up)))
diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
-index c6336a6951..34e394d818 100644
+index bdfd5c7..72b237a 100644
--- a/torchgen/shape_functions/gen_jit_shape_functions.py
+++ b/torchgen/shape_functions/gen_jit_shape_functions.py
@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
if not file_path.exists():
- raise Exception(err_msg)
+ raise Exception(err_msg) # noqa: TRY002
-spec = importlib.util.spec_from_file_location(module_name, file_path)
-assert spec is not None
diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch
index 2c1724cdb0..811de9e288 100644
--- a/gnu/packages/patches/python-pytorch-runpath.patch
+++ b/gnu/packages/patches/python-pytorch-runpath.patch
@@ -2,21 +2,8 @@ Libraries (such as 'libtorch_cpu.so') and executables (such as 'torch_shm_manage
get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'.
Make sure RUNPATH matches that.
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 74836372..c8eb69d1 100644
---- a/caffe2/CMakeLists.txt
-+++ b/caffe2/CMakeLists.txt
-@@ -1910,7 +1910,7 @@ if(BUILD_PYTHON)
- if(${BUILDING_WITH_TORCH_LIBS})
- # site-packages/caffe2/python/caffe2_pybind11_state
- # site-packages/torch/lib
-- set(caffe2_pybind11_rpath "${_rpath_portable_origin}/../../torch/lib")
-+ set(caffe2_pybind11_rpath $ORIGIN/../../torch/lib)
- endif(${BUILDING_WITH_TORCH_LIBS})
-
- # Must also include `CMAKE_SHARED_LINKER_FLAGS` in linker flags for
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index acc95842..8f8fb7d7 100644
+index f1f2eb7..cb5caea 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -4,7 +4,7 @@ if(APPLE)
@@ -29,10 +16,10 @@ index acc95842..8f8fb7d7 100644
# Use separate rpaths during build and install phases
set(CMAKE_SKIP_BUILD_RPATH FALSE)
diff --git a/functorch/CMakeLists.txt b/functorch/CMakeLists.txt
-index f2f32745..db21b656 100644
+index bdfa4bf..2a75e38 100644
--- a/functorch/CMakeLists.txt
+++ b/functorch/CMakeLists.txt
-@@ -21,7 +21,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE pybind::pybind11)
+@@ -26,7 +26,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE pybind::pybind11)
set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/functorch)
diff --git a/gnu/packages/patches/python-pytorch-system-libraries.patch b/gnu/packages/patches/python-pytorch-system-libraries.patch
index 99f999f32f..025b3241a1 100644
--- a/gnu/packages/patches/python-pytorch-system-libraries.patch
+++ b/gnu/packages/patches/python-pytorch-system-libraries.patch
@@ -1,16 +1,14 @@
Patch build files to also system libraries instead of bundled ones for the
libraries not supported or working only by specifying USE_SYSTEM_LIBS. This
includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
-ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+httlib, ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool,
qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
-For QNNPACK, two versions were bundled and are required: The upstream one and
-an internal fork (now in the package qnnpack-pytorch).
diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
-index 2c2b967..5ac5fa6 100644
+index 0087dd9..0235fa1 100644
--- a/aten/src/ATen/CMakeLists.txt
+++ b/aten/src/ATen/CMakeLists.txt
-@@ -371,9 +371,9 @@ if(AT_NNPACK_ENABLED)
+@@ -419,9 +419,9 @@ if(AT_NNPACK_ENABLED)
list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
endif()
@@ -24,10 +22,10 @@ index 2c2b967..5ac5fa6 100644
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x|ppc64le)$")
list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 7483637..093de40 100644
+index 89c31fa..e6d9ef1 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
-@@ -111,9 +111,6 @@ if(NOT MSVC AND USE_XNNPACK)
+@@ -91,9 +91,6 @@ if(NOT MSVC AND USE_XNNPACK)
if(NOT TARGET fxdiv)
set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
@@ -37,7 +35,7 @@ index 7483637..093de40 100644
endif()
endif()
-@@ -1055,7 +1052,6 @@ elseif(USE_CUDA)
+@@ -1075,7 +1072,6 @@ if(USE_XPU)
endif()
if(NOT MSVC AND USE_XNNPACK)
@@ -45,7 +43,17 @@ index 7483637..093de40 100644
endif()
# ==========================================================
-@@ -1396,6 +1392,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+@@ -1189,6 +1185,9 @@ endif()
+ target_include_directories(torch_cpu PRIVATE
+ ${TORCH_ROOT}/third_party/cpp-httplib)
+
++find_package(httplib REQUIRED)
++target_link_libraries(torch_cpu PUBLIC httplib::httplib)
++
+ install(DIRECTORY "${TORCH_SRC_DIR}/csrc"
+ DESTINATION ${TORCH_INSTALL_INCLUDE_DIR}/torch
+ FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp")
+@@ -1417,6 +1416,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
@@ -53,7 +61,7 @@ index 7483637..093de40 100644
if(USE_MPI)
target_link_libraries(torch_cpu PRIVATE MPI::MPI_CXX)
endif()
-@@ -1653,7 +1650,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+@@ -1694,7 +1694,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
target_link_libraries(static_runtime_bench torch_library benchmark)
@@ -61,8 +69,8 @@ index 7483637..093de40 100644
+ target_link_libraries(static_runtime_test torch_library gtest_main gtest)
endif()
- if(BUILD_TENSOREXPR_BENCHMARK)
-@@ -1680,7 +1677,7 @@ if(BUILD_MOBILE_TEST)
+ if(BUILD_MOBILE_BENCHMARK)
+@@ -1713,7 +1713,7 @@ if(BUILD_MOBILE_TEST)
foreach(test_src ${ATen_MOBILE_TEST_SRCS})
get_filename_component(test_name ${test_src} NAME_WE)
add_executable(${test_name} "${test_src}")
@@ -71,7 +79,7 @@ index 7483637..093de40 100644
target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
-@@ -1701,7 +1698,7 @@ if(BUILD_TEST)
+@@ -1734,7 +1734,7 @@ if(BUILD_TEST)
if(NOT MSVC)
add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
# TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
@@ -80,25 +88,25 @@ index 7483637..093de40 100644
if(USE_FBGEMM)
target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
endif()
-@@ -1715,7 +1712,7 @@ if(BUILD_TEST)
+@@ -1748,7 +1748,7 @@ if(BUILD_TEST)
endif()
else()
add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
-- target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
-+ targe
This message was truncated. Download the full message here.
L
L
Ludovic Courtès wrote on 6 Sep 11:54 +0200
Re: [bug#72471] [PATCH 00/24] Update PyTorch and dependencies
(name . David Elsing)(address . david.elsing@posteo.net)(address . 72471-done@debbugs.gnu.org)
87ikv9yune.fsf@gnu.org
Hi David,

David Elsing <david.elsing@posteo.net> skribis:

Toggle quote (11 lines)
> this patch series updates python-pytorch to version 2.4.0 and some of
> its dependencies and dependent packages.
>
> I noticed that on Linux, upstream does not support 32-bit architectures
> anyway, so I set supported-systems to x86_64-linux and aarch64-linux,
> but tested only the former.
>
> For onnx and onnx-optimizer, I referenced the patches in
> https://issues.guix.gnu.org/65630 and therefore added a "Co-authored-by"
> line for Andy Tai. Is that correct to do?

Yes.

Toggle quote (2 lines)
> r-torch still depends on version 2.0.1 of PyTorch, so it is kept.

Makes sense.

I applied the whole series (thanks, ‘mumi am’!), rebased on top of
‘master’, and confirmed that r-torch and python-pytorch build fine on
x86_64-linux (since qa.guix is lagging behind).

Pushed as 571c605f17481e8c606c876e04129d99632bc2ec.

Thanks for all the work!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 72471@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72471
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch