From patchwork Wed Jan 2 16:17:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Wurmus X-Patchwork-Id: 624 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CEEAA169F5; Wed, 2 Jan 2019 16:19:22 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mira.cbaines.net (Postfix) with ESMTP id 68BE4169EF for ; Wed, 2 Jan 2019 16:19:22 +0000 (GMT) Received: from localhost ([127.0.0.1]:45903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gejEn-0004Kx-V2 for patchwork@mira.cbaines.net; Wed, 02 Jan 2019 11:19:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gejEY-0004KB-Vj for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gejEU-0006hX-Uc for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gejEU-0006h3-OM for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gejEU-0002A1-IS for guix-patches@gnu.org; Wed, 02 Jan 2019 11:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33952] [PATCH 01/14] gnu: Add gemmlowp-for-tensorflow. References: In-Reply-To: Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Jan 2019 16:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33952 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: <33952@debbugs.gnu.org> Received: via spool by 33952-submit@debbugs.gnu.org id=B33952.15464459008147 (code B ref 33952); Wed, 02 Jan 2019 16:19:02 +0000 Received: (at 33952) by debbugs.gnu.org; 2 Jan 2019 16:18:20 +0000 Received: from localhost ([127.0.0.1]:44890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gejDn-00027G-LW for submit@debbugs.gnu.org; Wed, 02 Jan 2019 11:18:20 -0500 Received: from sinope02.bbbm.mdc-berlin.de ([141.80.25.24]:56548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gejDl-000272-E6 for 33952@debbugs.gnu.org; Wed, 02 Jan 2019 11:18:18 -0500 Received: from localhost (localhost [127.0.0.1]) by sinope02.bbbm.mdc-berlin.de (Postfix) with ESMTP id 8CF4E14B590A for <33952@debbugs.gnu.org>; Wed, 2 Jan 2019 17:18:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mdc-berlin.de; h= content-type:content-type:content-transfer-encoding:mime-version :x-mailer:message-id:date:date:subject:subject:from:from :received:received:received; s=mdc; t=1546445891; x=1548260292; bh=MIa+yfyNqXLqnJyLqDZivB7Y6iwHjx60auUJXM5y26s=; b=A8gd4s7eqdtN ioo7hnnTSD+p+vxpR0puLAOkeVBpEPYrL6dPuQ4kGYh3gOuqQx3JWL714kXXAXCh msXsqiLQCLeTQn/J7J5glKiIDNIrJIGqwu4W9xFdnaBhkh3XgREXdvJrsB/QHwPY BVfV5qiOo4UDAOei4uYfAgpupshT8UQ= X-Virus-Scanned: amavisd-new at mdc-berlin.de Received: from sinope02.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (sinope02.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 017Xp5MB0DKb for <33952@debbugs.gnu.org>; Wed, 2 Jan 2019 17:18:11 +0100 (CET) Received: from SW-IT-P-CAS4.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by sinope02.bbbm.mdc-berlin.de (Postfix) with ESMTPS for <33952@debbugs.gnu.org>; Wed, 2 Jan 2019 17:18:11 +0100 (CET) Received: from localhost (141.80.113.103) by SW-IT-P-CAS4.mdc-berlin.net (141.80.113.59) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 2 Jan 2019 17:18:10 +0100 From: Ricardo Wurmus Date: Wed, 2 Jan 2019 17:17:54 +0100 Message-ID: <20190102161807.28297-1-ricardo.wurmus@mdc-berlin.de> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Originating-IP: [141.80.113.103] X-TM-AS-Product-Ver: SMEX-12.5.0.1684-8.5.1010-24332.001 X-TM-AS-Result: No-3.346900-8.000000-10 X-TMASE-MatchedRID: WO6FSsaLhY2SkBDp1A0HiriMC5wdwKqdQl/FdRYkUZLfUZT83lbkEAn9 ofQNoBQFiLwCGMQswxCO9NvhBeIuxBxGESPHTa2uu72KpAktHS+usS9CiBzL8SgVbxW7FDOVYUU cTJLR9ZOkZzpexK9EIzg9PEFzPSyZhAcTvHoAcW6EryjhqiyzygXLIdcukLJWycmFNidOeD3coi ReGPAOW4Oqmm8t7v72Ed5FOBej7IH9kbyhKg6JlB+WEMjoO9WWJpcBMilCCGjIXpx0LHuyyRXIP 2JmqI1yw9uQT9lfsUvs/AoQQPS5EoPhXvvZBernnprizKKMwmZ9LQinZ4QefPcjNeVeWlqY+gtH j7OwNO22utO5qEfOUXci8v9AtxMbaG5TbIp7dCaMfiPViGx23hgbNiIO9EgJrtYTDFR4zrGzvU2 vqHuY1fD0wvPZNt1g2ZF67axy+U4St0801614dof4l3W0tVe7u49q1sWEC7dHBp5ZT1n34TddPu Hwt7TAxYVzI3UCCaY= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.346900-8.000000 X-TMASE-Version: SMEX-12.5.0.1684-8.5.1010-24332.001 X-TM-SNTS-SMTP: F1EEAB0C0B94AE6F90BA0BED416122D64B0AFEDE96F6E65A0641985F60884F622000:9 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ricardo Wurmus Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (gemmlowp-for-tensorflow): New variable. --- gnu/packages/machine-learning.scm | 60 ++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 084e62cca..f4e66b9a3 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -58,7 +58,8 @@ #:use-module (gnu packages statistics) #:use-module (gnu packages swig) #:use-module (gnu packages xml) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module (ice-9 match)) (define-public fann ;; The last release is >100 commits behind, so we package from git. @@ -621,6 +622,63 @@ Support Vector Machines, Spectral Clustering, Kernel PCA, Gaussian Processes and a QP solver.") (license license:gpl2))) +(define-public gemmlowp-for-tensorflow + ;; The commit hash is taken from "tensorflow/workspace.bzl". + (let ((commit "38ebac7b059e84692f53e5938f97a9943c120d98") + (revision "2")) + (package + (name "gemmlowp") + (version (git-version "0" revision commit)) + (source (origin + (method url-fetch) + (uri (string-append "https://mirror.bazel.build/" + "github.com/google/gemmlowp/archive/" + commit ".zip")) + (file-name (string-append "gemmlowp-" version ".zip")) + (sha256 + (base32 + "0n56s2g8hrssm4w8qj1v58gfm56a04n9v992ixkmvk6zjiralzxq")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (list ,@(match (%current-system) + ((or "x86_64-linux" "i686-linux") + '("-DCMAKE_CXX_FLAGS=-msse4.1")) + (_ '()))) + #: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")