From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oFd1KW+FeWHWYwAAgWs5BA (envelope-from ) for ; Wed, 27 Oct 2021 18:59:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UJkjJW+FeWGRHAAAB5/wlQ (envelope-from ) for ; Wed, 27 Oct 2021 16:59:27 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 53D80195C3 for ; Wed, 27 Oct 2021 18:59:27 +0200 (CEST) Received: from localhost ([::1]:54630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfmGs-0002Xv-EZ for larch@yhetil.org; Wed, 27 Oct 2021 12:59:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mflIU-0006Ip-Qj for guix-patches@gnu.org; Wed, 27 Oct 2021 11:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mflIU-0006a2-Ia for guix-patches@gnu.org; Wed, 27 Oct 2021 11:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mflIU-0001uM-IG for guix-patches@gnu.org; Wed, 27 Oct 2021 11:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51198] [PATCH] gnu: Add b2sum. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 Oct 2021 15:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51198 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo Famulari Cc: 51198@debbugs.gnu.org, =?UTF-8?Q?Nicol=C3=B2?= Balzarotti Received: via spool by 51198-submit@debbugs.gnu.org id=B51198.16353502037302 (code B ref 51198); Wed, 27 Oct 2021 15:57:02 +0000 Received: (at 51198) by debbugs.gnu.org; 27 Oct 2021 15:56:43 +0000 Received: from localhost ([127.0.0.1]:50361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mflIA-0001tg-Tb for submit@debbugs.gnu.org; Wed, 27 Oct 2021 11:56:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mflI7-0001tK-Vm for 51198@debbugs.gnu.org; Wed, 27 Oct 2021 11:56:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41760) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mflI2-0006V4-Hz; Wed, 27 Oct 2021 11:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=ewzpM+EmjEIU7YKg1iXYPpYrQxN0oR1SSZk176vpC2o=; b=Ddajol19vU1w/pQl54VE /pPvSM+8sPiuGVfeJIHSSZ4kOIymjp3klRYxaRHuviAC2lzJ71w/Z50rf9dLngAIqdiZlGg8ClwCJ HC73/qYKidHSA+NWvHaJpSs4MEFYTtiwxZNRIVArhCb3VfDyQb1n7BauTOGSCanyLlozyX/8dwZSO 57mrvR7sO2Xouojb1lGUAsC0QAz0Vpzn2Yl7KdWbpfffJS/ICFI/9SnpTNF38ra9mC1ITLbOVxhIr LX2Orv+U1mni7fCEhMLRX2FNjudSTbGuBAejJ5rY4Wnb735CSFU9CBvgr5AaQvLmkPYK5AAs0AdIe T/SG4Ahhr1SVQQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54244 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mflI2-0008M6-2X; Wed, 27 Oct 2021 11:56:34 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <878ryfjudi.fsf@guix.i-did-not-set--mail-host-address--so-tickle-me> <874k92kgaq.fsf@guix.i-did-not-set--mail-host-address--so-tickle-me> Date: Wed, 27 Oct 2021 17:56:31 +0200 In-Reply-To: (Leo Famulari's message of "Wed, 27 Oct 2021 11:38:08 -0400") Message-ID: <875ytifols.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635353967; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ewzpM+EmjEIU7YKg1iXYPpYrQxN0oR1SSZk176vpC2o=; b=R1DE8c1BDeszxQiE7y7FDCChXo/8xRnYfOOdCfAW2YloCnNkICeLpaxtJy42ELH8U3RqkH 5NUOAeyMUkNFsIFMeAXzW/NcGCNuOAXLaC8vb+pcvlTPNl/VqRp/MnCv5k4IrQH/wkuv+G 2nLV/tHC9z+BchTMcfokXDwLnF4hkG8N+3zhU8zmSTEgJDUmreDoXyyto3T7nDBfkNINI0 Vmb0PLiTIMvWXVksUV7EneDz2PYweZAFEfkC6cWPHCtswOMtF5mCBlFEiRQRAFZyTqXXao zGoqeP9o++SofqFJPtRR5yyQKkJW9M63bIrifoEADZ75VlntcJiAGa0L0TwtMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635353967; a=rsa-sha256; cv=none; b=QCzX8jLIi6gLbkVjkYPXxXXu0DktdOg9BvPy7rRQoNWyfIStBpOCWOzqGUa9fF7Xs68Cx5 fS5a+yoE0fUB4GP2KESQiW/FOFsQApWkSWnIv9wxDRFt5FGB4+wUDaEURfBAaTczHjI9yJ PEJ0F9E3VU9v5dfn7nhQgJZJjSg5XbDjtbHsuU71uD6+/KO+rDoVL+lYhNiVDCa4rlQG29 AI+kWCaQKO7769uIWvYoBs5UosCY4fHXAEdEIa0aL7hG7L+G7zlwKh3OhmH2rdG/XrOT9m TmmJ2QxDMKfutjiZPZk2HjqqN5VkAf+ISLgWNSu7dscPfer0aMT6uNncDqov5A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Ddajol19; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Ddajol19; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 53D80195C3 X-Spam-Score: -1.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: VLOFLcGYYH17 Hi! Leo Famulari skribis: > On Wed, Oct 27, 2021 at 10:44:45AM +0200, Nicol=C3=B2 Balzarotti wrote: >> This blog post [fn:1] on guix-hpc address the "Pre-built binaries >> vs. performance" dilemma. >> >> [fn:1] https://hpc.guix.info/blog/2018/01/pre-built-binaries-vs-performa= nce/ > > It's helpful, but it doesn't look like we are using that method in Guix > anymore. It was removed in this commit: > > https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D969adb235ee34decb= 65255e1ea821ff0e221ed3d > > I guess it learned how to do runtime feature detection? BLIS has run-time/load-time feature detection now (which is the main approach the blog argues for). >> I guess the easiest way is to provide a variant (b2sum-avx or something >> like that) with avx enabled. Else, I'd just go with the unoptimized >> version as it happens for many other packages, but let's hear from >> others. > > The easiest thing is require local building, since it's an extremely > cheap build. Only 1.5 seconds on my laptop, total (not just the build > phase). With blis, one had to consider the lengthy build time. > > Because performance is critical for a tool like this, and because it's > cheap to build, I've attached a patch to require local building. This is > easier for me than creating a set of package variants that will need to > be expanded for each new generation of CPUs :) > >>>From 8b862425310cf631c30c823eb0fa2bfd79d36823 Mon Sep 17 00:00:00 2001 > From: Leo Famulari > Date: Wed, 27 Oct 2021 11:29:40 -0400 > Subject: [PATCH] gnu: b2sum: Build on the local machine. > > * gnu/packages/crypto.scm (b2sum)[arguments]: Set '#:substitutable? #f'. > --- > gnu/packages/crypto.scm | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm > index 3acd147f25..de8bcf1d70 100644 > --- a/gnu/packages/crypto.scm > +++ b/gnu/packages/crypto.scm > @@ -858,9 +858,18 @@ (define-public b2sum > (base32 "04z631v0vzl52g73v390ask5fnzi5wg83lcjkjhpmmymaz= 0jn152")))) > (build-system gnu-build-system) > (arguments > - `(#:make-flags (list (string-append "CC=3D" ,(cc-for-target)) > - (string-append "PREFIX=3D" (assoc-ref %outpu= ts "out"))) > + `(;; By default, b2sum uses the compiler to generate instructions > + ;; tailored to the CPU of the running machine, using "-march=3D= native". > + ;; This gives a ~1.5x speedup on a Core i5-6300U with a large d= ataset > + ;; paged in, whereas compilation of b2sum takes ~1.5 seconds. > + ;; b2sum does not support run-time feature detection: > + ;; https://github.com/BLAKE2/BLAKE2/issues/1 > + ;; For more information, see the discussion beginning here: > + ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D51198#13 > + #:substitutable? #f It=E2=80=99s okay but not entirely sufficient: on a cluster setup, you typi= cally talk to a daemon that=E2=80=99s on another machine, so the CPU features it= =E2=80=99ll detect there may be different from those you=E2=80=99ll use. Likewise, as discussed on IRC, you=E2=80=99d also need #:local-build? #t. Anyway, I=E2=80=99d suggest using =E2=80=98guix hash -H blake2s-256=E2=80= =99 or similar (it uses libgcrypt, which does the right thing). I think the latest Coreutils provide a generic =E2=80=98cksum=E2=80=99, too, that probably does the righ= t thing. Ludo=E2=80=99.