all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: 31386@debbugs.gnu.org
Cc: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Subject: [bug#31386] [PATCH 2/3] gnu: Add gemmlowp-for-tensorflow.
Date: Tue, 8 May 2018 16:59:08 +0200	[thread overview]
Message-ID: <20180508145909.25354-2-ricardo.wurmus@mdc-berlin.de> (raw)
In-Reply-To: <20180508145909.25354-1-ricardo.wurmus@mdc-berlin.de>

* 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@elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@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

  reply	other threads:[~2018-05-08 15:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08 14:54 [bug#31386] TensorFlow Ricardo Wurmus
2018-05-08 14:59 ` [bug#31386] [PATCH 1/3] gnu: eigen: Include unsupported features Ricardo Wurmus
2018-05-08 14:59   ` Ricardo Wurmus [this message]
2018-05-09 22:48     ` [bug#31386] [PATCH 2/3] gnu: Add gemmlowp-for-tensorflow Ludovic Courtès
2018-05-10  8:40       ` Ricardo Wurmus
2018-05-08 14:59   ` [bug#31386] [PATCH 3/3] gnu: Add tensorflow-core Ricardo Wurmus
2018-05-09 22:51     ` Ludovic Courtès
2018-05-10  8:34       ` Ricardo Wurmus
2018-05-10 20:24         ` Ludovic Courtès
2018-05-09 22:44   ` [bug#31386] [PATCH 1/3] gnu: eigen: Include unsupported features Ludovic Courtès
2018-05-10  8:42     ` Ricardo Wurmus
2018-05-08 17:52 ` [bug#31386] TensorFlow Fis Trivial
2018-05-08 19:26   ` Björn Höfling
2018-05-09 22:43 ` Ludovic Courtès
2019-01-02 16:29 ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180508145909.25354-2-ricardo.wurmus@mdc-berlin.de \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=31386@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.