aboutsummaryrefslogtreecommitdiff
path: root/gn/packages/machine-learning.scm
blob: fbaffb20f4e0b6d7094fb0dd29feb01eb26a6896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(define-module (gn packages machine-learning)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages machine-learning))

(define-public tensorflow-native
  (package
    (inherit tensorflow)
    (name "tensorflow-native")
    (arguments
     (substitute-keyword-arguments (package-arguments tensorflow)
       ((#:substitutable? _ #f) #f)
       ;((#:phases phases)
       ; `(modify-phases ,phases
       ;    (add-after 'unpack 'hardcode-multicore-usage
       ;      (lambda _
       ;        (substitute* "tensorflow/core/protobuf/config.proto"
       ;          ;(("num_threads = 1") "num_threads = 28") ; 56/2 for penguin2
       ;          ;(("intra_op_parallelism_threads = 2")
       ;          ; "intra_op_parallelism_threads = 0")
       ;          ;(("inter_op_parallelism_threads = 5")
       ;          ; "inter_op_parallelism_threads = 0")
       ;          )
       ;        #t))))
       ((#:configure-flags flags)
        `(cons
           "-Dtensorflow_OPTIMIZE_FOR_NATIVE_ARCH=ON"
           (delete "-Dtensorflow_OPTIMIZE_FOR_NATIVE_ARCH=OFF"
                   ,flags)))))))

(define-public tensowflow-native-instead-of-tensorflow
  (package-input-rewriting/spec `(("tensorflow" . ,(const tensorflow-native)))))