[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#72471] [PATCH 11/24] gnu: Add xnnpack-for-r-torch.
From: |
David Elsing |
Subject: |
[bug#72471] [PATCH 11/24] gnu: Add xnnpack-for-r-torch. |
Date: |
Sun, 4 Aug 2024 22:15:49 +0000 |
* 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(-)
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
- [bug#72471] [PATCH 00/24] Update PyTorch and dependencies, David Elsing, 2024/08/04
- [bug#72471] [PATCH 02/24] gnu: Remove python-typing-extensions-4.10., David Elsing, 2024/08/04
- [bug#72471] [PATCH 06/24] gnu: cpuinfo: Update to commit 05332fd., David Elsing, 2024/08/04
- [bug#72471] [PATCH 03/24] gnu: python-optree: Update to 0.11.0., David Elsing, 2024/08/04
- [bug#72471] [PATCH 01/24] gnu: asmjit: Update to commit 062e69c., David Elsing, 2024/08/04
- [bug#72471] [PATCH 04/24] gnu: flatbuffers-next: Update to 24.3.25., David Elsing, 2024/08/04
- [bug#72471] [PATCH 05/24] gnu: pthreadpool: Update to commit 560c60d., David Elsing, 2024/08/04
- [bug#72471] [PATCH 10/24] gnu: xnnpack: Update to commit 08f1489., David Elsing, 2024/08/04
- [bug#72471] [PATCH 11/24] gnu: Add xnnpack-for-r-torch.,
David Elsing <=
- [bug#72471] [PATCH 12/24] gnu: python-nbval: Update to 0.11.0., David Elsing, 2024/08/04
- [bug#72471] [PATCH 15/24] gnu: Remove onnx-for-torch2., David Elsing, 2024/08/04
- [bug#72471] [PATCH 09/24] gnu: fbgemm: Update to 0.7.0., David Elsing, 2024/08/04
- [bug#72471] [PATCH 14/24] gnu: Remove onnx-optimizer-for-torch2., David Elsing, 2024/08/04
- [bug#72471] [PATCH 19/24] gnu: cpp-httplib: Update to 0.16.0., David Elsing, 2024/08/04
- [bug#72471] [PATCH 23/24] gnu: python-torchmetrics: Update to 1.4.1., David Elsing, 2024/08/04
- [bug#72471] [PATCH 22/24] gnu: python-lightning-utilities: Update to 0.11.6., David Elsing, 2024/08/04
- [bug#72471] [PATCH 18/24] gnu: gloo: Update to commit 81925d1., David Elsing, 2024/08/04
- [bug#72471] [PATCH 07/24] gnu: nnpack: Depend on python-peachpy only for x86_64., David Elsing, 2024/08/04
- [bug#72471] [PATCH 13/24] gnu: Add python-parameterized-next., David Elsing, 2024/08/04