GNU bug report logs - #31386
TensorFlow

Previous Next

Package: guix-patches;

Reported by: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>

Date: Tue, 8 May 2018 14:55:02 UTC

Severity: normal

Done: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
To: <31386 <at> debbugs.gnu.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: [bug#31386] [PATCH 2/3] gnu: Add gemmlowp-for-tensorflow.
Date: Tue, 8 May 2018 16:59:08 +0200
* gnu/packages/machine-learning.scm (gemmlowp-for-tensorflow): New variable.
---
 gnu/packages/machine-learning.scm | 54 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index f0d35484e..87fbec6b6 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2016 Efraim Flashner <efraim <at> flashner.co.il>
 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke <at> fastmail.com>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
@@ -557,6 +557,58 @@ Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes
 and a QP solver.")
     (license license:gpl2)))
 
+;; TODO: We may need to pass "-msse4.1" as an additional optimization flag
+;; when building for x86_64.  This is strongly recommended by the authors in
+;; the README.md.
+(define-public gemmlowp-for-tensorflow
+  (let ((commit "7c7c744640ddc3d0af18fb245b4d23228813a71b"))
+    (package
+      (name "gemmlowp")
+      (version (string-append "0-1." (string-take commit 7)))
+      (source (origin
+                (method url-fetch)
+                (uri (string-append "https://mirror.bazel.build/"
+                                    "github.com/google/gemmlowp/archive/"
+                                    commit ".zip"))
+                (sha256
+                 (base32
+                  "1kxj8h017q4r1dcva61vziwmks66rvr0iw93lg45fwws4n8cqlmq"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           ;; This directory contains the CMakeLists.txt.
+           (add-after 'unpack 'chdir
+             (lambda _ (chdir "contrib") #t))
+           ;; There is no install target
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (lib (string-append out "/lib/"))
+                      (inc (string-append out "/include/")))
+                 (install-file "../build/libeight_bit_int_gemm.so" lib)
+                 (for-each (lambda (dir)
+                             (let ((target (string-append inc "/" dir)))
+                               (mkdir-p target)
+                               (for-each (lambda (h)
+                                           (install-file h target))
+                                         (find-files (string-append "../" dir)
+                                                     "\\.h$"))))
+                           '("meta" "profiling" "public" "fixedpoint"
+                             "eight_bit_int_gemm" "internal"))
+                 #t))))))
+      (native-inputs
+       `(("unzip" ,unzip)))
+      (home-page "https://github.com/google/gemmlowp")
+      (synopsis "Small self-contained low-precision GEMM library")
+      (description
+       "This is a small self-contained low-precision @dfn{general matrix
+multiplication} (GEMM) library.  It is not a full linear algebra library.
+Low-precision means that the input and output matrix entries are integers on
+at most 8 bits.  To avoid overflow, results are internally accumulated on more
+than 8 bits, and at the end only some significant 8 bits are kept.")
+      (license license:asl2.0))))
+
 (define-public dlib
   (package
     (name "dlib")
-- 
2.15.1





This bug report was last modified 6 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.