From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG464-0001sy-92 for guix-patches@gnu.org; Tue, 08 May 2018 11:00:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG45y-0002Si-FS for guix-patches@gnu.org; Tue, 08 May 2018 11:00:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fG45y-0002SZ-Bi for guix-patches@gnu.org; Tue, 08 May 2018 11:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fG45y-0007IU-5A for guix-patches@gnu.org; Tue, 08 May 2018 11:00:02 -0400 Subject: [bug#31386] [PATCH 2/3] gnu: Add gemmlowp-for-tensorflow. Resent-Message-ID: From: Ricardo Wurmus Date: Tue, 8 May 2018 16:59:08 +0200 Message-ID: <20180508145909.25354-2-ricardo.wurmus@mdc-berlin.de> In-Reply-To: <20180508145909.25354-1-ricardo.wurmus@mdc-berlin.de> References: <20180508145909.25354-1-ricardo.wurmus@mdc-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31386@debbugs.gnu.org Cc: Ricardo Wurmus * 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 +;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016, 2017 Marius Bakke ;;; Copyright © 2016 Hartmut Goebel @@ -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