From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16386501143688 (code B ref -1); Sat, 04 Dec 2021 20:36:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Dec 2021 20:35:14 +0000 Received: from localhost ([127.0.0.1]:55152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbkS-0000xE-CZ for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:35:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:58576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbkQ-0000x7-JO for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:35:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbkN-0007Ui-Ou for guix-patches@gnu.org; Sat, 04 Dec 2021 15:35:05 -0500 Received: from [2001:470:142:3::e] (port=44842 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbkK-0005b1-5M; Sat, 04 Dec 2021 15:35:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=kMeqSPIHiZoI+FvIU1i0vtGJ1hrPsS2V61xXqZYteqw=; b=jBxANkV0ePfCwk PLwIWAya18r6OBdJpATPZKuzUiqQdgmcH5mcoXJz4UbDZY2Akcf7es76rvFpmXrx/R8tY9RvuHOUS LHzSZ5wi/rVkd8sreXg+Dkw5j9dvtCJgK8fFxNRzuZcATO4+ULF8dUgk/jiJ6XoodGETgziERhvBH nMRMmfYGw1124slycZTITf4fY8vyOaqfY85K1NPRPb8M0qDpGRW1nUoHSJvAJgs7WVv3eBow4iVsf R/qfNukkhydEFeGOXBpCQ05iQxZ5a79Rnp+vm2gllHNEsMNP+MvUr5r5Jfbpdlg1xIYkJR3uxTgLY rGtK2Sifjpqe7gnBUbTw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54570 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbkK-0003SD-1y; Sat, 04 Dec 2021 15:35:00 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:34:47 +0100 Message-Id: <20211204203447.15200-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Guix! This patch series is an attempt to allow users to build or substitute packages for the very CPU they are using, as opposed to using a generic binary that targets the baseline architecture—e.g., x86_64 without AVX extensions. As a reminder, my take on this is that The Right Thing is for code to select optimized implementations for the host CPU at load time, using (possibly hand-crafted) “function multi-versioning”: https://hpc.guix.info/blog/2018/01/pre-built-binaries-vs-performance/ Now, there’s at least one situation where developers don’t do “the right thing”: C++ header-only libraries. It turns out header-only libraries with #ifdef’d SIMD code are quite common: Eigen, xsimd, xtensor, etc. Every user of those libs has to be compiled with ‘-march=native’ to take advantage of those SIMD-optimized routines and there’s little hope of seeing those libraries implement load-time or run-time selection¹. This patch set implements “package multi-versioning”, where a package can have different variants users may choose from: baseline, haswell, skylake, etc. This is implemented as a package transformation option, ‘--tune’. Without any argument, ‘--tune’ grafts tuned package variants for each package that has the ‘tunable?’ property. For example: guix shell eigen-benchmarks --tune -- benchBlasGemm 16 16 16 100 100 runs one of the Eigen benchmarks tuned for the host CPU, because ‘eigen-benchmarks’ is marked as “tunable”. This is achieved not by passing ‘-march=native’, because the daemon might be running on a separate machine with a different CPU, but by identifying the ‘-march’ value corresponding to the host CPU and passing ‘-march’ to the compiler, via a wrapper. On my skylake laptop, that gives a noticeable difference on the GEMM benchmark of Eigen and good results on the xtensor benchmarks too, unsurprisingly. I don’t have figures for higher-level applications, but it’d be nice to benchmark some of Eigen’s dependents for instance, as shown by: guix graph -M2 -t reverse-package eigen | xdot -f fdp - If you could run such benchmarks, that’d be great! :-) Things like Fenics may benefit from it. Nix people chose to introduce separate system types for the various x86_64 micro-architecture levels: x86_64-linux-v1, x86_64-linux-v2, etc.² I think this is somewhat wasteful and unpractical though. It’s also unclear whether those levels, defined in the new x86_64 psABI³, are a viable abstraction: vendors seem to be mixing features rather than really following the accumulative pattern that those levels imply. Thoughts? Ludo’. ¹ https://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2021/11/msg00006.html ² https://discourse.nixos.org/t/nix-2-4-released/15822 ³ https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex Ludovic Courtès (10): Add (guix cpu). transformations: Add '--tune'. ci: Add extra jobs for tunable packages. gnu: Add eigen-benchmarks. gnu: Add xsimd-benchmark. gnu: Add xtensor-benchmark. gnu: ceres-solver: Mark as tunable. gnu: Add ceres-solver-benchmarks. gnu: libfive: Mark as tunable. gnu: prusa-slicer: Mark as tunable. Makefile.am | 1 + doc/guix.texi | 54 ++++++++++++++ gnu/ci.scm | 43 ++++++++--- gnu/packages/algebra.scm | 79 ++++++++++++++++++++ gnu/packages/cpp.scm | 23 ++++++ gnu/packages/engineering.scm | 10 ++- gnu/packages/maths.scm | 49 ++++++++++++- guix/cpu.scm | 137 +++++++++++++++++++++++++++++++++++ guix/transformations.scm | 134 ++++++++++++++++++++++++++++++++++ tests/transformations.scm | 20 +++++ 10 files changed, 538 insertions(+), 12 deletions(-) create mode 100644 guix/cpu.scm base-commit: 052f56e5a614854636563278ee5a2248b3609d87 prerequisite-patch-id: 7e5c2bb5942496daf01a7f6dfc1b0b5b214f1584 -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 01/10] Add (guix cpu). References: <20211204203447.15200-1-ludo@gnu.org> In-Reply-To: <20211204203447.15200-1-ludo@gnu.org> Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098513743 (code B ref 52283); Sat, 04 Dec 2021 20:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:45 +0000 Received: from localhost ([127.0.0.1]:55197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyb-0003ZV-4L for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyZ-0003Z5-Sb for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:44 -0500 Received: from [2001:470:142:3::e] (port=45326 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyU-0001fg-8a; Sat, 04 Dec 2021 15:49:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=yUdLBOCnF5V5tbnoR9MFzY4wEQvqsCzLcrMJSpSVhh4=; b=SvaxT2PyaDT47g wghT4TLAceqpGpOPvt/wWPL3Pbq0LIpQdBT+frfWNMJrhQtsI/Kzhgsjecd+Qj2/LNAPi5thCxcnM efGDosp5SlA0BGx94gbYxDEGOSGayFAVUocctL17EMLxoDUsEBhXLX06AofonIYaq6EvFWp1RM/pm UNI0xR/Kbg+Pu04Nrkt795CkHuz8vZg0zohRSpHa0WxJFTC8g+SgAIZQW6blxsbqIllE21NtyFT2W dt2ejASrGdPWzmKddm46Q4vgjFDsmOvCM8QmYMh7W3AuzYcPbatncDfdX/u4S8fXSqJJBRtQy+L1C FZeQNTUiYULo6mm612Kg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyU-00059z-20; Sat, 04 Dec 2021 15:49:38 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:15 +0100 Message-Id: <20211204204924.15581-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/cpu.scm: New file. * Makefile.am (MODULES): Add it. --- Makefile.am | 1 + guix/cpu.scm | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 guix/cpu.scm diff --git a/Makefile.am b/Makefile.am index f7e7b5184f..0846818cc2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -81,6 +81,7 @@ MODULES = \ guix/base64.scm \ guix/ci.scm \ guix/cpio.scm \ + guix/cpu.scm \ guix/deprecation.scm \ guix/docker.scm \ guix/records.scm \ diff --git a/guix/cpu.scm b/guix/cpu.scm new file mode 100644 index 0000000000..77efac92a2 --- /dev/null +++ b/guix/cpu.scm @@ -0,0 +1,137 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix cpu) + #:use-module (guix sets) + #:use-module (guix memoization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (ice-9 match) + #:use-module (ice-9 rdelim) + #:export (current-cpu + cpu? + cpu-architecture + cpu-family + cpu-model + cpu-flags + + cpu->gcc-architecture)) + +;;; Commentary: +;;; +;;; This module provides tools to determine the micro-architecture supported +;;; by the CPU and to map it to a name known to GCC's '-march'. +;;; +;;; Code: + +;; CPU description. +(define-record-type + (cpu architecture family model flags) + cpu? + (architecture cpu-architecture) ;string, from 'uname' + (family cpu-family) ;integer + (model cpu-model) ;integer + (flags cpu-flags)) ;set of strings + +(define current-cpu + (mlambda () + "Return a record representing the host CPU." + (define (prefix? prefix) + (lambda (str) + (string-prefix? prefix str))) + + (call-with-input-file "/proc/cpuinfo" + (lambda (port) + (let loop ((family #f) + (model #f)) + (match (read-line port) + ((? eof-object?) + #f) + ((? (prefix? "cpu family") str) + (match (string-tokenize str) + (("cpu" "family" ":" family) + (loop (string->number family) model)))) + ((? (prefix? "model") str) + (match (string-tokenize str) + (("model" ":" model) + (loop family (string->number model))) + (_ + (loop family model)))) + ((? (prefix? "flags") str) + (match (string-tokenize str) + (("flags" ":" flags ...) + (cpu (utsname:machine (uname)) + family model (list->set flags))))) + (_ + (loop family model)))))))) + +(define (cpu->gcc-architecture cpu) + "Return the architecture name, suitable for GCC's '-march' flag, that +corresponds to CPU, a record as returned by 'current-cpu'." + (match (cpu-architecture cpu) + ("x86_64" + ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.c. + (or (and (= 6 (cpu-family cpu)) ;the "Pentium Pro" family + (letrec-syntax ((model (syntax-rules (=>) + ((_) #f) + ((_ (candidate => integers ...) rest + ...) + (or (and (= (cpu-model cpu) integers) + candidate) + ... + (model rest ...)))))) + (model ("bonnel" => #x1c #x26) + ("silvermont" => #x37 #x4a #x4d #x5a #x5d) + ("core2" => #x0f #x17 #x1d) + ("nehalem" => #x1a #x1e #x1f #x2e) + ("westmere" => #x25 #x2c #x2f) + ("sandybridge" => #x2a #x2d) + ("ivybridge" => #x3a #x3e) + ("haswell" => #x3c #x3f #x45 #x46) + ("broadwell" => #x3d #x47 #x4f #x56) + ("skylake" => #x4e #x5e #x8e #x9e) + ("skylake-avx512" => #x55) ;TODO: cascadelake + ("knl" => #x57) + ("cannonlake" => #x66) + ("knm" => #x85)))) + + ;; Fallback case for non-Intel processors or for Intel processors not + ;; recognized above. + (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + (if-flags ("avx512" => "knl") + ("adx" => "broadwell") + ("avx2" => "haswell") + ;; TODO: tigerlake, cooperlake, etc. + ("avx" => "sandybridge") + ("sse4_2" "movbe" => "silvermont") + ("sse4_2" => "nehalem") + ("ssse3" "movbe" => "bonnell") + ("ssse3" => "core2"))) + "x86_64")) + (architecture + ;; TODO: AArch64. + architecture))) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 03/10] ci: Add extra jobs for tunable packages. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098813775 (code B ref 52283); Sat, 04 Dec 2021 20:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:48 +0000 Received: from localhost ([127.0.0.1]:55207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyd-0003a6-M4 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbya-0003Z7-LR for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:44 -0500 Received: from [2001:470:142:3::e] (port=45330 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyV-0001gG-C9; Sat, 04 Dec 2021 15:49:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=GmYZGhsNWuuYJ92529+5w06qr4Nz6NLSf1JI/E3T04g=; b=Klhukl3dQ/nOJKgaXa9k ZBSE3yCI2EWtuIDxqUO1LNZwFuE/DtWUXFmtmq42gV2UMZbz+McKq0OFlSMPF/SQKA4LkUEKafPG4 PnNHfvZZVgReHyX32k22uUQK7GOvPd58ugK7liaO6PvFPsZnG98yzwT8naxYv0ciRTl94ZOm/p0DG lGvj+gYYzUkqmrOR+PfYSmjvk25auic2Xec9VhaO17z+i1wDEtvfo+E1Hcodg2unlsf8/LFlbWsiU XVLD0sSiT2INiET5vRz2QW4kArN6eZtanuQR2OIbDOk75de/pLeH9olPsJk3a7OGj8gm+AcqCbgpX lc/eqfqOZBosEQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyV-00059z-8i; Sat, 04 Dec 2021 15:49:39 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:17 +0100 Message-Id: <20211204204924.15581-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows us to provide substitutes for tuned package variants. * gnu/ci.scm (package-job): Add #:suffix and honor it. (package->job): Add #:suffix and honor it. (%x86-64-micro-architectures): New variable. (tuned-package-jobs): New procedure. (cuirass-jobs): Add jobs for tunable packages. --- gnu/ci.scm | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/gnu/ci.scm b/gnu/ci.scm index e1011355db..2f56554d93 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -28,6 +28,7 @@ (define-module (gnu ci) #:use-module (guix grafts) #:use-module (guix profiles) #:use-module (guix packages) + #:autoload (guix transformations) (tunable-package? tuned-package) #:use-module (guix channels) #:use-module (guix config) #:use-module (guix derivations) @@ -108,9 +109,9 @@ (define* (derivation->job name drv (#:timeout . ,timeout))) (define* (package-job store job-name package system - #:key cross? target) + #:key cross? target (suffix "")) "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." - (let ((job-name (string-append job-name "." system))) + (let ((job-name (string-append job-name "." system suffix))) (parameterize ((%graft? #f)) (let* ((drv (if cross? (package-cross-derivation store package target system @@ -395,21 +396,39 @@ (define package->job (((_ inputs _ ...) ...) inputs)))) (%final-inputs))))) - (lambda (store package system) + (lambda* (store package system #:key (suffix "")) "Return a job for PACKAGE on SYSTEM, or #f if this combination is not -valid." +valid. Append SUFFIX to the job name." (cond ((member package base-packages) (package-job store (string-append "base." (job-name package)) - package system)) + package system #:suffix suffix)) ((supported-package? package system) (let ((drv (package-derivation store package system #:graft? #f))) (and (substitutable-derivation? drv) (package-job store (job-name package) - package system)))) + package system #:suffix suffix)))) (else #f))))) +(define %x86-64-micro-architectures + ;; Micro-architectures for which we build tuned variants. + '("westmere" "ivybridge" "haswell" "skylake" "skylake-avx512")) + +(define (tuned-package-jobs store package system) + "Return a list of jobs for PACKAGE tuned for SYSTEM's micro-architectures." + (filter-map (lambda (micro-architecture) + (define suffix + (string-append "." micro-architecture)) + + (package->job store + (tuned-package package micro-architecture) + system + #:suffix suffix)) + (match system + ("x86_64-linux" %x86-64-micro-architectures) + (_ '())))) + (define (all-packages) "Return the list of packages to build." (define (adjust package result) @@ -527,10 +546,16 @@ (define source ('all ;; Build everything, including replacements. (let ((all (all-packages)) - (job (lambda (package) - (package->job store package system)))) + (jobs (lambda (package) + (match (package->job store package system) + (#f '()) + (main-job + (cons main-job + (if (tunable-package? package) + (tuned-package-jobs store package system) + '()))))))) (append - (filter-map job all) + (append-map jobs all) (cross-jobs store system)))) ('core ;; Build core packages only. -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098913790 (code B ref 52283); Sat, 04 Dec 2021 20:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:49 +0000 Received: from localhost ([127.0.0.1]:55211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbye-0003a8-11 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbya-0003Z8-Ma for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:45 -0500 Received: from [2001:470:142:3::e] (port=45328 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyU-0001fp-PQ; Sat, 04 Dec 2021 15:49:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=U17giIwh3cjH9FKsmqtHZ+X+JKCiNEMVWUdbymhoL4k=; b=XhaA9B6trOtwpwh9zNpi DPxn2CYmrUU5EflprwxrPRrIYPgHcih46kvAoYWrwZnX8evPCF3BqjP4Vovd601PvuIxh+SCesC2Q VQtichHZLDyNy4HVftyu8v5M6OvLlYjcNl5D7O9gezeO3ct2op71jjqvQ0rvGhjYYIbZpOXZ+Wru6 QH+iPoZjO9XULQCMl/HAClMqK8lah7vyNIJXCaC714LnXAeNdEA4wAqcg2pfvjdY4M1f6OYKtIr+L nzqSBVRdbZZ3Ep4tlRkFfCigqyrIUHf8pNyF1E8H48jhWckKTbTlrZLQzO96eUeRPaqovci2kG9TI rPRjClslCQDsLQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyU-00059z-Lc; Sat, 04 Dec 2021 15:49:38 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:16 +0100 Message-Id: <20211204204924.15581-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) From: Ludovic Courtès * guix/transformations.scm (tuning-compiler) (tuned-package, tunable-package?, package-tuning) (transform-package-tuning): New procedures. (%transformations): Add 'tune'. (%transformation-options): Add "--tune". * tests/transformations.scm ("options->transformation, tune"): New test. * doc/guix.texi (Package Transformation Options): Document '--tune'. --- doc/guix.texi | 54 +++++++++++++++ guix/transformations.scm | 134 ++++++++++++++++++++++++++++++++++++++ tests/transformations.scm | 20 ++++++ 3 files changed, 208 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index a675631b79..e3aca8fd3b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -10906,6 +10906,60 @@ available options and a synopsis (these options are not shown in the @table @code +@cindex performance, tuning code +@cindex optimization, of package code +@cindex tuning, of package code +@cindex SIMD support +@cindex tunable packages +@cindex package multi-versioning +@item --tune[=@var{cpu}] +Use versions of the packages marked as ``tunable'' optimized for +@var{cpu}. When @var{cpu} is @code{native}, or when it is omitted, tune +for the CPU on which the @command{guix} command is running. + +Valid @var{cpu} names are those recognized by GCC, the GNU Compiler +Collection. On x86_64 processors, this includes CPU names such as +@code{nehalem}, @code{haswell}, and @code{skylake} (@pxref{x86 Options, +@code{-march},, gcc, Using the GNU Compiler Collection (GCC)}). + +As new generations of CPUs come out, they augment the standard +instruction set architecture (ISA) with additional instructions, in +particular instructions for single-instruction/multiple-data (SIMD) +parallel processing. For example, while Core2 and Skylake CPUs both +implement the x86_64 ISA, only the latter supports AVX2 SIMD +instructions. + +The primary gain one can expect from @option{--tune} is for programs +that can make use of those SIMD capabilities @emph{and} that do not +already have a mechanism to select the right optimized code at run time. +Packages that have the @code{tunable?} property set are considered +@dfn{tunable packages} by the @option{--tune} option; a package +definition with the property set looks like this: + +@lisp +(package + (name "hello-simd") + ;; ... + + ;; This package may benefit from SIMD extensions so + ;; mark it as "tunable". + (properties '((tunable? . #t)))) +@end lisp + +Other packages are not considered tunable. This allows Guix to use +generic binaries in the cases where tuning for a specific CPU is +unlikely to provide any gain. + +Tuned packages are @emph{grafted} onto packages that depend on them +(@pxref{Security Updates, grafts}). Thus, using @option{--no-grafts} +annihilates the effect of @option{--tune}. + +We call this technique @dfn{package multi-versioning}: several variants +of tunable packages may be built, one for each CPU variant. It is the +coarse-grain counterpart of @dfn{function multi-versioning} as +implemented by the GNU tool chain (@pxref{Function Multiversioning,,, +gcc, Using the GNU Compiler Collection (GCC)}). + @item --with-source=@var{source} @itemx --with-source=@var{package}=@var{source} @itemx --with-source=@var{package}@@@var{version}=@var{source} diff --git a/guix/transformations.scm b/guix/transformations.scm index 5ae1977cb2..3be02179ef 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -29,6 +29,7 @@ (define-module (guix transformations) #:autoload (guix upstream) (package-latest-release upstream-source-version upstream-source-signature-urls) + #:autoload (guix cpu) (current-cpu cpu->gcc-architecture) #:use-module (guix utils) #:use-module (guix memoization) #:use-module (guix gexp) @@ -49,6 +50,9 @@ (define-module (guix transformations) #:export (options->transformation manifest-entry-with-transformations + tunable-package? + tuned-package + show-transformation-options-help %transformation-options)) @@ -419,6 +423,120 @@ (define replacements obj) obj))) +(define tuning-compiler + (mlambda (micro-architecture) + "Return a compiler wrapper that passes '-march=MICRO-ARCHITECTURE' to the +actual compiler." + (define wrapper + #~(begin + (use-modules (ice-9 match)) + + (define* (search-next command + #:optional + (path (string-split (getenv "PATH") + #\:))) + ;; Search the next COMMAND on PATH, a list of + ;; directories representing the executable search path. + (define this + (stat (car (command-line)))) + + (let loop ((path path)) + (match path + (() + (match command + ("cc" (search-next "gcc")) + (_ #f))) + ((directory rest ...) + (let* ((file (string-append + directory "/" command)) + (st (stat file #f))) + (if (and st (not (equal? this st))) + file + (loop rest))))))) + + (match (command-line) + ((command arguments ...) + (match (search-next (basename command)) + (#f (exit 127)) + (next + (apply execl next + (append (cons next arguments) + (list (string-append "-march=" + #$micro-architecture)))))))))) + + (define program + (program-file (string-append "tuning-compiler-wrapper-" micro-architecture) + wrapper)) + + (computed-file (string-append "tuning-compiler-" micro-architecture) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (define bin (string-append #$output "/bin")) + (mkdir-p bin) + + (for-each (lambda (program) + (symlink #$program + (string-append bin "/" program))) + '("cc" "gcc" "clang" "g++" "c++" "clang++"))))))) + +(define (tuned-package p micro-architecture) + "Return package P tuned for MICRO-ARCHITECTURE." + (define compiler + (tuning-compiler micro-architecture)) + + (package + (inherit p) + (native-inputs + ;; Arrange so that COMPILER comes first in $PATH. + `(("tuning-compiler" ,compiler) + ,@(package-native-inputs p))) + (arguments + (substitute-keyword-arguments (package-arguments p) + ((#:tests? _ #f) #f))) + (properties + `((cpu-tuning . ,micro-architecture) + ,@(package-properties p))))) + +(define (tunable-package? package) + "Return true if package PACKAGE is \"tunable\"--i.e., if tuning it for the +host CPU is worthwhile." + (assq 'tunable? (package-properties package))) + +(define package-tuning + (mlambda (micro-architecture) + "Return a procedure that maps the given package to its counterpart tuned +for MICRO-ARCHITECTURE, a string suitable for GCC's '-march'." + (define rewriting-property + (gensym " package-tuning")) + + (package-mapping (lambda (p) + (cond ((assq rewriting-property (package-properties p)) + p) + ((assq 'tunable? (package-properties p)) + (package/inherit p + (replacement (tuned-package p micro-architecture)) + (properties `((,rewriting-property . #t) + ,@(package-properties p))))) + (else + p))) + (lambda (p) + (assq rewriting-property (package-properties p))) + #:deep? #t))) + +(define (transform-package-tuning micro-architectures) + "Return a procedure that, when " + (match micro-architectures + ((micro-architecture _ ...) + (info (G_ "tuning for CPU micro-architecture ~a~%") + micro-architecture) + (let ((rewrite (package-tuning micro-architecture))) + (lambda (obj) + (if (package? obj) + (rewrite obj) + obj)))))) + (define (transform-package-with-debug-info specs) "Return a procedure that, when passed a package, set its 'replacement' field to the same package but with #:strip-binaries? #f in its 'arguments' field." @@ -601,6 +719,7 @@ (define %transformations (with-commit . ,transform-package-source-commit) (with-git-url . ,transform-package-source-git-url) (with-c-toolchain . ,transform-package-toolchain) + (tune . ,transform-package-tuning) (with-debug-info . ,transform-package-with-debug-info) (without-tests . ,transform-package-tests) (with-patch . ,transform-package-patches) @@ -640,6 +759,21 @@ (define %transformation-options (parser 'with-git-url)) (option '("with-c-toolchain") #t #f (parser 'with-c-toolchain)) + (option '("tune") #f #t + (lambda (opt name arg result . rest) + (define micro-architecture + (match arg + ((or #f "native") + (cpu->gcc-architecture (current-cpu))) + ("generic" #f) + (_ arg))) + + (apply values + (if micro-architecture + (alist-cons 'tune micro-architecture + result) + (alist-delete 'tune result)) + rest))) (option '("with-debug-info") #t #f (parser 'with-debug-info)) (option '("without-tests") #t #f diff --git a/tests/transformations.scm b/tests/transformations.scm index 09839dc1c5..760b523e6e 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -465,6 +465,26 @@ (define (package-name* obj) `((with-latest . "foo"))))) (package-version (t p))))) +(test-equal "options->transformation, tune" + '(cpu-tuning . "superfast") + (let* ((p0 (dummy-package "p0")) + (p1 (dummy-package "p1" + (inputs `(("p0" ,p0))) + (properties '((tunable? . #t))))) + (p2 (dummy-package "p2" + (inputs `(("p1" ,p1))))) + (t (options->transformation '((tune . "superfast")))) + (p3 (t p2))) + (and (not (package-replacement p3)) + (match (package-inputs p3) + ((("p1" tuned)) + (match (package-inputs tuned) + ((("p0" p0)) + (and (not (package-replacement p0)) + (assq 'cpu-tuning + (package-properties + (package-replacement tuned))))))))))) + (test-equal "options->transformation + package->manifest-entry" '((transformations . ((without-tests . "foo")))) (let* ((p (dummy-package "foo")) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 04/10] gnu: Add eigen-benchmarks. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865098913803 (code B ref 52283); Sat, 04 Dec 2021 20:50:03 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:49 +0000 Received: from localhost ([127.0.0.1]:55215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyf-0003aN-8R for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyb-0003ZA-Iz for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:46 -0500 Received: from [2001:470:142:3::e] (port=45332 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyW-0001gX-3w; Sat, 04 Dec 2021 15:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=X/ZJYht+4CvFHJtV7V5izuiSVqty+Cp0DFWe/TBVgl4=; b=G7EZ3I+jTYa1mTBOTvzf 7vuVu6h1EM1GqV8R4tpuyYqhjCTxwkkvQMUx3uUePnKbvYKgUIX1krFD5+AKiXeHf8bT0vpBIvlcB 5qhYsbl9XIsG1vg9mp9lDRIaPAXIrmj0LK+ZCC+cHWPbbf/U4eqtDMMaafPZ6h4gHfDoOCNe8O2ek 63IVoTGPBnpfQIMKS4YFhDzPvLO87jj3TaYAAThSvRHik6bOoZ9z2gKlOr5uoVlYYdp3293WEQH84 P7I9cUkm9BULq2l9N5nbeFH0AKwwOBSscWKep81R9DoJyGybDOe1VPooJgHcpYV0ei9yeGxKACWZv ph2jZ6qxAxSYZQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyV-00059z-Ro; Sat, 04 Dec 2021 15:49:40 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:18 +0100 Message-Id: <20211204204924.15581-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/algebra.scm (eigen-benchmarks): New variable. --- gnu/packages/algebra.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index b704d98dde..a782f8b1be 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1074,6 +1074,45 @@ (define-public eigen ;; See 'COPYING.README' for details. (license license:mpl2.0))) +(define-public eigen-benchmarks + (package + (inherit eigen) + (name "eigen-benchmarks") + (arguments + '(#:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define (compile file) + (format #t "compiling '~a'...~%" file) + (let ((target + (string-append bin "/" + (basename file ".cpp")))) + (invoke "g++" "-o" target file + "-I" ".." "-O2" "-g" + "-lopenblas" "-Wl,--as-needed"))) + + (mkdir-p bin) + (with-directory-excursion "bench" + ;; There are more benchmarks, of varying quality. + ;; Here we pick some that appear to be useful. + (for-each compile + '("benchBlasGemm.cpp" + "benchCholesky.cpp" + ;;"benchEigenSolver.cpp" + "benchFFT.cpp" + "benchmark-blocking-sizes.cpp")))))) + (delete 'install)))) + (inputs `(("boost" ,boost) + ("openblas" ,openblas))) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t))) + + (synopsis "Micro-benchmarks of the Eigen linear algebra library"))) + (define-public eigen-for-tensorflow (let ((changeset "fd6845384b86") (revision "1")) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 05/10] gnu: Add xsimd-benchmark. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099013816 (code B ref 52283); Sat, 04 Dec 2021 20:50:03 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:50 +0000 Received: from localhost ([127.0.0.1]:55219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyf-0003aW-LT for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyc-0003ZB-1c for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:46 -0500 Received: from [2001:470:142:3::e] (port=45336 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyW-0001go-Oe; Sat, 04 Dec 2021 15:49:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=L3Q7XV2ow/EDdYqJDS5VDoUsXc0iA/5raHatmkAb2V8=; b=OA3J19Vtp2PBFAQ3nFiI w+aF5/msGKkuFD7FcI0MKxSfxVbwvWHPoDCe/KOHZZGuqQRHQgkqtRS/S73EcQVypi+JVQMBm+EB2 /Zq09wdFLSmB0O3u7KpwZsw3tR8KjcJrMywZU8dH6Isb/9YW7mHwrRoBfRkYRonRVsuAu1IAMjslo Z4SS9XsMh5Vfi/rAEV0hDM7cZyLnFiHlxFBZrbES7tl/Jow26/zbvzjGXvgPvPuD6JtT2892ipotG 3+/JZuw7O3B0bF70DUKG5Tj2vczaobW0HxUB2dvNhxOtR4TPg9ZMy1EffLbTy248pJWGbZnpHTOCJ ne4WSzYTjXldOg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyW-00059z-Es; Sat, 04 Dec 2021 15:49:40 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:19 +0100 Message-Id: <20211204204924.15581-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/cpp.scm (xsmimd-benchmark): New variable. --- gnu/packages/cpp.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index e2f2279418..0bf65ed364 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -300,6 +300,29 @@ (define-public xsimd operating on batches.") (license license:bsd-3))) +(define-public xsmimd-benchmark + (package + (inherit xsimd) + (name "xsimd-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xsimd" + (string-append out "/bin")))))))) + (synopsis "Benchmark of the xsimd library") + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public chaiscript (package (name "chaiscript") -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 06/10] gnu: Add xtensor-benchmark. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099013822 (code B ref 52283); Sat, 04 Dec 2021 20:50:04 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:50 +0000 Received: from localhost ([127.0.0.1]:55221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyg-0003an-6B for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyc-0003ZD-Ka for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:46 -0500 Received: from [2001:470:142:3::e] (port=45338 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyX-0001gw-Bg; Sat, 04 Dec 2021 15:49:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=BArU7FarHvTt8z9d36WkNG880pTmzDUSFK3bGEdv4qc=; b=nX9GIQ+U5TRHTL2km1SM mTQncdTyGTRnqOfXZf97CFmQzYmXpCBvhSoiDgv7wVVLdzIyEpy+Zyjms0M8AhCpO/1OE0MBcHL6b mN255j4iC6m104O035MVwPiu8xYDZOx1WpgSpIm9eBlNMAmKlj0Wr0UiUhyRIuXlGXxJ1i8dCrihC 265RuOPr8TIl207ZqZzWDXXrtguwt9y1eptkJnUOaX/ueRIt4MMziNhcJIn4ihma6bYQLJ1ypx9VF JYsileFBd2rJRXFH2J+D4xh8jdAUcYQRBVPaAR/IgCtve7bc+d6ZEZ+z+nyNzmeSb3prCXSwfQJ2r ExHBw3g0xRhEag==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyX-00059z-8Z; Sat, 04 Dec 2021 15:49:41 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:20 +0100 Message-Id: <20211204204924.15581-6-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/algebra.scm (xtensor-benchmark): New variable. --- gnu/packages/algebra.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index a782f8b1be..4e3f8298a2 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1200,6 +1200,46 @@ (define-public xtensor @end itemize") (license license:bsd-3))) +(define-public xtensor-benchmark + (package + (inherit xtensor) + (name "xtensor-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON" + "-DDOWNLOAD_GBENCHMARK=OFF") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (add-after 'unpack 'link-with-googlebenchmark + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("find_package\\(benchmark.*" all) + (string-append + all "\n" + "set(GBENCHMARK_LIBRARIES benchmark)\n"))))) + (replace 'build + (lambda _ + (invoke "make" "benchmark_xtensor" "-j" + (number->string (parallel-job-count))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xtensor" + (string-append out "/bin")))))))) + (synopsis "Benchmarks of the xtensor library") + (native-inputs '()) + (inputs + `(("googlebenchmark" ,googlebenchmark) + ("xsimd" ,xsimd) + ,@(package-native-inputs xtensor))) + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public gap (package (name "gap") -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 07/10] gnu: ceres-solver: Mark as tunable. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099213833 (code B ref 52283); Sat, 04 Dec 2021 20:50:04 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:52 +0000 Received: from localhost ([127.0.0.1]:55223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyi-0003b2-HC for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyd-0003ZE-7w for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:47 -0500 Received: from [2001:470:142:3::e] (port=45340 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyX-0001h7-VL; Sat, 04 Dec 2021 15:49:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=++qwO9LU8Jph5gM2u47IkibAfhLiOYoSA9nm1rTkGUs=; b=eTPjA4j3Dsju/K5326+H 5MRLnGNOC8kiTgcHHLzkJa8kkXOSP5ATvA/bJGmCmkbbXjxXWvJov2OZfzq8JdldFftDex9JZ2y/k v+XD+LFEZURb7n7HODfFJIf/UxRPJNOrkdQCoGrJ47w5p/iQmSgF19uCcIr+1vhldW4hsMUxTj5b8 Qy04eTPQcf0UPgVdZvS2biiBx+LxLf8BwomGIUTMlBxUE255GlmP2zgpQUX2GggLwTNbCFUt55Jl7 o5zr/UzS7wF+mVfwLso8IkN4gMkWPh4H7nxphzqTpjSvK+uZ2Jo24LPVuduT13Km5WRqQT5CBURlO J04ZT3GN54Kdsg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyX-00059z-Rp; Sat, 04 Dec 2021 15:49:42 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:21 +0100 Message-Id: <20211204204924.15581-7-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/maths.scm (ceres)[properties]: New field. --- gnu/packages/maths.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 83f31c1396..19dab598c6 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2396,7 +2396,10 @@ (define-public ceres @item non-linear least squares problems with bounds constraints; @item general unconstrained optimization problems. @end enumerate\n") - (license license:bsd-3))) + (license license:bsd-3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties `((tunable? . #t))))) ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 08/10] gnu: Add ceres-solver-benchmarks. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099313840 (code B ref 52283); Sat, 04 Dec 2021 20:50:04 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:53 +0000 Received: from localhost ([127.0.0.1]:55225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyi-0003b4-OE for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyd-0003ZG-SX for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:48 -0500 Received: from [2001:470:142:3::e] (port=45348 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyY-0001hZ-J4; Sat, 04 Dec 2021 15:49:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=x5ZSt0wehn96SrZtXhYGFsauGAHgWBl6QHdHJN/P6Og=; b=Pl9KpyZ83CtncWI/GvH8 +tJzvV++961Eu/a6ZeVTqdwyZsIperyMYEZey8C+XkYQE46KvGp5qgIHhEoyrU2FDOyAtzzlo6l+Q cDqZJybn05K9aX5gFbsjjs+wbik4KHhAuhFJQpBoXMhg3fhq5Q52TPfAu16ONcQkLqYQcPhX60S+v UBekvK8En8/n7hC1gpPmoeSmXeQpoMTb4nMLVQ93ruLE+j1sy3kcVX58feeIxFopKoQHbNqZBxtyw 6QKyOh5SqjO7TE4T59+Kxz6P4KeT3i/GSR/6tvWMvZsLnDjc5wJ/R3X4UP/iZw9sFymfRwlQIItER ccXF6u7Qa026DQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyY-00059z-Ey; Sat, 04 Dec 2021 15:49:42 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:22 +0100 Message-Id: <20211204204924.15581-8-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/maths.scm (ceres-solver-benchmarks): New variable. --- gnu/packages/maths.scm | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 19dab598c6..06bdb8ed92 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2401,6 +2401,50 @@ (define-public ceres ;; Mark as tunable to take advantage of SIMD code in Eigen. (properties `((tunable? . #t))))) +(define-public ceres-solver-benchmarks + (package + (inherit ceres) + (name "ceres-solver-benchmarks") + (arguments + '(#:modules ((ice-9 popen) + (ice-9 rdelim) + (guix build utils) + (guix build cmake-build-system)) + + #:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define flags + (string-tokenize + (read-line (open-pipe* OPEN_READ + "pkg-config" "eigen3" + "--cflags")))) + + (define (compile-file file) + (let ((source (string-append file ".cc"))) + (format #t "building '~a'...~%" file) + (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG" + source "-lceres" "-lbenchmark" "-lglog" + "-pthread" + "-o" (string-append bin "/" file) + "-I" ".." flags))) + + (mkdir-p bin) + (with-directory-excursion "internal/ceres" + (for-each compile-file + '("small_blas_gemm_benchmark" + "small_blas_gemv_benchmark" + "autodiff_cost_function_benchmark")))))) + (delete 'check) + (delete 'install)))) + (inputs `(("googlebenchmark" ,googlebenchmark) + ("ceres-solver" ,ceres) + ,@(package-inputs ceres))) + (synopsis "Benchmarks of the Ceres optimization problem solver"))) + ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. (define-public octave-cli -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 09/10] gnu: libfive: Mark as tunable. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099313847 (code B ref 52283); Sat, 04 Dec 2021 20:50:05 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:53 +0000 Received: from localhost ([127.0.0.1]:55227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyj-0003bB-3j for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbye-0003ZH-QE for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from [2001:470:142:3::e] (port=45356 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbyZ-0001hx-HO; Sat, 04 Dec 2021 15:49:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=RwkTY8ImACv9sK21TyShP51HC9of7i2itQwlvyZ2Ljw=; b=q6v+vLdBuqi+TbTnE8yA QhTJVKIvtt5J1FT1HfKrEU/ee9PI5j5/jGKAtX4UlKwpigdPuAAgsQcEIkGDGkoor+1MwMZhaaLWG TCDHUXicD+KguDpkbFMCM1GYgCeBNhBkv7SBQyXrFAlGWZEO6DgMVOHAjmGq/MARlFSer56JwdUU6 /dtnCpEQCTrDj3TFWz95vakR6kmrJHR5BF8Tx6EZ0hM4AwvnGZSHJw2el7QHWZN5Nj0w7jfI73by+ OvXhsDDBRA//1ubyFWYr39B8ZUKcVRqXjYimiYMefKCKRy5R6SlXlCtVvN0PI+UZvdV61dyw/ueXD W6q0qumWpry8dQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbyZ-00059z-2V; Sat, 04 Dec 2021 15:49:43 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:23 +0100 Message-Id: <20211204204924.15581-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/engineering.scm (libfive)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 50f265f085..4a749f5ecf 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -837,7 +837,10 @@ (define-public libfive Even fundamental, primitive shapes are represented as code in the user-level language.") (license (list license:mpl2.0 ;library - license:gpl2+))))) ;Guile bindings and GUI + license:gpl2+)) ;Guile bindings and GUI + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t)))))) (define-public inspekt3d (let ((commit "703f52ccbfedad2bf5240bf8183d1b573c9d54ef") -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 10/10] gnu: prusa-slicer: Mark as tunable. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 20:50:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865099313853 (code B ref 52283); Sat, 04 Dec 2021 20:50:05 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 20:49:53 +0000 Received: from localhost ([127.0.0.1]:55229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyj-0003bI-Cf for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbyf-0003ZO-DD for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 15:49:49 -0500 Received: from [2001:470:142:3::e] (port=45358 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbya-0001i4-4B; Sat, 04 Dec 2021 15:49:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=vTJXuB2My8mB6WcLdDFOt66kigdeyyXjkjkowCwvIkg=; b=JgGeXqRHz951/OFilocs MsJbe0qJVZMW8G24FOIaG5d9gMQCvgjZ+3uW44LuaadzSkxbdrE0xVIQptz0d6O3zyq2ltBcd9pVQ AUnvxG5Xh5YY6b1ORiZxWiKDFtaeAmaolEfUpKizcXWXKtY9Fgz3gKf8yThse4fHcZPRDPC+Xqbnl VnYCzgs+Vr17NaDRK7kGM5J+6yuJrh9E0e4CQCyBlfD/fUuDRWUUFS5Kn524kcPusxxbmqNyyMMyE 5qyTeoGkOBKHNiFSmrhBUU5kweZbjyQ4NKNrhhYi3UjOkfEAHFUBVt/PhrkMgMr30S6xjXLdJo3qk B8VxuDHq3/YItQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45592 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbya-00059z-0w; Sat, 04 Dec 2021 15:49:44 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 4 Dec 2021 21:49:24 +0100 Message-Id: <20211204204924.15581-10-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/engineering.scm (prusa-slicer)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 4a749f5ecf..7e8c042653 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -3070,4 +3070,7 @@ (define-public prusa-slicer (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)") (description "PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into G-code instructions for FFF printers or PNG layers for mSLA 3D printers.") - (license license:agpl3))) + (license license:agpl3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen and in libigl. + (properties '((tunable? . #t))))) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Dec 2021 21:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163865232024633 (code B ref 52283); Sat, 04 Dec 2021 21:12:02 +0000 Received: (at 52283) by debbugs.gnu.org; 4 Dec 2021 21:12:00 +0000 Received: from localhost ([127.0.0.1]:55311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtcK8-0006PF-23 for submit@debbugs.gnu.org; Sat, 04 Dec 2021 16:12:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtcK6-0006Ou-4s for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 16:11:58 -0500 Received: from [2001:470:142:3::e] (port=46456 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtcK1-0002Fy-0E for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 16:11:53 -0500 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=NAYJg4MR+CNhXK3BYZcozruAU/2LsLcMRPG5TyMLlZc=; b=jW5ppaD1fwCzWTKZFcNN CfBSVSDWCv+6Pm5bMZQTbGtncYMmnzEpLab9wuH1kEdaqUKii+fJY/Mo/daG5E3A64iHsh3Sj5/Ue Tzy8dRH8D0CsUojtVY5J+sqc7c/w3r6sLikKoysI8VhNCdvTN1Jf2N+0Mj++CfJ1vsXDc2kw90R9+ Fcovs71ueYNnaw2MM40FWJ5Fe/RIQLN9cn6SdkolGdfmggpRysBWU6xmMxYE0TVn6Mwu8Yr9l79rw 1+BZCeb82moMyJWRKuOnNlJIAHHGrFwJEicMzLx80B/zL7DvlZojBLm9IvEVP1LjkNnjAgenuo+0E iMXVp4l8+lKZXA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53746 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtcK0-0006Ug-ON for 52283@debbugs.gnu.org; Sat, 04 Dec 2021 16:11:52 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204203447.15200-1-ludo@gnu.org> Date: Sat, 04 Dec 2021 22:11:49 +0100 In-Reply-To: <20211204203447.15200-1-ludo@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 4 Dec 2021 21:34:47 +0100") Message-ID: <87tufoulbe.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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: > This is achieved not by passing =E2=80=98-march=3Dnative=E2=80=99, becaus= e the daemon > might be running on a separate machine with a different CPU, but by > identifying the =E2=80=98-march=E2=80=99 value corresponding to the host = CPU and > passing =E2=80=98-march=E2=80=99 to the compiler, via a wrapper. Another argument in favor of this approach is verifiability, because manifests record the argument to the =E2=80=98tune=E2=80=99 transformation = option: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix shell eigen-benchmarks --tune guix shell: tuning for CPU micro-architecture skylake [env]$ guix package --export-manifest -p $GUIX_ENVIRONMENT ;; This "manifest" file can be passed to 'guix package -m' to reproduce ;; the content of your profile. This is "symbolic": it only specifies ;; package names. To reproduce the exact same profile, you also need to ;; capture the channels being used, as returned by "guix describe". ;; See the "Replicating Guix" section in the manual. (use-modules (guix transformations)) (define transform1 (options->transformation '((tune . "skylake")))) (packages->manifest (list (transform1 (specification->package "eigen-benchmarks")))) --8<---------------cut here---------------end--------------->8--- Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 05 Dec 2021 08:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.16386934396698 (code B ref 52283); Sun, 05 Dec 2021 08:38:01 +0000 Received: (at 52283) by debbugs.gnu.org; 5 Dec 2021 08:37:19 +0000 Received: from localhost ([127.0.0.1]:56269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtn1K-0001jy-Tr for submit@debbugs.gnu.org; Sun, 05 Dec 2021 03:37:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtn1J-0001jm-Iw for 52283@debbugs.gnu.org; Sun, 05 Dec 2021 03:37:18 -0500 Received: from [2001:470:142:3::e] (port=33700 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtn1D-00063E-R2; Sun, 05 Dec 2021 03:37:11 -0500 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=ww+cou7AhLJFlKZmzEHTYloDPFrBoCWD40s+ERAkZ2s=; b=KRLd85eR2YBLqoBg3HW+ xighOqPfG09S/UsQAoE8S/KpGRUIgXnQty+M2JhK4LXOpl2B0B+N0/kIbI3ndrV1825tEg0f0cCG1 rTJ64LNTBn42f8BpLQoD/UWiMz9XZ9NDGMHrEqiWDTbVTr/c6ethBaj2z5Hw/Cz7fly9PHrjIuIOL ADmcZp9sOliecW+AeMFQJjEk8/84rCfx3J9f+bXqhOzHqywNGy8upwf1yoLKrHo5IXz7ShDqLCH84 F0e0w8ZbKAj5gYGzlzT9U0IGBOyKxghmIgK+Gpu8xKyjGjJIqTTD8a2AXeqPnNRDM6JcG+iTUgM9v plunRaXRXXDWkg==; Received: from [2a01:e0a:19b:d9a0:2ddb:d3d2:32e8:d31a] (port=48894 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtn1D-0003EX-Eu; Sun, 05 Dec 2021 03:37:11 -0500 From: Mathieu Othacehe References: <20211204203447.15200-1-ludo@gnu.org> <20211204204924.15581-1-ludo@gnu.org> Date: Sun, 05 Dec 2021 09:37:09 +0100 In-Reply-To: <20211204204924.15581-1-ludo@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 4 Dec 2021 21:49:15 +0100") Message-ID: <87czmb1m8a.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey Ludo, Wooh, nice addition! > +(define-record-type > + (cpu architecture family model flags) > + cpu? > + (architecture cpu-architecture) ;string, from 'uname' > + (family cpu-family) ;integer > + (model cpu-model) ;integer > + (flags cpu-flags)) ;set of strings When using the "--tune" transformation option with "native", we can expect the current-cpu method to fill the record correctly. However, when the user is passing a custom cpu name, it might be incorrect. I think we should check the user input against a list of valid/supported cpu architectures. That's something we should also enforce for the system and target fields. Currently, this command "guix build -s arch64-linux hello" is failing with an unpleasant backtrace, while it could warn that the given system is not supported. Maybe the (guix cpu) and (gnu platform) modules should be merged somehow to define the supported CPU micro-architectures: --8<---------------cut here---------------start------------->8--- (define armv7-linux (platform (target "arm-linux-gnueabihf") (system "armhf-linux") (linux-architecture "arm") (supported-march '("armv7" "armv7-a" "armv7ve")) --8<---------------cut here---------------end--------------->8--- we could then use those platform records in the (gnu ci) module to build packages against all the supported micro architectures and remove the "%x86-64-micro-architecture" variable you propose to introduce there. WDYT? Thanks, Mathieu From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Dec 2021 10:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163878713429751 (code B ref 52283); Mon, 06 Dec 2021 10:39:02 +0000 Received: (at 52283) by debbugs.gnu.org; 6 Dec 2021 10:38:54 +0000 Received: from localhost ([127.0.0.1]:60621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muBOX-0007jn-LX for submit@debbugs.gnu.org; Mon, 06 Dec 2021 05:38:53 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:48485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muBOT-0007jX-Gq for 52283@debbugs.gnu.org; Mon, 06 Dec 2021 05:38:53 -0500 IronPort-HdrOrdr: A9a23:zguCrqpKK9mcna9hcgcT0VwaV5qseYIsimQD101hICF9WteTlsCwkPle/QKcskdfZJhAo6HnBEDuewKgyXce2+gs1ImZLXrbUQeTXeZfBWWL+UytJ8XRntQtnJuIWZIOfuEZlTNB/IvHCDDRKadr/DFsmJrYzds2tk0dBj2CFZsQlzuRezzra3GeHzM2d+tNKHP03KMuzFfNFhRnDbXfdx04tqr41qb2ffTdEGA77jEcmX2zZFiTmcHH+najr20juw0k+8ZSzYG8qX2E2kzPiZ+GIhS37R6i032IorGRqOdrNYiKjIwcMT/sihmlDb4RLIG/gA== X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="400360311" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 11:38:43 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204203447.15200-1-ludo@gnu.org> <20211204204924.15581-1-ludo@gnu.org> <87czmb1m8a.fsf_-_@gnu.org> Date: Mon, 06 Dec 2021 11:38:42 +0100 In-Reply-To: <87czmb1m8a.fsf_-_@gnu.org> (Mathieu Othacehe's message of "Sun, 05 Dec 2021 09:37:09 +0100") Message-ID: <87zgpeqaq5.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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! Mathieu Othacehe skribis: > Wooh, nice addition! Glad you like it. :-) >> +(define-record-type >> + (cpu architecture family model flags) >> + cpu? >> + (architecture cpu-architecture) ;string, from 'uname' >> + (family cpu-family) ;integer >> + (model cpu-model) ;integer >> + (flags cpu-flags)) ;set of strings > > When using the "--tune" transformation option with "native", we can > expect the current-cpu method to fill the record correctly. > > However, when the user is passing a custom cpu name, it might be > incorrect. I think we should check the user input against a list of > valid/supported cpu architectures. > > That's something we should also enforce for the system and target > fields. Currently, this command "guix build -s arch64-linux hello" is > failing with an unpleasant backtrace, while it could warn that the > given system is not supported. Right. I=E2=80=99m a bit torn because I agree with the usability issue and solution you propose, but at the same time I know that maintaining a list of existing CPU names will be tedious and it=E2=80=99ll be annoying for users if they can=E2=80=99t just specify their CPU name (which they might w= ant to do precisely when =E2=80=98--tune=3Dnative=E2=80=99 doesn=E2=80=99t dete= rmine the right name because it doesn=E2=80=99t know about it yet.) Maybe it=E2=80=99s an acceptable limitation though. I=E2=80=99ll see how I can tweak the code so that the CPU detection code an= d the micro-architecture name validation code can share a single list of names. > Maybe the (guix cpu) and (gnu platform) modules should be merged somehow > to define the supported CPU micro-architectures: > > (define armv7-linux > (platform > (target "arm-linux-gnueabihf") > (system "armhf-linux") > (linux-architecture "arm") > (supported-march '("armv7" "armv7-a" "armv7ve")) > > we could then use those platform records in the (gnu ci) module to build > packages against all the supported micro architectures and remove the > "%x86-64-micro-architecture" variable you propose to introduce there. Hmm yeah, but it should be (guix platforms) then=E2=80=A6 Maybe that=E2=80=99s a broader refactoring we can keep for later? I agree = it would be logical but I=E2=80=99m not sure how to nicely factorize things. Thanks, Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Dec 2021 12:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163879533028757 (code B ref 52283); Mon, 06 Dec 2021 12:56:01 +0000 Received: (at 52283) by debbugs.gnu.org; 6 Dec 2021 12:55:30 +0000 Received: from localhost ([127.0.0.1]:60754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muDWj-0007Tl-UQ for submit@debbugs.gnu.org; Mon, 06 Dec 2021 07:55:30 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:53871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muDWe-0007TV-UQ for 52283@debbugs.gnu.org; Mon, 06 Dec 2021 07:55:28 -0500 Received: by mail-wm1-f48.google.com with SMTP id y196so8039154wmc.3 for <52283@debbugs.gnu.org>; Mon, 06 Dec 2021 04:55:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=sdNy3KhraPy3awezdLp+n5HWJf+viFJ5WoB8B3Qna2s=; b=WfdMTYXFpd5HO7Yn3UNp1qr6Htl0c0daxhTljTDy/cNpQyJ9Q3Wy2ZsUFzqwHu7r9o Nb6RGi5SOOUgMyJGkAOj6A4nA8BwqWoGhE8SUtVwsr1rvM99Q8dAgTxcQHamztDQM7Ih gapg5cKmyEH8fY/Q1ozGs0TjBTzn3poGmaRyK2tAOL+4S0S5JyiCQy/HWUYwsHBkrMUD kt1fTZY2Aj0lnNBNpJVP/WoNyIJehcteT8dmGM8cSZqe17R8AGfQCpoxpAHM6n3n6u87 fQ4GXJu0aWLOH3uIEqOW2GTHOBUvW/BjkpUqU7GtlzdAts85zoQ4uK7p2uooZR0mUBaa KPMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=sdNy3KhraPy3awezdLp+n5HWJf+viFJ5WoB8B3Qna2s=; b=WelX+XvyA+wFCZGDep5/sPnnbz/kVII1dMoTL7gGmtSWfr77S0z6NOojxRL6ST4nm6 dglNkszgkVRYUJqznW3mcMyj2n9FxWB55AaJGV0rlrGggRLhEYB+nk5Mpr5sw8czrZrn osQon60ot9ce471sZdCbwfZkwEhxR7hqV9KxhILBTsu9uj7rgtKND5jxbew/C4MBqqDV wsVhQ2BEDKp5WlapBAmVP/H9QTpuaGw1+6albfZCF5lBfmqGgQ5JHa93CoV43gYcM6jH 89UeIqPjepEyQF9xPKPNGasaELuVjwTimGZqiONydddlBanDPSbdG8PZ/sEJXgABlJkQ wkNw== X-Gm-Message-State: AOAM530rZcArwdDxYBJBDq06xo6/O1uZ57oNF4ITDIm6Y8sLDvtcDLRm YhqOcwhaBXiC2qHRDT1LmR9NgB0/A7I= X-Google-Smtp-Source: ABdhPJzZls2+rhPlVZYK5aR59pP4W23ZgLMUZjl4HcBbSshptJ1bUrj11dZ5R4POCXll6skLXGxWDA== X-Received: by 2002:a1c:f20e:: with SMTP id s14mr39526189wmc.186.1638795318887; Mon, 06 Dec 2021 04:55:18 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u13sm15334047wmq.14.2021.12.06.04.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Dec 2021 04:55:18 -0800 (PST) From: zimoun In-Reply-To: <87zgpeqaq5.fsf_-_@gnu.org> References: <20211204203447.15200-1-ludo@gnu.org> <20211204204924.15581-1-ludo@gnu.org> <87czmb1m8a.fsf_-_@gnu.org> <87zgpeqaq5.fsf_-_@gnu.org> Date: Mon, 06 Dec 2021 13:47:08 +0100 Message-ID: <86zgpdoq7n.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludo, Really cool! Thanks! On Mon, 06 Dec 2021 at 11:38, Ludovic Court=C3=A8s wrote: > Mathieu Othacehe skribis: >>> +(define-record-type >>> + (cpu architecture family model flags) >>> + cpu? >>> + (architecture cpu-architecture) ;string, from 'uname' >>> + (family cpu-family) ;integer >>> + (model cpu-model) ;integer >>> + (flags cpu-flags)) ;set of strings >> >> When using the "--tune" transformation option with "native", we can >> expect the current-cpu method to fill the record correctly. >> >> However, when the user is passing a custom cpu name, it might be >> incorrect. I think we should check the user input against a list of >> valid/supported cpu architectures. [...] > Right. I=E2=80=99m a bit torn because I agree with the usability issue a= nd > solution you propose, but at the same time I know that maintaining a > list of existing CPU names will be tedious and it=E2=80=99ll be annoying = for > users if they can=E2=80=99t just specify their CPU name (which they might= want > to do precisely when =E2=80=98--tune=3Dnative=E2=80=99 doesn=E2=80=99t de= termine the right name > because it doesn=E2=80=99t know about it yet.) I have not looked at all the details but this list of existing CPU name is not somehow already maintained, no? --8<---------------cut here---------------start------------->8--- +(define (cpu->gcc-architecture cpu) + "Return the architecture name, suitable for GCC's '-march' flag, that +corresponds to CPU, a record as returned by 'current-cpu'." + (match (cpu-architecture cpu) + ("x86_64" + ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.c. + (or (and (=3D 6 (cpu-family cpu)) ;the "Pentium Pro" fa= mily + (letrec-syntax ((model (syntax-rules (=3D>) + ((_) #f) + ((_ (candidate =3D> integers ...) = rest + ...) + (or (and (=3D (cpu-model cpu) int= egers) + candidate) + ... + (model rest ...)))))) + (model ("bonnel" =3D> #x1c #x26) + ("silvermont" =3D> #x37 #x4a #x4d #x5a #x5d) + ("core2" =3D> #x0f #x17 #x1d) + ("nehalem" =3D> #x1a #x1e #x1f #x2e) + ("westmere" =3D> #x25 #x2c #x2f) + ("sandybridge" =3D> #x2a #x2d) + ("ivybridge" =3D> #x3a #x3e) + ("haswell" =3D> #x3c #x3f #x45 #x46) + ("broadwell" =3D> #x3d #x47 #x4f #x56) + ("skylake" =3D> #x4e #x5e #x8e #x9e) + ("skylake-avx512" =3D> #x55) ;TODO: cascadelake + ("knl" =3D> #x57) + ("cannonlake" =3D> #x66) + ("knm" =3D> #x85)))) --8<---------------cut here---------------end--------------->8--- >> Maybe the (guix cpu) and (gnu platform) modules should be merged somehow >> to define the supported CPU micro-architectures: >> >> (define armv7-linux >> (platform >> (target "arm-linux-gnueabihf") >> (system "armhf-linux") >> (linux-architecture "arm") >> (supported-march '("armv7" "armv7-a" "armv7ve")) >> >> we could then use those platform records in the (gnu ci) module to build >> packages against all the supported micro architectures and remove the >> "%x86-64-micro-architecture" variable you propose to introduce there. > > Hmm yeah, but it should be (guix platforms) then=E2=80=A6 > > Maybe that=E2=80=99s a broader refactoring we can keep for later? I agre= e it > would be logical but I=E2=80=99m not sure how to nicely factorize things. Yeah, I am always annoyed for the arguments of =E2=80=99-s=E2=80=99 vs =E2= =80=99-t=E2=80=99, aside the ugly backtrace. :-) The same (as we do elsewhere) is to somehow have options =E2=80=99--list-systems=E2=80=99 and =E2=80=99--list-targets=E2=80= =99 and handle incorrect values; similar to =E2=80=9Cguix lint=E2=80=9D for checkers or =E2=80=9Cgui= x graph=E2=80=9D for types or backends, etc. With potentially some hints. :-) I also agree that=E2=80=99s unrelated to the current series. :-) This refactoring could happen later, IMHO. Cheers, simon From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Dec 2021 16:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163880935232436 (code B ref 52283); Mon, 06 Dec 2021 16:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 6 Dec 2021 16:49:12 +0000 Received: from localhost ([127.0.0.1]:35231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muHAj-0008Qj-Uh for submit@debbugs.gnu.org; Mon, 06 Dec 2021 11:49:11 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:64976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muHAT-0008Q6-Mf for 52283@debbugs.gnu.org; Mon, 06 Dec 2021 11:49:00 -0500 IronPort-HdrOrdr: A9a23:E+zjGawaipnmUNjNIVjSKrPwNb1zdoMgy1knxilNoHtuH/Bw9vrFoB11737JYVoqM03I5+rvBEDwex/hHPdOiOEs1NyZMzUO1lHJEGgb1/qA/wHd X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="400367926" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 17:48:39 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204203447.15200-1-ludo@gnu.org> <20211204204924.15581-1-ludo@gnu.org> <87czmb1m8a.fsf_-_@gnu.org> Date: Mon, 06 Dec 2021 17:48:39 +0100 In-Reply-To: <87czmb1m8a.fsf_-_@gnu.org> (Mathieu Othacehe's message of "Sun, 05 Dec 2021 09:37:09 +0100") Message-ID: <87o85tllw8.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-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mathieu Othacehe skribis: > However, when the user is passing a custom cpu name, it might be > incorrect. I think we should check the user input against a list of > valid/supported cpu architectures. BTW, there=E2=80=99s another constraint: the list of valid names depends on= the compiler used. GCC 11 recognizes =E2=80=98x86-64-v[1234]=E2=80=99 for inst= ance, but earlier versions do not. We could hard-code the list of known identifiers for the default GCC, but if users resort to =E2=80=98--with-c-toolchain=E2=80=99 to get a newer = toolchain, they won=E2=80=99t be able to use the newer CPU identifiers. Maybe an acceptable drawback. Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Dec 2021 23:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: 52283@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163883274823805 (code B ref -1); Mon, 06 Dec 2021 23:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Dec 2021 23:19:08 +0000 Received: from localhost ([127.0.0.1]:35652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muNGG-0006Bt-7i for submit@debbugs.gnu.org; Mon, 06 Dec 2021 18:19:08 -0500 Received: from lists.gnu.org ([209.51.188.17]:59700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muNGB-0006BV-18 for submit@debbugs.gnu.org; Mon, 06 Dec 2021 18:19:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muNGA-0001X4-RL for guix-patches@gnu.org; Mon, 06 Dec 2021 18:19:02 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:4534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muNG8-0006Gv-RK; Mon, 06 Dec 2021 18:19:02 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id B4AD3DF8; Tue, 7 Dec 2021 00:18:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1638832738; x=1640647139; bh=b2Ptuktensnw2rByD4FX3iaXX3HfRq0Gvtq Qp0JazNY=; b=iQHA0OqSF29P8kcG5+Nfh9CdO+b2jq8wFZ+bXPF/vIgZ1mNU3oi vSnL9FnbCArH0Y2ZYKPnyFZEaRRYIS6ONrE9d9GezNvRX4THbMTHJlvcg/jM7FB2 xyi75Cm0bbTy6qYqd69ge+Aq+Sc+U8q/gGfOh8ay6/EzdiaJG3ADNqu9p8y4U6hs Fh5JYuqtj60elY/R58qdGizU/91p3O07BUtAdBA50X/R37qgloNoDu2V3fo9hafP 5mLumJMiifnASeNs8mL7CQJo1PohY6ApU2kVtiV1dq5lVjc/vSpcSoVPGHQ3+Nre EWcPtrK9W87MDDEY0vbYbUYm83QTgtcqvGVuLAEnZ5igcsJeSld3vPcGVz0Q1bgi soixTrYGiRiu4vaoz92l34wa+gyjZ8ubWjXL8XD6EGY6WJ3i+QsIJpic04KdGD6Q PjSQHyWlmeBOWtpEvM0QD8ysZnmRsO0rN/uEYkkcb/wg6F61POBLB5UtWzEI5thf ecsfV6bsGeFxIrKNjN0wZFVdtddI7DO/If81p01VJRDdFnWSCzLvHwKMzsgSC3+z OZ7EUIEIco4SYYrtO+vMo7c569Ai4uVLDQkyJCIXJwImqOP2/cOuplJ71aBy2W+K WU9ZXGa0Hl3ZOminzQuXgJ5iuIdc04YAZO4PyVazETux8Ihklb/Ta13I= X-Virus-Scanned: amavisd-new at mykolab.com X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-10 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZAZ6q9mNy0jK; Tue, 7 Dec 2021 00:18:58 +0100 (CET) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by mx.kolabnow.com (Postfix) with ESMTPS id 4587BA30; Tue, 7 Dec 2021 00:18:58 +0100 (CET) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 140E271A9; Tue, 7 Dec 2021 00:18:56 +0100 (CET) From: Thiago Jung Bauermann Date: Mon, 06 Dec 2021 20:18:51 -0300 Message-ID: <7364829.rrRS6mQaNJ@popigai> In-Reply-To: <20211204204924.15581-2-ludo@gnu.org> References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=212.103.80.154; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hello Ludo, Awesome series! I only have comments about this patch, and then only minor= =20 ones: Em s=C3=A1bado, 4 de dezembro de 2021, =C3=A0s 17:49:16 -03, Ludovic Court= =C3=A8s=20 escreveu: > +Tuned packages are @emph{grafted} onto packages that depend on them > +(@pxref{Security Updates, grafts}). Thus, using @option{--no-grafts} > +annihilates the effect of @option{--tune}. Perhaps this is because English isn=E2=80=99t my first language, but annihi= lation=20 seems like a violent and dramatic effect in a package transformation. :-) Perhaps reword as =E2=80=9Ccancels=E2=80=9D, =E2=80=9Cinvalidates=E2=80=9D = or "nullifies"? > +(define (tuned-package p micro-architecture) > + "Return package P tuned for MICRO-ARCHITECTURE." > + (define compiler > + (tuning-compiler micro-architecture)) > + > + (package > + (inherit p) > + (native-inputs > + ;; Arrange so that COMPILER comes first in $PATH. > + `(("tuning-compiler" ,compiler) > + ,@(package-native-inputs p))) > + (arguments > + (substitute-keyword-arguments (package-arguments p) > + ((#:tests? _ #f) #f))) Perhaps I=E2=80=99m reading this wrong, but it looks like tuned packages do= n=E2=80=99t run=20 their testsuites? If so, this is a surprising side-effect and thus it would= =20 be nice to have it mentioned in the manual, possibly also in a comment=20 here. It would be nice to also mention the rationale for disabling the=20 tests (not sure whether only in a comment here or if in the manual as=20 well). I assume it=E2=80=99s for convenience, but I=E2=80=99m not sure. =2D-=20 Thanks, Thiago From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 08:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Thiago Jung Bauermann Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.16388643083634 (code B ref 52283); Tue, 07 Dec 2021 08:06:01 +0000 Received: (at 52283) by debbugs.gnu.org; 7 Dec 2021 08:05:08 +0000 Received: from localhost ([127.0.0.1]:36277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muVTH-0000wX-6m for submit@debbugs.gnu.org; Tue, 07 Dec 2021 03:05:07 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:14152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muVTD-0000vv-Eo for 52283@debbugs.gnu.org; Tue, 07 Dec 2021 03:05:05 -0500 IronPort-Data: A9a23:Gfxdr6qPo79ckWM0Ej0kdHaWOb9eBmIzZxIvgKrLsJaIsI5as4F+vjMfX23TPqyDMTT3f9EjYY6/8R5VuJfRnYRiTlRp+yk3QiMRo6IpJ/zJdxaqZ3v6wu7rFR88sZ1GMrEsFC2FJ5Pljk/F3oPJ8D8sislkepKmULSdY3opGlc9IMscoUkLd9AR09cAbeeRU1vlVePa+6UzCXf9s9JGGjp8B5Gr9HuDiM/PVAYw5TTSUxzkUGj2zBH5BLpHTU24wuCRroN8RoZWTM6bpF21E/+wwvsjNj+luu6TnkwiWL/YNw+I4pZUc/Hz2V4f/mpri/59baBEAatUo2zhc9RZzMhBsoKxQkEiObDWhOkGexheCSB3e6NckFPCCSju7ZXNlxGun3zEhq8G4FsNFdBCoLYsKW1D//YFJytLYRaeweWsz9qTQOBxi94mJc/tFIAYvnhqyzbGS/0hRPj+rw/ijTND9G5h3YYTRbCHPpJfMGA3BCksqiZnYj8/YK/SVs/x7pUnTwBllQ== IronPort-HdrOrdr: A9a23:9owgCKzASbmVgkLPh/0GKrPw9L1zdoMgy1knxilNoH1uA7WlfqWV9oVi6faasl0ssR0b9exoe5PwJk80jKQFg7X5ZI3SOTUO21HYSr2Kj7GC/9SIIUSXygc678hdmsNFZuEYY2IWsS5hizPId+oI8Z2Kzajtuf3T1B5WPGJXQpAl4zpwTgySFlR/RAdAbKBYKKah X-IronPort-AV: E=Sophos;i="5.87,293,1631570400"; d="scan'208";a="8941604" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 09:04:57 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> <7364829.rrRS6mQaNJ@popigai> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 Frimaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 07 Dec 2021 09:04:56 +0100 In-Reply-To: <7364829.rrRS6mQaNJ@popigai> (Thiago Jung Bauermann's message of "Mon, 06 Dec 2021 20:18:51 -0300") Message-ID: <871r2olu1j.fsf@inria.fr> 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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Thiago, Thiago Jung Bauermann skribis: > Em s=C3=A1bado, 4 de dezembro de 2021, =C3=A0s 17:49:16 -03, Ludovic Cour= t=C3=A8s=20 > escreveu: >> +Tuned packages are @emph{grafted} onto packages that depend on them >> +(@pxref{Security Updates, grafts}). Thus, using @option{--no-grafts} >> +annihilates the effect of @option{--tune}. > > Perhaps this is because English isn=E2=80=99t my first language, but anni= hilation=20 > seems like a violent and dramatic effect in a package transformation. :-) > > Perhaps reword as =E2=80=9Ccancels=E2=80=9D, =E2=80=9Cinvalidates=E2=80= =9D or "nullifies"? Not a native speaker either but yes, =E2=80=9Ccancels=E2=80=9D sounds bette= r; I=E2=80=99ll change that. >> +(define (tuned-package p micro-architecture) >> + "Return package P tuned for MICRO-ARCHITECTURE." >> + (define compiler >> + (tuning-compiler micro-architecture)) >> + >> + (package >> + (inherit p) >> + (native-inputs >> + ;; Arrange so that COMPILER comes first in $PATH. >> + `(("tuning-compiler" ,compiler) >> + ,@(package-native-inputs p))) >> + (arguments >> + (substitute-keyword-arguments (package-arguments p) >> + ((#:tests? _ #f) #f))) > > Perhaps I=E2=80=99m reading this wrong, but it looks like tuned packages = don=E2=80=99t run=20 > their testsuites? If so, this is a surprising side-effect and thus it wou= ld=20 > be nice to have it mentioned in the manual, possibly also in a comment=20 > here. It would be nice to also mention the rationale for disabling the=20 > tests (not sure whether only in a comment here or if in the manual as=20 > well). I assume it=E2=80=99s for convenience, but I=E2=80=99m not sure. I agree, a comment and maybe a sentence in the manual would be welcome. The reason the test suite is skipped is because we cannot know for sure whether the machine that hosts the daemon is able to run code for this specific micro-architecture. The test suite runs in the =E2=80=9Cbaseline=E2=80=9D package build anyway,= so assuming the compiler works fine, skipping the test suite on tuned builds is okay. Thanks for your feedback! Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 08:41:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.16388664046890 (code B ref 52283); Tue, 07 Dec 2021 08:41:03 +0000 Received: (at 52283) by debbugs.gnu.org; 7 Dec 2021 08:40:04 +0000 Received: from localhost ([127.0.0.1]:36313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muW15-0001n3-RP for submit@debbugs.gnu.org; Tue, 07 Dec 2021 03:40:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muW13-0001mU-Ek for 52283@debbugs.gnu.org; Tue, 07 Dec 2021 03:40:02 -0500 Received: from [2001:470:142:3::e] (port=60632 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muW0x-0006PF-LZ; Tue, 07 Dec 2021 03:39:55 -0500 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=wvuHOQYLT2rBkRcJxOhrM1fXE7iNakyEVFtYGrankOk=; b=C8O11iO1h/ufLbgstVdx m7TLVTpQaaG8CHzbKPoDZeax5xLMoIphXDGN4gBjEemlvyRA8JC9jMz+pXwAgisrL/FHsQSVd9pJK WA8h/nXNFW1+QZrn5bbD+QQiM4xFrfkN4Qu8R/hZBIYBaveXaajVprbTxSH+isYXbdt64IJdnbTZc ugyaTNaXOD8smA7pJT8ZVIzu7eIoXCu+yTFHoAJ3+pXa6Vcz6DxCgPqvoS06fxJEykufKj+NL7/7o VEFqZNRAI34C4mlpSiZZYG8UfQ+TYL1xvW0+zCrTLB8q5NnaFCz8wqNLnk4i+0V02vSA8hCXMtZLV x5hTUIF5ZZjCEw==; Received: from [2a01:e0a:19b:d9a0:2ddb:d3d2:32e8:d31a] (port=48978 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muW0x-00063u-Fd; Tue, 07 Dec 2021 03:39:55 -0500 From: Mathieu Othacehe References: <20211204203447.15200-1-ludo@gnu.org> <20211204204924.15581-1-ludo@gnu.org> <87czmb1m8a.fsf_-_@gnu.org> <87zgpeqaq5.fsf_-_@gnu.org> Date: Tue, 07 Dec 2021 09:39:53 +0100 In-Reply-To: <87zgpeqaq5.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 06 Dec 2021 11:38:42 +0100") Message-ID: <87lf0wst9i.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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey, > Hmm yeah, but it should be (guix platforms) then=E2=80=A6 > > Maybe that=E2=80=99s a broader refactoring we can keep for later? I agre= e it > would be logical but I=E2=80=99m not sure how to nicely factorize things. Yes sure, I agree that this refactoring can be done later just something that we can keep in mind. Having a look to Nix, looks like they are also maintaining some kind of architecture list: https://github.com/NixOS/nixpkgs/blob/master/lib/systems/architectures.nix Thanks, Mathieu From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 09:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.16388677839253 (code B ref 52283); Tue, 07 Dec 2021 09:04:02 +0000 Received: (at 52283) by debbugs.gnu.org; 7 Dec 2021 09:03:03 +0000 Received: from localhost ([127.0.0.1]:36342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muWNL-0002PA-5o for submit@debbugs.gnu.org; Tue, 07 Dec 2021 04:03:03 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:21231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muWNI-0002Of-8X for 52283@debbugs.gnu.org; Tue, 07 Dec 2021 04:03:01 -0500 IronPort-Data: A9a23:u0omYa66pnbzmRcV8IPMSAxRtBTFchMFZxGqfqrLsXjdYENS1zxUyGMdCjrQM/jZNmH1et0lPIiw8ENXupLTytdrHVQ5pCpnJ55ogZqcVI7Bdi8cHAvLc5adFBo/hykmh2ipwPkcFhcwnT/wdOi+xZVA/fvQHOOlUrabYnoZqTJME0/NtzoywobVvaY42bBVMyvV0T/Di5W31G2Ng1aYAUpIg063ky6Didyp0N8uUvPSUtgQ1LPWvyF94JvyvshdJVOgKmVfNrbSq+ouUNiEEm3lExcFUrtJk57hc0cARbi60Qqm0ysNHfX6xEEb/mpriP5T2Pk0MC+7jx2Ngtx21tRG85e3VB01M7bkmeIHUhAeHTsW0ahuqO6ZfCnk6aR/yGWDKRMA2c5GURtsbdYw9ut9C3xB7roXLi1LaQqM78qx3LKyQeRsi+wsKtStO5kQ0kyMZxmx4e0OGMGYBfiSo4YBhHFp3JgmIBoXXOJBARIHUfgKS0ETUrvPNK8DoQ== IronPort-HdrOrdr: A9a23:OtBvwqHIL0mYMtx5pLqECseALOsnbusQ8zAXPo5KJCC9Ffbo7fxG/c5rriMc5wxhPE3I9erqBEDEewK6yXcX2/hoAV7BZniBhILAFugL0WKh+VLd8kbFmtK1u50LT0EzMqyIMXFKyeDBiTPIduoI8Z2/3pntqufYwXt3VBprbLwI1XYaNi+rVnRZfU1lCYpRLuv+2uN34wOPQDA0YtT+JlRtZYj+juyOr574ZxsbGh4g7wGUnXeE4KP3eiL44j4uFw915N4Zn1T4rw== X-IronPort-AV: E=Sophos;i="5.87,293,1631570400"; d="scan'208";a="8965930" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 10:02:47 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204203447.15200-1-ludo@gnu.org> <20211204204924.15581-1-ludo@gnu.org> <87czmb1m8a.fsf_-_@gnu.org> <87zgpeqaq5.fsf_-_@gnu.org> <87lf0wst9i.fsf_-_@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 Frimaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 07 Dec 2021 10:02:46 +0100 In-Reply-To: <87lf0wst9i.fsf_-_@gnu.org> (Mathieu Othacehe's message of "Tue, 07 Dec 2021 09:39:53 +0100") Message-ID: <87sfv4kcsp.fsf@inria.fr> 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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Mathieu Othacehe skribis: > Yes sure, I agree that this refactoring can be done later just something > that we can keep in mind. Having a look to Nix, looks like they are > also maintaining some kind of architecture list: > > https://github.com/NixOS/nixpkgs/blob/master/lib/systems/architectures.nix Interesting. The list of features might be an idealized view, compared what I=E2=80=99ve seen in GCC. I wonder how this is supposed to be used. Their compiler wrapper (build-support/cc-wrapper/default.nix) passes =E2=80=98-march=3D${targetPlatform.gcc.arch}=E2=80=99 so maybe users can so= mehow override that =E2=80=98gcc.arch=E2=80=99 attribute? Any Nix-savvy person here? It also has a nice compatibility list: --8<---------------cut here---------------start------------->8--- # older compilers (for example bootstrap's GCC 5) fail with -march=3Dtoo-= modern-cpu isGccArchSupported =3D arch: if isGNU then { # Intel skylake =3D versionAtLeast ccVersion "6.0"; skylake-avx512 =3D versionAtLeast ccVersion "6.0"; cannonlake =3D versionAtLeast ccVersion "8.0"; icelake-client =3D versionAtLeast ccVersion "8.0"; icelake-server =3D versionAtLeast ccVersion "8.0"; cascadelake =3D versionAtLeast ccVersion "9.0"; cooperlake =3D versionAtLeast ccVersion "10.0"; tigerlake =3D versionAtLeast ccVersion "10.0"; knm =3D versionAtLeast ccVersion "8.0"; # AMD znver1 =3D versionAtLeast ccVersion "6.0"; znver2 =3D versionAtLeast ccVersion "9.0"; znver3 =3D versionAtLeast ccVersion "11.0"; }.${arch} or true else if isClang then { # Intel cannonlake =3D versionAtLeast ccVersion "5.0"; icelake-client =3D versionAtLeast ccVersion "7.0"; icelake-server =3D versionAtLeast ccVersion "7.0"; knm =3D versionAtLeast ccVersion "7.0"; # AMD znver1 =3D versionAtLeast ccVersion "4.0"; znver2 =3D versionAtLeast ccVersion "9.0"; }.${arch} or true else false; --8<---------------cut here---------------end--------------->8--- The compiler wrapper in this patch series doesn=E2=80=99t know what compiler it=E2=80=99s wrapping (it=E2=80=99s just calling the next one in $PATH), so= it can=E2=80=99t really do this sort of things. We could do it differently but I liked the simplicity of just dropping the wrapper in front of $PATH. Thanks, Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 00/10] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 09:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163886842410220 (code B ref 52283); Tue, 07 Dec 2021 09:14:01 +0000 Received: (at 52283) by debbugs.gnu.org; 7 Dec 2021 09:13:44 +0000 Received: from localhost ([127.0.0.1]:36356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muWXg-0002em-Kt for submit@debbugs.gnu.org; Tue, 07 Dec 2021 04:13:44 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:24467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muWXf-0002eW-Q0 for 52283@debbugs.gnu.org; Tue, 07 Dec 2021 04:13:44 -0500 IronPort-Data: A9a23:xfHHFKlZjL7qIoa8opW6AD3o5gySJERdPkR7XQ2eYbTBsI5bpzIPm2MZCmyPafyPYmDyeowja4S2/UkFvZLTx9NhQAFv+CA2RRqmi+KVXIXDdh+Y0wC6d5CYEho/t63yUjRxRSwNZie0SiyFb/6x8hGQ6YnSHuClUbScZXgrLeNZYHxJZSxLyrdRbrFA0YDR7zOl4bsekuWHULOX82Yc3lE8t8pvnChSUMHa41v0iLCRicdj5zcyn1FNZH4WyDrYw3HQGuG4FcbiLwrPIS3Qw4/Xw/stIovNfrfTaEwASLnUVeSMoiMHAO7/2l4b/3R0i/xjXBYfQR4/ZzGhm819z8tMvtq7ThozIqDXsOUbSRhRVS9kVUFD0O+WfiLn4ZX7I0ruNiGEL+9VJBxsZ91D0up6C2tT+udeJzYQKBeZiIqLLBiTIgV3rp1yd4+2ZMVG4ykmlGuBZcvKiKvrG83ijeK0Fh9q7iyWIcvjWg== IronPort-HdrOrdr: A9a23:tlyy8qoXFOwvpUT3/cRMpUYaV5pMeYIsimQD101hICG9Ffb2qynOppkmPHDP+VUssR0b+OxoW5PtfZq/z+8W3WB5B97LN2PbUQCTQr2Kg7GD/wHd X-IronPort-AV: E=Sophos;i="5.87,293,1631570400"; d="scan'208";a="8972081" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 10:13:37 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204203447.15200-1-ludo@gnu.org> Date: Tue, 07 Dec 2021 10:13:37 +0100 In-Reply-To: <20211204203447.15200-1-ludo@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 4 Dec 2021 21:34:47 +0100") Message-ID: <87lf0wkcam.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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! To make it easier to test, I pushed this v1 as =E2=80=98wip-cpu-tuning=E2= =80=99 so one can run, say: guix time-machine --branch=3Dwip-cpu-tuning -- \ shell eigen-benchmarks --tune -- \ benchBlasGemm 16 16 16 100 100 Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 10:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 52283@debbugs.gnu.org, Thiago Jung Bauermann Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163887316517677 (code B ref 52283); Tue, 07 Dec 2021 10:33:01 +0000 Received: (at 52283) by debbugs.gnu.org; 7 Dec 2021 10:32:45 +0000 Received: from localhost ([127.0.0.1]:36429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muXm9-0004b3-Fy for submit@debbugs.gnu.org; Tue, 07 Dec 2021 05:32:45 -0500 Received: from mail-il1-f173.google.com ([209.85.166.173]:37453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muXm6-0004ak-EJ for 52283@debbugs.gnu.org; Tue, 07 Dec 2021 05:32:44 -0500 Received: by mail-il1-f173.google.com with SMTP id h16so13303435ila.4 for <52283@debbugs.gnu.org>; Tue, 07 Dec 2021 02:32:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=p4UgCCA+W9NpcYrriHV6s8RWDV6mK5kXWj12GSnMYZo=; b=L6PYSwPa+9mUT9xIqCETUw4y3o1hoOSiw5bBCxEbLcitYFNSAItotncUY7Wv7t2cX3 EN9aioch3R24taqB0l33WKw8A08pWM7ygfQBjCQIvSsoLMfxSvFLJ9RcgDbF+zXMLCmR JvaTVts+8MGUO685eJ1R958SW7Fb6mo34y5bML6WrbadiJRiDX/JK0DUGWb513eqEdFM luZHR8j5wn1zgqq74r6GULAalTJwQL0d4QtyFnQQ8nYnm+MdB0TNHstLO1785fv7WR8f aZft8jOzB+S0yt9n6sOi8D+ArGN7eLCky+q3YxKE4JuZC14FWKBeK8BgIqFcrYwQMAIN bp2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=p4UgCCA+W9NpcYrriHV6s8RWDV6mK5kXWj12GSnMYZo=; b=WFosaiy1Tq5Pvfl2iz4bhmxtxN+BEOPelw29lRliT6jmcdh/9xn/W+uiv1mwKS6zXG j3q3mKDrJUDMJ6zKPVJN/bfXN2VivgvaI5S7YZMmHQKV6bXA6im8JwdIeiDEfX3EyE6G R7YOoeNMFlM45IteW5br3ie/CrLc3tZOJR1raiN9w23lmqLUmpIOWiTIAWbXNyI6GjdN zUb0BnoLoyQ0LEeYKI8CJpmvAHRDBXM/T/j9I5mIvAxuC5rTkmhIfk22Uym/LabK+N4D X+NCDj2gpeucMerGN2BpKc2EG7vhJBMBJH42z57yd3aCZy82pby8VtXVdSpqvebe1Nnq wmWw== X-Gm-Message-State: AOAM533gD4BxgQF45BXHXh4bXRC9g3rZXtwefzerHVefNtKUtWQZZroe TxGfb0Lf40EupL9TZcNf2TGTuLvdOT/x57AVKIc= X-Google-Smtp-Source: ABdhPJxcTIJ66Iecj+mlaZ/XVUmArEI6kUg0asT4LX2V9tj9QHgXktv0GUtCCdDpp6jKiN3eDrs9KhGJXKfP72lldNk= X-Received: by 2002:a92:1903:: with SMTP id 3mr41097349ilz.82.1638873156873; Tue, 07 Dec 2021 02:32:36 -0800 (PST) MIME-Version: 1.0 References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> <7364829.rrRS6mQaNJ@popigai> <871r2olu1j.fsf@inria.fr> In-Reply-To: <871r2olu1j.fsf@inria.fr> From: zimoun Date: Tue, 7 Dec 2021 11:32:25 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Tue, 7 Dec 2021 at 09:06, Ludovic Court=C3=A8s wrote: > The reason the test suite is skipped is because we cannot know for sure > whether the machine that hosts the daemon is able to run code for this > specific micro-architecture. Naive question: is it possible to effectively run it via emulation? > The test suite runs in the =E2=80=9Cbaseline=E2=80=9D package build anywa= y, so assuming > the compiler works fine, skipping the test suite on tuned builds is > okay. I miss if the test suite is effectively run somewhere? And "baseline" package build means the package built for generic architecture, right? Cheers, simon PS: My questions are coming from Julia packages in mind, where the test suite is the only way to know all is fine. And many times, add System Image for Julia had been discussed and basically this System Image is precompilation (generic one or specialized for micro-architecture). Therefore, maybe this new 'tune' transformation would fit the bill. :-) https://docs.julialang.org/en/v1/devdocs/sysimg/ From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 14:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 52283@debbugs.gnu.org, Thiago Jung Bauermann Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.16388887805126 (code B ref 52283); Tue, 07 Dec 2021 14:53:01 +0000 Received: (at 52283) by debbugs.gnu.org; 7 Dec 2021 14:53:00 +0000 Received: from localhost ([127.0.0.1]:36963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mubq0-0001Kc-21 for submit@debbugs.gnu.org; Tue, 07 Dec 2021 09:53:00 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:9369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mubpu-0001K7-Ls for 52283@debbugs.gnu.org; Tue, 07 Dec 2021 09:52:58 -0500 IronPort-Data: A9a23:iYM9P6PLYKkLgtbvrR1plcFynXyQoLVcMsFnjC/WdQa/1Tgn0TZTyTBJX22CPvqINjP9ctF1PoS2/U5XsZHWm99gGjLY11k9FiMQ8ZKt6fexdxqrYXvKdqUvdK/WhiknQoGowPscEzmM+X9BDpC79SMljPvQGeKmYAL5EnsZqTFMGX5JZS1Ly7ZRbr5A2bBVMivV0T/Ai5W31GyNh1aYBlkpB5er83uDihhdVAQw5TTSbdgT1LPXeuJ84Jg3fcldJFOgKmVY83LTegrN8F251juxExYFENKvmLH9GqEIaueDZk7T0jwPAvDk20IazsAx+v9T2P40bVpbjCuIlJZ6z8hXqZGrYQYvJKzF3uoHO/VdO3AnZvAeo+6vzX+X9Jb7I1f9Wya2maU1JE07N4cF9f0xDmdTs/sCJ1glZBmeivizybS9Yuprgs0pKs70eogYvxlI3zDcCvBgXZfeX6LX49Jw0zI5h8QIFvHbD/f1wxIHgA/oOkwUfApPTstnxKHx3CGXTtGRk3rNzYJf3oQZ5FAtuFQ1DOfoRw== IronPort-HdrOrdr: A9a23:/jnjNq8tK/sHm6lES89uk+FSdb1zdoMgy1knxilNoENuH/BwxvrFoB1E73TJYW4qKQgdcdDpAtjifZquz+8M3WBxB8brYOCCggeVxe5ZnOzfKlHbehEWldQtnpuIEZIObuEYZGIS5amV3ODSKadD/DDzytHNuQ6o9QYJcegFUcFdxjY8LjzePlx9RQFAC5Z8PoGb/NB7qz2pfmlSRtinB1EeNtKz6uHjpdbDW1orFhQn4A6BgXeD87jhCSWV2R8YTndm3aoiy27YiAb0j5/T/81TiyWsmFM73a4m2ecJ+eEzRPBkTfJlaQkEvzzYKriJnYfy/gzd7tvfrWrC2+O82CvId/4DkU85OFvF6ycFkjOQrQoG+jvsz0SVjmDkptG8TDUmC9BZjYYcaRfB7VE81esMp56j8ljpwqa/Nymw6BgVJuK4Ji1Chw6xuz4vgOQTh3tQXc8Xb6JQt5UW+AdQHI0bFCz35Yg7GK02Zfusrcp+YBefdTTUr2NvyNujUjA6GQqHWFELvoiQ3yJNlH50wkMEzIgUn2sG9pg6V55Yjt60RJhAhfVLVIsbfKh9DOAOTY++DXHMWwvFNCaILVHuBMg8SgDwQl7MkcYIDc2RCeM1JaoJ6eT8uQljxBIPkmrVeLOz4KE= X-IronPort-AV: E=Sophos;i="5.87,293,1631570400"; d="scan'208";a="9135039" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 15:52:46 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> <7364829.rrRS6mQaNJ@popigai> <871r2olu1j.fsf@inria.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 Frimaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 07 Dec 2021 15:52:44 +0100 In-Reply-To: (zimoun's message of "Tue, 7 Dec 2021 11:32:25 +0100") Message-ID: <875ys0jwlf.fsf@inria.fr> 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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) zimoun skribis: > On Tue, 7 Dec 2021 at 09:06, Ludovic Court=C3=A8s wrote: > >> The reason the test suite is skipped is because we cannot know for sure >> whether the machine that hosts the daemon is able to run code for this >> specific micro-architecture. > > Naive question: is it possible to effectively run it via emulation? Not to my knowledge. >> The test suite runs in the =E2=80=9Cbaseline=E2=80=9D package build anyw= ay, so assuming >> the compiler works fine, skipping the test suite on tuned builds is >> okay. > > I miss if the test suite is effectively run somewhere? Yes, for the default/generic/baseline package, when not using =E2=80=98--tu= ne=E2=80=99. > And "baseline" package build means the package built for generic > architecture, right? Correct. > My questions are coming from Julia packages in mind, where the test > suite is the only way to know all is fine. And many times, add System > Image for Julia had been discussed and basically this System Image is > precompilation (generic one or specialized for micro-architecture). > Therefore, maybe this new 'tune' transformation would fit the bill. > :-) > > https://docs.julialang.org/en/v1/devdocs/sysimg/ According to this page, =E2=80=98--tune=E2=80=99 won=E2=80=99t be necessary= here because Julia supports function multi-versioning for its =E2=80=9Csystem image=E2=80=9D: The system image can be compiled simultaneously for multiple CPU microarchitectures under the same instruction set architecture (ISA). Multiple versions of the same function may be created with minimum dispatch point inserted into shared functions in order to take advantage of different ISA extensions or other microarchitecture features. The version that offers the best performance will be selected automatically at runtime based on available CPU features. I guess we should follow the instructions at to build a system image that contains multiple versions of each function. Thanks, Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Dec 2021 15:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 52283@debbugs.gnu.org, Thiago Jung Bauermann Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163889237112806 (code B ref 52283); Tue, 07 Dec 2021 15:53:01 +0000 Received: (at 52283) by debbugs.gnu.org; 7 Dec 2021 15:52:51 +0000 Received: from localhost ([127.0.0.1]:38468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muclu-0003KT-Om for submit@debbugs.gnu.org; Tue, 07 Dec 2021 10:52:50 -0500 Received: from mail-io1-f43.google.com ([209.85.166.43]:38870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mucls-0003KG-Ta for 52283@debbugs.gnu.org; Tue, 07 Dec 2021 10:52:49 -0500 Received: by mail-io1-f43.google.com with SMTP id z18so17683725iof.5 for <52283@debbugs.gnu.org>; Tue, 07 Dec 2021 07:52:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=swT/mWeVRO6rmVpYll0pgnmMKkPSlK5clC7LzhyafHY=; b=e4O8c/8lef7w2TBzoHfe9cMvIXeMgdrFbRNLF9LQqdMaTDYCvfyFQHj/BI1UPZ/9j/ VudDOPP09DlHcpsOafQJxCLKfU/JBEdPq9tfgQl0YPs1DzWs/cFm4MIKebMj+JVQKTVJ kPfQUHCYYVvnuoPAUXQJRaOhsCAwsS8OceET8/qjDkrUc7ZAqGDR4PoHVhBuiBjzp3Tz lzdF6MMY23aAObdACIT0AAYrLTqGnEPHNWnsRs/VrrlnFkIjEd0UMxNxWrrrO+97VxM7 /hkSjphfiA7KWl9qvojTPVsDevR+Q2O1cur0LPrapTqKeYx8xzrOR0qAdBWnHjF/eEsV CN0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=swT/mWeVRO6rmVpYll0pgnmMKkPSlK5clC7LzhyafHY=; b=Q+FaULBZXr+yL9gSx9IhvrBpIOn8YBCHYt8+Cq3slF5cgGZJ42qlCXoIZSll1ESKM1 VBY9qT/NEnQeIf1+eynOrvMwIjfmPO7eR1mA8NkFTv/BcIfMHh62MNfWmbbrEaGj/gYw /G/zyeR/XS8iaI9QMGkigf1bklBKJeWarZBtERuvDt2VGumJvO/wqfheTPrNgyFrWLNH L0aUiBjMzjgoP8Yy3FOFEAD5isuw4A5cNc+NpMBAfGrO0kv69cbhFhGuS4Vsu7WzONxT MlBCzntb/4ipwzZTfGK70Bqbv4dPFZCzJW2aUDUWicQFpZ2t+T5yF8Ifn9V7tjwFP+Ad v3BQ== X-Gm-Message-State: AOAM531MfJjGolqcU9st0UOsvBpThrr4E4+qcaWK51nAPb9CzyuK7J9D unHu57+aoGsu+Hl4LsXEbIPkwJ3KPid1zpv8mE0= X-Google-Smtp-Source: ABdhPJwGRn/Hu0sRKEW0g18GxNbubYPEMVheWp8tkho6kj8V8sZFoxlU8tG1O7Ga8LW5fbAryOOLHOFqRnRcga6Dvok= X-Received: by 2002:a02:9586:: with SMTP id b6mr51972712jai.24.1638892363213; Tue, 07 Dec 2021 07:52:43 -0800 (PST) MIME-Version: 1.0 References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> <7364829.rrRS6mQaNJ@popigai> <871r2olu1j.fsf@inria.fr> <875ys0jwlf.fsf@inria.fr> In-Reply-To: <875ys0jwlf.fsf@inria.fr> From: zimoun Date: Tue, 7 Dec 2021 16:52:31 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Tue, 7 Dec 2021 at 15:52, Ludovic Court=C3=A8s wrote: > zimoun skribis: > >> The test suite runs in the =E2=80=9Cbaseline=E2=80=9D package build an= yway, so assuming > >> the compiler works fine, skipping the test suite on tuned builds is > >> okay. > > > > I miss if the test suite is effectively run somewhere? > > Yes, for the default/generic/baseline package, when not using =E2=80=98--= tune=E2=80=99. Assuming, the default/generic/baseline package is effectively built. :-) I imagine the scenario: I develop a new simulation tool, I package it for Guix, I share it; usually I run "guix shell -D" and do loop over "make" and "make check", then deploy using "guix build --tune". My colleague fetches it and want to run it on another cluster, i.e., they run "guix build --tune". The test suite for the generic/baseline is never run inside a clean environment. And as we know, this isolated part allows to detect many common issues; which are often source of "it works for me, why does it not work for you?". ;-) > > My questions are coming from Julia packages in mind, where the test > > suite is the only way to know all is fine. And many times, add System > > Image for Julia had been discussed and basically this System Image is > > precompilation (generic one or specialized for micro-architecture). > > Therefore, maybe this new 'tune' transformation would fit the bill. > > :-) > > > > https://docs.julialang.org/en/v1/devdocs/sysimg/ > > According to this page, =E2=80=98--tune=E2=80=99 won=E2=80=99t be necessa= ry here because Julia > supports function multi-versioning for its =E2=80=9Csystem image=E2=80=9D= : Yes, but from my understanding, the "baseline" cannot provide an image for all the micro-architectures, but only 'generic'. Moreover, as you described elsewhere, we cannot know for sure whether the machine that hosts the daemon is able to run code for this specific micro-architecture. Anyway. That's off topic. ;-) Thanks for explaining and let discuss elsewhere this Julia machinery. :-) Cheers, simon From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Dec 2021 09:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 52283@debbugs.gnu.org, Thiago Jung Bauermann Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.16390415551069 (code B ref 52283); Thu, 09 Dec 2021 09:20:01 +0000 Received: (at 52283) by debbugs.gnu.org; 9 Dec 2021 09:19:15 +0000 Received: from localhost ([127.0.0.1]:42435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvFa7-0000HB-7A for submit@debbugs.gnu.org; Thu, 09 Dec 2021 04:19:15 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:43604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvFa5-0000Gx-0d for 52283@debbugs.gnu.org; Thu, 09 Dec 2021 04:19:13 -0500 IronPort-Data: A9a23:LU5IDamQ+0J/hvzkDf0UDl3o5gxMJERdPkR7XQ2eYbTBsI5bpzYPy2MYUWjVPPaPZWr0f40ib9ni/E0CuZWBx4VlT1A9+CA2RRqmi+KVXIXDdh+Y0wC6d5CYEho/t63yUjRxRSwNZie0SiyFb/6x/RGQ6YnSHuClUbSca3grLeNZYHxJZSxLyrdRbrFA0YDR7zOl4bsekuWHULOX82Yc3lE8t8pvnChSUMHa41v0iLCRicdj5zcyn1FNZH4WyDrYw3HQGuG4FcbiLwrPIS3Qw4/Xw/stIovNfrfTaEwASLnUVeSMoiMHAO7/2l4b/3R0i/xjXBYfQR4/ZzGhm819z8tMvtq7ThozIqDXsOUbSRhRVS9kVUFD0O6ZfSHn7537I0ruNiGEL+9VJBxsZ91D0up6C2tT+udeJzYQKBeZiIqeyrumR/Npj8IlBMrsOIoVvHZ/izreCJ4OU5HGRKOM+dhFwDAtgM1mEvPXZs5fYj1qBCksyTUn1kw/UcNl2rrwwCCmK3sB8gr9mEb+2ECLpCQZ7VQnGIC9lgS2ePho IronPort-HdrOrdr: A9a23:DbJcBan7wd9YwTRBV4X/WMp1dWzpDfIf3DAbv31ZSRFFG/Fwwfre5cjztCWE7Qr4Ohkb8+xoXZPsfZqyz/JICOUqUotKPzOW2ldATrsD0WK4+UyHJ8SWzIc0vpuIFZIRNDSaNykYsS+V2miF+3lL+qj+zEgF792uq0uE7GtRGsZd0zs= X-IronPort-AV: E=Sophos;i="5.88,192,1635199200"; d="scan'208";a="9641069" Received: from unknown (HELO ribbon) ([193.50.110.120]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Dec 2021 10:19:07 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> <7364829.rrRS6mQaNJ@popigai> <871r2olu1j.fsf@inria.fr> <875ys0jwlf.fsf@inria.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 Frimaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 09 Dec 2021 10:19:06 +0100 In-Reply-To: (zimoun's message of "Tue, 7 Dec 2021 16:52:31 +0100") Message-ID: <8735n2gmph.fsf@inria.fr> 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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) zimoun skribis: > On Tue, 7 Dec 2021 at 15:52, Ludovic Court=C3=A8s wrote: >> zimoun skribis: [...] >> > I miss if the test suite is effectively run somewhere? >> >> Yes, for the default/generic/baseline package, when not using =E2=80=98-= -tune=E2=80=99. > > Assuming, the default/generic/baseline package is effectively built. :-) > > I imagine the scenario: I develop a new simulation tool, I package it > for Guix, I share it; usually I run "guix shell -D" and do loop over > "make" and "make check", then deploy using "guix build --tune". My > colleague fetches it and want to run it on another cluster, i.e., they > run "guix build --tune". The test suite for the generic/baseline is > never run inside a clean environment. And as we know, this isolated > part allows to detect many common issues; which are often source of > "it works for me, why does it not work for you?". ;-) Sure, we can always come up with such scenarios. >> > My questions are coming from Julia packages in mind, where the test >> > suite is the only way to know all is fine. And many times, add System >> > Image for Julia had been discussed and basically this System Image is >> > precompilation (generic one or specialized for micro-architecture). >> > Therefore, maybe this new 'tune' transformation would fit the bill. >> > :-) >> > >> > https://docs.julialang.org/en/v1/devdocs/sysimg/ >> >> According to this page, =E2=80=98--tune=E2=80=99 won=E2=80=99t be necess= ary here because Julia >> supports function multi-versioning for its =E2=80=9Csystem image=E2=80= =9D: > > Yes, but from my understanding, the "baseline" cannot provide an image > for all the micro-architectures, but only 'generic'. Moreover, as you > described elsewhere, we cannot know for sure whether the machine that > hosts the daemon is able to run code for this specific > micro-architecture. With multi-versioning, the system image (AIUI) provides several versions of the relevant code, one for each useful micro-architecture. Such a system image can be used anywhere because the right version of the code will be picked up at run-time depending on the host CPU. It=E2=80=99s The Right Thing, so no worries here! We can take advantage of= that feature in our Julia package. Thanks, Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Dec 2021 10:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 52283@debbugs.gnu.org, Thiago Jung Bauermann Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.16390466309261 (code B ref 52283); Thu, 09 Dec 2021 10:44:02 +0000 Received: (at 52283) by debbugs.gnu.org; 9 Dec 2021 10:43:50 +0000 Received: from localhost ([127.0.0.1]:42533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvGty-0002PI-90 for submit@debbugs.gnu.org; Thu, 09 Dec 2021 05:43:50 -0500 Received: from mail-wr1-f51.google.com ([209.85.221.51]:34559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvGtw-0002P5-5D for 52283@debbugs.gnu.org; Thu, 09 Dec 2021 05:43:48 -0500 Received: by mail-wr1-f51.google.com with SMTP id j3so8955243wrp.1 for <52283@debbugs.gnu.org>; Thu, 09 Dec 2021 02:43:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=TbesFBGCTneq+OjaVbCPYo3TqqWmTcSdn0BToE5IVoc=; b=LKx2cg30i3uq4BbxlCMMSaeLp4S4zsI7RsDkg08+hmqVbIid20ZIfW5BWkMDV3e54l 1iR4RQ9oD4Q43/vow2lUbZIdSxNJwUocyIOgYIkBS29i+unZr+A5a5zgJQeq+fUX3fMC WJ3WReF5WiujeFDgSYcv3ZPDWLO4jpAzrd0Y3jpZWHu5bfMUECX1/kJMXOYRw6AnsD7Z 4V+bzQTBc2dOJYBBe3q1uC9FumIQv0vvddtBKYRDBV/5+PKoeEPs4hGUxkmpkMltITSV 2vDQD4zzjsfOYsswXfx+TogqOX3Y04pzrNtDohXIDTmxjQokh2/I9DB+0EW6Ou6diD2d EDIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=TbesFBGCTneq+OjaVbCPYo3TqqWmTcSdn0BToE5IVoc=; b=eg/6aKhPj3rYSqIq1Hw7E6EmCqC229uzUMsPhg9nkb8anYTzi0+j67agsWT6Zf02k9 R7jf5oVGJPZ8FEwFQbmAxqko+A25zihxS6nXnTDwk5ezZhWMXQoEYHpckp3Ilzylma2M NEj76ic/kcPGicdcjIvyuQd/b3/2dxvnmJySyMpaJL5fz4cU4yZN5Nmu6vpjl4k5JYdT icpMl9/hG8eoO3IMZ8NxJEcMg9ez4u+Renzv5os6K2yA+JKlk8imLIGX56Vw12zpH85J gW3dzfeRhYJfq8EjquUSQrLy0bPge9/T3hhR4Y+/OXyhzxsWXVGoPPP/i85USFM2h6/d nmNQ== X-Gm-Message-State: AOAM532WPdZvnTtcPXFG3bDKlZgKS3Eu/7oxH4HY+/fB8Iv1mzFZS0Fh B4l9pOBeNHhkDbjpoGYFMvcunpQpjh4= X-Google-Smtp-Source: ABdhPJwNnSi41wiWCgEznfjn1O7PWECDdfwj4ZnFXATZRUGsAcfuoal46vS/KVpmat6OI3SfpMBIiw== X-Received: by 2002:a5d:47c3:: with SMTP id o3mr5549713wrc.348.1639046622115; Thu, 09 Dec 2021 02:43:42 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id i7sm5454990wro.58.2021.12.09.02.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 02:43:41 -0800 (PST) From: zimoun In-Reply-To: <8735n2gmph.fsf@inria.fr> References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> <7364829.rrRS6mQaNJ@popigai> <871r2olu1j.fsf@inria.fr> <875ys0jwlf.fsf@inria.fr> <8735n2gmph.fsf@inria.fr> Date: Thu, 09 Dec 2021 11:35:33 +0100 Message-ID: <86pmq6oykq.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Thu, 09 Dec 2021 at 10:19, Ludovic Court=C3=A8s wrote: > zimoun skribis: >> I imagine the scenario: I develop a new simulation tool, I package it >> for Guix, I share it; usually I run "guix shell -D" and do loop over >> "make" and "make check", then deploy using "guix build --tune". My >> colleague fetches it and want to run it on another cluster, i.e., they >> run "guix build --tune". The test suite for the generic/baseline is >> never run inside a clean environment. And as we know, this isolated >> part allows to detect many common issues; which are often source of >> "it works for me, why does it not work for you?". ;-) > > Sure, we can always come up with such scenarios. Turning off the test is the general case to cover various use case. Does it make sense to conditionally turn off? Say, the default for =E2=80=99tune=E2=80=99 is #f, but it is #t when the requested host micro-ar= chitecture is the same than the daemon one. Well, maybe it is overcomplicated for few corner cases. :-) >>> According to this page, =E2=80=98--tune=E2=80=99 won=E2=80=99t be neces= sary here because Julia >>> supports function multi-versioning for its =E2=80=9Csystem image=E2=80= =9D: >> >> Yes, but from my understanding, the "baseline" cannot provide an image >> for all the micro-architectures, but only 'generic'. Moreover, as you >> described elsewhere, we cannot know for sure whether the machine that >> hosts the daemon is able to run code for this specific >> micro-architecture. > > With multi-versioning, the system image (AIUI) provides several versions > of the relevant code, one for each useful micro-architecture. Such a > system image can be used anywhere because the right version of the code > will be picked up at run-time depending on the host CPU. Thanks for explaining. Indeed, the =E2=80=9Cbaseline=E2=80=9D could provid= e an image for all the micro-architectures; if it is not already the case*. The blog post [1] refers to LWN article [2]; which underlines the impact on the resulting image size, it should be minimal. Benchmark required for Julia. :-) 1: 2: Cheers, simon *not already the case: =C2=ABAs an example, at the time of this writing, the following string is used in the creation of the official x86_64 Julia binaries downloadable from julialang.org:=C2=BB generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1) And I do not know exactly if the current situation for the precompiled .ji is optimal, another story. Indeed, this tune transformation is not useful for Julia. :-) Thanks for the patient explanations. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH 02/10] transformations: Add '--tune'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Dec 2021 08:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 52283@debbugs.gnu.org, Thiago Jung Bauermann Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163912617523250 (code B ref 52283); Fri, 10 Dec 2021 08:50:02 +0000 Received: (at 52283) by debbugs.gnu.org; 10 Dec 2021 08:49:35 +0000 Received: from localhost ([127.0.0.1]:45495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvbax-00062w-Hk for submit@debbugs.gnu.org; Fri, 10 Dec 2021 03:49:35 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:46688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvbav-00062g-8u for 52283@debbugs.gnu.org; Fri, 10 Dec 2021 03:49:34 -0500 IronPort-HdrOrdr: A9a23:nM9dLqqDshO5o9tYKm5gVA8aV5oweYIsimQD101hICG9Vvbo9PxG/c566faaslwssR0b9OxoW5PgfZq/z/BICOAqVN/IYOCMggSVxe9ZgbcKjweQeRHDyg== X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="400435417" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 09:49:26 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211204204924.15581-1-ludo@gnu.org> <20211204204924.15581-2-ludo@gnu.org> <7364829.rrRS6mQaNJ@popigai> <871r2olu1j.fsf@inria.fr> <875ys0jwlf.fsf@inria.fr> <8735n2gmph.fsf@inria.fr> <86pmq6oykq.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Frimaire an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 10 Dec 2021 09:49:25 +0100 In-Reply-To: <86pmq6oykq.fsf@gmail.com> (zimoun's message of "Thu, 09 Dec 2021 11:35:33 +0100") Message-ID: <87ee6kdeui.fsf@inria.fr> 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-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! zimoun skribis: > On Thu, 09 Dec 2021 at 10:19, Ludovic Court=C3=A8s wrote: >> zimoun skribis: > >>> I imagine the scenario: I develop a new simulation tool, I package it >>> for Guix, I share it; usually I run "guix shell -D" and do loop over >>> "make" and "make check", then deploy using "guix build --tune". My >>> colleague fetches it and want to run it on another cluster, i.e., they >>> run "guix build --tune". The test suite for the generic/baseline is >>> never run inside a clean environment. And as we know, this isolated >>> part allows to detect many common issues; which are often source of >>> "it works for me, why does it not work for you?". ;-) >> >> Sure, we can always come up with such scenarios. > > Turning off the test is the general case to cover various use case. > > Does it make sense to conditionally turn off? Say, the default for > =E2=80=99tune=E2=80=99 is #f, but it is #t when the requested host micro-= architecture is > the same than the daemon one. Well, maybe it is overcomplicated for few > corner cases. :-) Yeah, there=E2=80=99s currently no way to know whether the build machine wo= uld be able to run that code. Knowing what machine the daemon runs on is not enough because there could be offloading. Ludo=E2=80=99. From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 00/12] Tuning packages for CPU micro-architectures Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967752925809 (code B ref 52283); Thu, 16 Dec 2021 17:59:01 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:49 +0000 Received: from localhost ([127.0.0.1]:36660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1k-0006i6-UU for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1j-0006hf-69 for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:48 -0500 Received: from [2001:470:142:3::e] (port=44350 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1d-0007rp-20; Thu, 16 Dec 2021 12:58:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=+Enig7YkUOe/RQxkhEBZFtYE9IRiqkyyIJ8hADpvy94=; b=LC59kdbzoEqttCML0bPM ytxtYdnL95BYnWI7GvLKtP/fYNNbwngZWYT7fN/smdxNGCn1zAuABB/hIoO5fqiYrH3XwJP4Xk09r RustTPZcbJD5AKfhgiUfnAXukOii1XHJmNwAfnNnAQb2gzg6D7AlMfLLQtFf8WC46h0oHSvUl9zeb ynJMd0160LUMwdSrpz6TVZA542qHhq4mRAb7YF6U5QKZw//oNAHqIyM+JE0ZQts/F6bXPjg1TnNKo 11XspplJWardIex7+AFCwZjs9BVFFfQeZ0mSmVy9yT80cVsyB0e+dxAAnOGmStxOm/MgTKWdP/cRL q+LCJlXNZVtVHg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1Y-0000YX-Ju; Thu, 16 Dec 2021 12:58:41 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:15 +0100 Message-Id: <20211216175827.2077-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <87lf0wkcam.fsf@gnu.org> References: <87lf0wkcam.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! Here is v2 of the patch set implementing the ‘--tune’ package transformation option. Changes since v1: • Compiler packages (gcc, clang, gcc-toolchain, clang-toolchain) now declare in a package property the supported CPU names; ‘--tune’ verifies, when the package a lowered to a bag, whether the target CPU is supported by the compiler and errors out if not. In theory, ‘--tune’ (with no argument) could detect a CPU that the compiler does not support, though that’s unlikely since (guix cpu) currently corresponds to what GCC 10 supports. I considered doing something fancy that would somehow fall back to a less accurate but supported CPU name, but gave up out of laziness and fear of complexity. • Guix now prints which package is being tuned, like so: $ ./pre-inst-env guix shell --tune inspekt3d -- Studio guix shell: tuning libfive@0-4.8ca1b86 for CPU skylake • Documentation reworded as suggested by Josselin. It also clarifies that a compiler wrapper is used and that tests are skipped. • Inputs of the new packages were simplified. \o/ Something left as future work is AMD processor identification in (guix cpu). Those interested in compiler optimizations can use it to compare the job made by different compilers: guix shell --with-c-toolchain=xtensor-benchmark=clang-toolchain \ --tune xtensor-benchmark -- benchmark_xtensor Fun fact: guix shell --tune eigen-benchmarks -- benchBlasGemm 240 240 240 now gives me 45 Gflops/s on my CORE i7 (skylake), when pre-merge it would give 36 Gflops/s. Same result with: --with-c-toolchain=eigen-benchmarks=gcc-toolchain@7 Go figure! I re-pushed the ‘wip-cpu-tuning’ branch so people can give it a try: guix time-machine --branch=wip-cpu-tuning -- \ shell eigen-benchmarks --tune -- \ benchBlasGemm 240 240 240 Thoughts? Ludo’. Ludovic Courtès (12): Add (guix cpu). gnu: gcc: Add 'compiler-cpu-architectures' property. gnu: clang: Add 'compiler-cpu-architectures' property. transformations: Add '--tune'. ci: Add extra jobs for tunable packages. gnu: Add eigen-benchmarks. gnu: Add xsimd-benchmark. gnu: Add xtensor-benchmark. gnu: ceres-solver: Mark as tunable. gnu: Add ceres-solver-benchmarks. gnu: libfive: Mark as tunable. gnu: prusa-slicer: Mark as tunable. Makefile.am | 1 + doc/guix.texi | 61 ++++++++++ gnu/ci.scm | 43 +++++-- gnu/packages/algebra.scm | 77 +++++++++++++ gnu/packages/commencement.scm | 1 + gnu/packages/cpp.scm | 23 ++++ gnu/packages/engineering.scm | 10 +- gnu/packages/gcc.scm | 31 +++++- gnu/packages/llvm.scm | 71 +++++++++++- gnu/packages/maths.scm | 48 +++++++- guix/cpu.scm | 143 ++++++++++++++++++++++++ guix/transformations.scm | 204 ++++++++++++++++++++++++++++++++++ tests/transformations.scm | 35 ++++++ 13 files changed, 733 insertions(+), 15 deletions(-) create mode 100644 guix/cpu.scm base-commit: e642378df3b0d218e463397883e7bf331f528c6a -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 01/12] Add (guix cpu). Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753525862 (code B ref 52283); Thu, 16 Dec 2021 17:59:02 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:55 +0000 Received: from localhost ([127.0.0.1]:36676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1q-0006j2-DW for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1k-0006hj-61 for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:48 -0500 Received: from [2001:470:142:3::e] (port=44358 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1e-0007sS-Sf; Thu, 16 Dec 2021 12:58:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ba7OP6KtI+Mn55bAvnu/eUqr9RZOEwtUj+RZ4ZQqTAk=; b=g2QNUCk3oGMYlm/QcjeR uTYjYz9dFzUb8oOrYFEDh1Xf5WnPgVDwOd+CHl79Ez3gS4gzoS5ZXTLFIGpzQHhEwFreMIgKx659k pvpYryKY7vWfIw/W2KN/dGJMZDvT1S7LbdYQrrQBI3G0daJNx8OXpk799/Z8NI48QzLVq+eyNgu4c zqXlrfa/07IjKjYvHltHV9hkIjvrCgq+vUBrmxsFga4XAtyvk3hTa/5wfs3fXq6DuEezRkflLvSvg KF8U5UssPBdnGbcxyvGsAVSqNjq43gZhUOip7tD4eAklTHji0BA3vyt2bY04cy5SBaVJ3JoJb73sa gFr31f35GKEFQg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1d-0000YX-JR; Thu, 16 Dec 2021 12:58:42 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:16 +0100 Message-Id: <20211216175827.2077-2-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/cpu.scm: New file. * Makefile.am (MODULES): Add it. --- Makefile.am | 1 + guix/cpu.scm | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 guix/cpu.scm diff --git a/Makefile.am b/Makefile.am index c4ccee65f1..dba9f4da82 100644 --- a/Makefile.am +++ b/Makefile.am @@ -81,6 +81,7 @@ MODULES = \ guix/base64.scm \ guix/ci.scm \ guix/cpio.scm \ + guix/cpu.scm \ guix/deprecation.scm \ guix/docker.scm \ guix/records.scm \ diff --git a/guix/cpu.scm b/guix/cpu.scm new file mode 100644 index 0000000000..e1911f52a8 --- /dev/null +++ b/guix/cpu.scm @@ -0,0 +1,143 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix cpu) + #:use-module (guix sets) + #:use-module (guix memoization) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (ice-9 match) + #:use-module (ice-9 rdelim) + #:export (current-cpu + cpu? + cpu-architecture + cpu-family + cpu-model + cpu-flags + + cpu->gcc-architecture)) + +;;; Commentary: +;;; +;;; This module provides tools to determine the micro-architecture supported +;;; by the CPU and to map it to a name known to GCC's '-march'. +;;; +;;; Code: + +;; CPU description. +(define-record-type + (cpu architecture family model flags) + cpu? + (architecture cpu-architecture) ;string, from 'uname' + (family cpu-family) ;integer + (model cpu-model) ;integer + (flags cpu-flags)) ;set of strings + +(define current-cpu + (mlambda () + "Return a record representing the host CPU." + (define (prefix? prefix) + (lambda (str) + (string-prefix? prefix str))) + + (call-with-input-file "/proc/cpuinfo" + (lambda (port) + (let loop ((family #f) + (model #f)) + (match (read-line port) + ((? eof-object?) + #f) + ((? (prefix? "cpu family") str) + (match (string-tokenize str) + (("cpu" "family" ":" family) + (loop (string->number family) model)))) + ((? (prefix? "model") str) + (match (string-tokenize str) + (("model" ":" model) + (loop family (string->number model))) + (_ + (loop family model)))) + ((? (prefix? "flags") str) + (match (string-tokenize str) + (("flags" ":" flags ...) + (cpu (utsname:machine (uname)) + family model (list->set flags))))) + (_ + (loop family model)))))))) + +(define (cpu->gcc-architecture cpu) + "Return the architecture name, suitable for GCC's '-march' flag, that +corresponds to CPU, a record as returned by 'current-cpu'." + (match (cpu-architecture cpu) + ("x86_64" + ;; Transcribed from GCC's 'host_detect_local_cpu' in driver-i386.c. + (or (and (= 6 (cpu-family cpu)) ;the "Pentium Pro" family + (letrec-syntax ((model (syntax-rules (=>) + ((_) #f) + ((_ (candidate => integers ...) rest + ...) + (or (and (= (cpu-model cpu) integers) + candidate) + ... + (model rest ...)))))) + (model ("bonnel" => #x1c #x26) + ("silvermont" => #x37 #x4a #x4d #x5a #x5d) + ("core2" => #x0f #x17 #x1d) + ("nehalem" => #x1a #x1e #x1f #x2e) + ("westmere" => #x25 #x2c #x2f) + ("sandybridge" => #x2a #x2d) + ("ivybridge" => #x3a #x3e) + ("haswell" => #x3c #x3f #x45 #x46) + ("broadwell" => #x3d #x47 #x4f #x56) + ("skylake" => #x4e #x5e #x8e #x9e) + ("skylake-avx512" => #x55) ;TODO: cascadelake + ("knl" => #x57) + ("cannonlake" => #x66) + ("knm" => #x85)))) + + ;; Fallback case for non-Intel processors or for Intel processors not + ;; recognized above. + (letrec-syntax ((if-flags (syntax-rules (=>) + ((_) + #f) + ((_ (flags ... => name) rest ...) + (if (every (lambda (flag) + (set-contains? (cpu-flags cpu) + flag)) + '(flags ...)) + name + (if-flags rest ...)))))) + (if-flags ("avx512" => "knl") + ("adx" => "broadwell") + ("avx2" => "haswell") + ;; TODO: tigerlake, cooperlake, etc. + ("avx" => "sandybridge") + ("sse4_2" "gfni" => "tremont") + ("sse4_2" "sgx" => "goldmont-plus") + ("sse4_2" "xsave" => "goldmont") + ("sse4_2" "movbe" => "silvermont") + ("sse4_2" => "nehalem") + ("ssse3" "movbe" => "bonnell") + ("ssse3" => "core2"))) + + ;; TODO: Recognize AMD models (bdver*, znver*, etc.)? + + "x86_64")) + (architecture + ;; TODO: AArch64. + architecture))) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 02/12] gnu: gcc: Add 'compiler-cpu-architectures' property. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753525869 (code B ref 52283); Thu, 16 Dec 2021 17:59:02 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:55 +0000 Received: from localhost ([127.0.0.1]:36678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1q-0006j5-Sh for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1k-0006hl-Ot for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:49 -0500 Received: from [2001:470:142:3::e] (port=44360 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1f-0007sv-FB; Thu, 16 Dec 2021 12:58:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=k2rQJtIYycTod0yeCRhkKH1YPtWMY1s9DumhSBbuXKE=; b=NW8OmCMCo69U7b3vy5T/ +FYprNpKfnf7Uwu1gzSVb1Sy/nShCfHcTbr5nMnPvrS82dH2pMvcD/iWDM0LOoJweyMiQDxMBBjG3 aFohyvKmPfStlQQz9jkRcy8ZNQNCKq4glLVrY2uNk9MW70t3uctcnjHSJPMIAKzN7vfspTy5Qvapo HjNZkilD/GAmrATK+02iG5G4g2MfDdIS+WZCoibE/o8GuCGJvbZc8cMcNBUMqfJnWnw9BK1l4pTPu Ms34qCcI5Nu8kBRJOdh24BNvWLfiD1lgL+NJuhnkxMh7Uh1IJJUaZ1SiBJbj158INNoK4rRb2MSqq rebhaK3rjIqgcQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1f-0000YX-ES; Thu, 16 Dec 2021 12:58:43 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:17 +0100 Message-Id: <20211216175827.2077-3-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/gcc.scm (%gcc-7.5-x86_64-micro-architectures) (%gcc-10-x86_64-micro-architectures): New variables. (gcc-7, gcc-10): Add 'properties' field. * gnu/packages/commencement.scm (make-gcc-toolchain): Likewise. --- gnu/packages/commencement.scm | 1 + gnu/packages/gcc.scm | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index e570a95b04..8c81098bc0 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3768,6 +3768,7 @@ (define* (make-gcc-toolchain gcc (append (package-search-paths gcc) (package-search-paths libc))) + (properties (package-properties gcc)) ;for 'compiler-cpu-architectures' (license (package-license gcc)) (synopsis "Complete GCC tool chain for C/C++ development") (description diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index f526680f56..efa0baeaa1 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -525,6 +525,27 @@ (define-public gcc-6 ,@(package-inputs gcc-4.7))))) +(define %gcc-7.5-x86_64-micro-architectures + ;; Suitable '-march' values for GCC 7.5 (info "(gcc) x86 Options"). + '("core2" "nehalem" "westmere" "sandybridge" "ivybridge" + "haswell" "broadwell" "skylake" "bonnell" "silvermont" + "knl" "skylake-avx512" + + "k8" "k8-sse3" "barcelona" + "bdver1" "bdver2" "bdver3" "bdver4" + "znver1" + "btver1" "btver2" "geode")) + +(define %gcc-10-x86_64-micro-architectures + ;; Suitable '-march' values for GCC 10. + (append %gcc-7.5-x86_64-micro-architectures + '("goldmont" "goldmont-plus" "tremont" + "knm" "cannonlake" "icelake-client" "icelake-server" + "cascadelake" "cooperlake" "tigerlake" + + "znver2" "znver3"))) + + (define-public gcc-7 (package (inherit gcc-6) @@ -542,7 +563,10 @@ (define-public gcc-7 (description "GCC is the GNU Compiler Collection. It provides compiler front-ends for several languages, including C, C++, Objective-C, Fortran, Ada, and Go. -It also includes runtime support libraries for these languages."))) +It also includes runtime support libraries for these languages.") + (properties + `((compiler-cpu-architectures + ("x86_64" ,@%gcc-7.5-x86_64-micro-architectures)))))) (define-public gcc-8 (package @@ -592,7 +616,10 @@ (define-public gcc-10 (patches (search-patches "gcc-9-strmov-store-file-names.patch" "gcc-5.0-libvtv-runpath.patch")) (modules '((guix build utils))) - (snippet gcc-canadian-cross-objdump-snippet))))) + (snippet gcc-canadian-cross-objdump-snippet))) + (properties + `((compiler-cpu-architectures + ("x86_64" ,@%gcc-10-x86_64-micro-architectures)))))) (define-public gcc-11 (package -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 03/12] gnu: clang: Add 'compiler-cpu-architectures' property. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753525876 (code B ref 52283); Thu, 16 Dec 2021 17:59:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:55 +0000 Received: from localhost ([127.0.0.1]:36680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006jC-7v for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1l-0006hm-CN for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:49 -0500 Received: from [2001:470:142:3::e] (port=44364 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0007tB-2K; Thu, 16 Dec 2021 12:58:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=akp4J/T/ngJSGbARlTwRHi1VKqG5dsx9Z4tiXpIvQ04=; b=RnSyYadA6ypm4+a+Iujf b7Wwmkgq+/PMwgIZ50DCDuhJ8FDFFpZ/9CwrPS1cgxL1KXvqzxRfnHs+7sYmYx8HQ2nUVrj5aueAM JJSBvQWvpNhQYh173qvDLuVp8B/sm3oCDSg8+KW+Ux/2Cyjo4Duyxq0sqT0mGpRsAqInB8N856kb0 BF0CbFD2LUKHB5KtI19y+PGE3OuFC84mdZBgtxJ+xFl6hro9uzSYwt15XVN9UofKZuxbyfdX8tsPr uY2WEx7rIhMqcHRqmLQWe9NJkcuF8SEoGhsn1meNajTccg+4J9ih1TseK62y2PaD5awpOy2HpIHpm YeqEbcG085HO3A==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0000YX-1i; Thu, 16 Dec 2021 12:58:44 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:18 +0100 Message-Id: <20211216175827.2077-4-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/llvm.scm (clang-from-llvm): Add #:properties and honor it. (clang-properties): New procedures. (make-clang-toolchain): Set 'properties' field. --- gnu/packages/llvm.scm | 71 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 051bbfeab5..d87ab570ff 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -155,7 +155,9 @@ (define* (clang-runtime-from-llvm llvm hash (supported-systems (delete "mips64el-linux" %supported-systems)))) (define* (clang-from-llvm llvm clang-runtime hash - #:key (patches '()) tools-extra) + #:key (patches '()) tools-extra + (properties + (clang-properties (package-version llvm)))) "Produce Clang with dependencies on LLVM and CLANG-RUNTIME, and applying the given PATCHES. When TOOLS-EXTRA is given, it must point to the 'clang-tools-extra' tarball, which contains code for 'clang-tidy', 'pp-trace', @@ -426,10 +428,76 @@ (define (move program) Objective-C++ programming languages. It uses LLVM as its back end. The Clang project includes the Clang front end, the Clang static analyzer, and several code analysis tools.") + (properties properties) (license (if (version>=? version "9.0") license:asl2.0 ;with LLVM exceptions license:ncsa)))) +(define (clang-properties version) + "Return package properties for Clang VERSION." + `((compiler-cpu-architectures + ("x86_64" + ;; This list was obtained by running: + ;; + ;; guix shell clang -- llc -march=x86-64 -mattr=help + ;; + ;; filtered from uninteresting entries such as "i686" and "pentium". + ,@(if (version>=? version "10.0") ;TODO: refine + '("atom" + "barcelona" + "bdver1" + "bdver2" + "bdver3" + "bdver4" + "bonnell" + "broadwell" + "btver1" + "btver2" + "c3" + "c3-2" + "cannonlake" + "cascadelake" + "cooperlake" + "core-avx-i" + "core-avx2" + "core2" + "corei7" + "corei7-avx" + "generic" + "geode" + "goldmont" + "goldmont-plus" + "haswell" + "icelake-client" + "icelake-server" + "ivybridge" + "k8" + "k8-sse3" + "knl" + "knm" + "lakemont" + "nehalem" + "nocona" + "opteron" + "opteron-sse3" + "sandybridge" + "silvermont" + "skx" + "skylake" + "skylake-avx512" + "slm" + "tigerlake" + "tremont" + "westmere" + "x86-64" + "x86-64-v2" + "x86-64-v3" + "x86-64-v4" + "znver1" + "znver2" + "znver3") + '()))))) + (define (make-clang-toolchain clang) (package (name (string-append (package-name clang) "-toolchain")) @@ -471,6 +539,7 @@ (define (make-clang-toolchain clang) (search-paths (package-search-paths clang)) (license (package-license clang)) + (properties (package-properties clang)) ;for 'compiler-cpu-architectures' (home-page "https://clang.llvm.org") (synopsis "Complete Clang toolchain for C/C++ development") (description "This package provides a complete Clang toolchain for C/C++ -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 05/12] ci: Add extra jobs for tunable packages. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753625884 (code B ref 52283); Thu, 16 Dec 2021 17:59:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:56 +0000 Received: from localhost ([127.0.0.1]:36682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006jJ-KB for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1m-0006hq-WD for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:51 -0500 Received: from [2001:470:142:3::e] (port=44368 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1h-0007tb-9Z; Thu, 16 Dec 2021 12:58:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=KkmRNdObKbMR8mxqnuQObOQAbzMbid4vqB6zPpNAsqY=; b=N3mi0GJ+hOegqmg37KaB /r274tIWOeHAw4lB3wGzyXqGgeRKLS7Y0pW2PbT3EE8VWR8K4sGcyDxaC+owYy7FrcV5v/xQZIFJS iAWKxskTUD77DMbbVmS8CDQC8qX7ft7LgNOFSZTLG+OGB04O2JvKXcHAb5ZY6SH3quURIqLCmYesx Ag8oL8vydtHn20pwEQ7PWBBoBc3AuUZBkd2vCHSC8IBw5K8ACQyUw5o/p45voHgTbkg2BLSHIPfJK AQYSSRho2vaNsGu+gu00DSCAX48tTfb13Bv0oZ6CJ02wYODOIW3GTIIlV+PlvwGYTRvP3hMHwVQPP ZxDTOgCN4xH3ow==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1h-0000YX-8y; Thu, 16 Dec 2021 12:58:45 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:20 +0100 Message-Id: <20211216175827.2077-6-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This allows us to provide substitutes for tuned package variants. * gnu/ci.scm (package-job): Add #:suffix and honor it. (package->job): Add #:suffix and honor it. (%x86-64-micro-architectures): New variable. (tuned-package-jobs): New procedure. (cuirass-jobs): Add jobs for tunable packages. --- gnu/ci.scm | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/gnu/ci.scm b/gnu/ci.scm index 6039af8f07..35fd583f75 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -28,6 +28,7 @@ (define-module (gnu ci) #:use-module (guix grafts) #:use-module (guix profiles) #:use-module (guix packages) + #:autoload (guix transformations) (tunable-package? tuned-package) #:use-module (guix channels) #:use-module (guix config) #:use-module (guix derivations) @@ -107,9 +108,9 @@ (define* (derivation->job name drv (#:timeout . ,timeout))) (define* (package-job store job-name package system - #:key cross? target) + #:key cross? target (suffix "")) "Return a job called JOB-NAME that builds PACKAGE on SYSTEM." - (let ((job-name (string-append job-name "." system))) + (let ((job-name (string-append job-name "." system suffix))) (parameterize ((%graft? #f)) (let* ((drv (if cross? (package-cross-derivation store package target system @@ -395,21 +396,39 @@ (define package->job (((_ inputs _ ...) ...) inputs)))) (%final-inputs))))) - (lambda (store package system) + (lambda* (store package system #:key (suffix "")) "Return a job for PACKAGE on SYSTEM, or #f if this combination is not -valid." +valid. Append SUFFIX to the job name." (cond ((member package base-packages) (package-job store (string-append "base." (job-name package)) - package system)) + package system #:suffix suffix)) ((supported-package? package system) (let ((drv (package-derivation store package system #:graft? #f))) (and (substitutable-derivation? drv) (package-job store (job-name package) - package system)))) + package system #:suffix suffix)))) (else #f))))) +(define %x86-64-micro-architectures + ;; Micro-architectures for which we build tuned variants. + '("westmere" "ivybridge" "haswell" "skylake" "skylake-avx512")) + +(define (tuned-package-jobs store package system) + "Return a list of jobs for PACKAGE tuned for SYSTEM's micro-architectures." + (filter-map (lambda (micro-architecture) + (define suffix + (string-append "." micro-architecture)) + + (package->job store + (tuned-package package micro-architecture) + system + #:suffix suffix)) + (match system + ("x86_64-linux" %x86-64-micro-architectures) + (_ '())))) + (define (all-packages) "Return the list of packages to build." (define (adjust package result) @@ -527,10 +546,16 @@ (define source ('all ;; Build everything, including replacements. (let ((all (all-packages)) - (job (lambda (package) - (package->job store package system)))) + (jobs (lambda (package) + (match (package->job store package system) + (#f '()) + (main-job + (cons main-job + (if (tunable-package? package) + (tuned-package-jobs store package system) + '()))))))) (append - (filter-map job all) + (append-map jobs all) (cross-jobs store system)))) ('core ;; Build core packages only. -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 04/12] transformations: Add '--tune'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 17:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967753725898 (code B ref 52283); Thu, 16 Dec 2021 17:59:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:58:57 +0000 Received: from localhost ([127.0.0.1]:36686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1s-0006jR-3W for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1m-0006ho-Ml for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:51 -0500 Received: from [2001:470:142:3::e] (port=44366 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0007tO-MM; Thu, 16 Dec 2021 12:58:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=axS1J317GZlt1ub+4jg7w5vcZplZal22jFm/vGHwbWk=; b=TPm4oRWBN6c4PQlob7aA gvFRaVof0SVcB8Fyc2JzZwUAUHkM4urBMkpPS0YaJGhbY0G/hNtOT7Nb41nOjVVb2y/mdCPkM7Hkk 3xLo0tuYKLwj1X1XGwKdbdt1f6PDEjGRzBCYWfwM0G0LiehvPsPmHyKvPo3NvFcXwIP5Hln15LHvH pu5P+nk91z/+V0krwsX5RRmu0laDGR8gM9QrpfxnFqwRmc+Hc1GEctr7+AB7drNG0oK4Y0uXW7fO2 01ex3Wd4ImuSS5/zVYLN3K8FVhyRjzerm1KUVtJZtRym86jZuHLXdPIw6JPAiIoU38+XikOnKxGMg fCbKQQOPGApnlw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1g-0000YX-LQ; Thu, 16 Dec 2021 12:58:44 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:19 +0100 Message-Id: <20211216175827.2077-5-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) From: Ludovic Courtès * guix/transformations.scm (tuning-compiler) (tuned-package, tunable-package?, package-tuning) (transform-package-tuning) (build-system-with-tuning-compiler): New procedures. (%transformations): Add 'tune'. (%transformation-options): Add "--tune". * tests/transformations.scm ("options->transformation, tune") ("options->transformations, tune, wrong micro-architecture"): New tests. * doc/guix.texi (Package Transformation Options): Document '--tune'. --- doc/guix.texi | 61 ++++++++++++ guix/transformations.scm | 204 ++++++++++++++++++++++++++++++++++++++ tests/transformations.scm | 35 +++++++ 3 files changed, 300 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 7b1a64deb9..b3207e125a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11014,6 +11014,67 @@ available options and a synopsis (these options are not shown in the @table @code +@cindex performance, tuning code +@cindex optimization, of package code +@cindex tuning, of package code +@cindex SIMD support +@cindex tunable packages +@cindex package multi-versioning +@item --tune[=@var{cpu}] +Use versions of the packages marked as ``tunable'' optimized for +@var{cpu}. When @var{cpu} is @code{native}, or when it is omitted, tune +for the CPU on which the @command{guix} command is running. + +Valid @var{cpu} names are those recognized by the underlying compiler, +by default the GNU Compiler Collection. On x86_64 processors, this +includes CPU names such as @code{nehalem}, @code{haswell}, and +@code{skylake} (@pxref{x86 Options, @code{-march},, gcc, Using the GNU +Compiler Collection (GCC)}). + +As new generations of CPUs come out, they augment the standard +instruction set architecture (ISA) with additional instructions, in +particular instructions for single-instruction/multiple-data (SIMD) +parallel processing. For example, while Core2 and Skylake CPUs both +implement the x86_64 ISA, only the latter supports AVX2 SIMD +instructions. + +The primary gain one can expect from @option{--tune} is for programs +that can make use of those SIMD capabilities @emph{and} that do not +already have a mechanism to select the right optimized code at run time. +Packages that have the @code{tunable?} property set are considered +@dfn{tunable packages} by the @option{--tune} option; a package +definition with the property set looks like this: + +@lisp +(package + (name "hello-simd") + ;; ... + + ;; This package may benefit from SIMD extensions so + ;; mark it as "tunable". + (properties '((tunable? . #t)))) +@end lisp + +Other packages are not considered tunable. This allows Guix to use +generic binaries in the cases where tuning for a specific CPU is +unlikely to provide any gain. + +Tuned packages are built with @code{-march=@var{CPU}}; under the hood, +the @option{-march} option is passed to the actual wrapper by a compiler +wrapper. Since the build machine may not be able to run code for the +target CPU micro-architecture, the test suite is not run when building a +tuned package. + +To reduce rebuilds to the minimum, tuned packages are @emph{grafted} +onto packages that depend on them (@pxref{Security Updates, grafts}). +Thus, using @option{--no-grafts} cancels the effect of @option{--tune}. + +We call this technique @dfn{package multi-versioning}: several variants +of tunable packages may be built, one for each CPU variant. It is the +coarse-grain counterpart of @dfn{function multi-versioning} as +implemented by the GNU tool chain (@pxref{Function Multiversioning,,, +gcc, Using the GNU Compiler Collection (GCC)}). + @item --with-source=@var{source} @itemx --with-source=@var{package}=@var{source} @itemx --with-source=@var{package}@@@var{version}=@var{source} diff --git a/guix/transformations.scm b/guix/transformations.scm index 5ae1977cb2..c43c00cdd3 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -18,9 +18,11 @@ ;;; along with GNU Guix. If not, see . (define-module (guix transformations) + #:use-module ((guix config) #:select (%system)) #:use-module (guix i18n) #:use-module (guix store) #:use-module (guix packages) + #:use-module (guix build-system) #:use-module (guix profiles) #:use-module (guix diagnostics) #:autoload (guix download) (download-to-store) @@ -29,6 +31,7 @@ (define-module (guix transformations) #:autoload (guix upstream) (package-latest-release upstream-source-version upstream-source-signature-urls) + #:autoload (guix cpu) (current-cpu cpu->gcc-architecture) #:use-module (guix utils) #:use-module (guix memoization) #:use-module (guix gexp) @@ -49,6 +52,9 @@ (define-module (guix transformations) #:export (options->transformation manifest-entry-with-transformations + tunable-package? + tuned-package + show-transformation-options-help %transformation-options)) @@ -419,6 +425,181 @@ (define replacements obj) obj))) +(define tuning-compiler + (mlambda (micro-architecture) + "Return a compiler wrapper that passes '-march=MICRO-ARCHITECTURE' to the +actual compiler." + (define wrapper + #~(begin + (use-modules (ice-9 match)) + + (define* (search-next command + #:optional + (path (string-split (getenv "PATH") + #\:))) + ;; Search the next COMMAND on PATH, a list of + ;; directories representing the executable search path. + (define this + (stat (car (command-line)))) + + (let loop ((path path)) + (match path + (() + (match command + ("cc" (search-next "gcc")) + (_ #f))) + ((directory rest ...) + (let* ((file (string-append + directory "/" command)) + (st (stat file #f))) + (if (and st (not (equal? this st))) + file + (loop rest))))))) + + (match (command-line) + ((command arguments ...) + (match (search-next (basename command)) + (#f (exit 127)) + (next + (apply execl next + (append (cons next arguments) + (list (string-append "-march=" + #$micro-architecture)))))))))) + + (define program + (program-file (string-append "tuning-compiler-wrapper-" micro-architecture) + wrapper)) + + (computed-file (string-append "tuning-compiler-" micro-architecture) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (define bin (string-append #$output "/bin")) + (mkdir-p bin) + + (for-each (lambda (program) + (symlink #$program + (string-append bin "/" program))) + '("cc" "gcc" "clang" "g++" "c++" "clang++"))))))) + +(define (build-system-with-tuning-compiler bs micro-architecture) + "Return a variant of BS, a build system, that ensures that the compiler that +BS uses (usually an implicit input) can generate code for MICRO-ARCHITECTURE, +which names a specific CPU of the target architecture--e.g., when targeting +86_64 MICRO-ARCHITECTURE might be \"skylake\". If it does, return a build +system that builds code for MICRO-ARCHITECTURE; otherwise raise an error." + (define %not-hyphen + (char-set-complement (char-set #\-))) + + (define lower + (build-system-lower bs)) + + (define (lower* . args) + ;; The list of CPU names supported by the '-march' option of C/C++ + ;; compilers is specific to each compiler and version thereof. Rather + ;; than pass '-march=MICRO-ARCHITECTURE' as is to the compiler, possibly + ;; leading to an obscure build error, check whether the compiler is known + ;; to support MICRO-ARCHITECTURE. If not, bail out. + (let* ((lowered (apply lower args)) + (architecture (match (string-tokenize (bag-system lowered) + %not-hyphen) + ((arch _ ...) arch))) + (compiler (any (match-lambda + ((label (? package? p) . _) + (and (assoc-ref (package-properties p) + 'compiler-cpu-architectures) + p)) + (_ #f)) + (bag-build-inputs lowered)))) + (unless compiler + (raise (formatted-message + (G_ "failed to determine which compiler is used")))) + + (let ((lst (assoc-ref (package-properties compiler) + 'compiler-cpu-architectures))) + (unless lst + (raise (formatted-message + (G_ "failed to determine whether ~a supports ~a") + (package-full-name compiler) + micro-architecture))) + (unless (member micro-architecture + (or (assoc-ref lst architecture) '())) + (raise (formatted-message + (G_ "compiler ~a does not support micro-architecture ~a") + (package-full-name compiler) + micro-architecture)))) + + (bag + (inherit lowered) + (build-inputs + ;; Arrange so that the compiler wrapper comes first in $PATH. + `(("tuning-compiler" ,(tuning-compiler micro-architecture)) + ,@(bag-build-inputs lowered)))))) + + (build-system + (inherit bs) + (lower lower*))) + +(define (tuned-package p micro-architecture) + "Return package P tuned for MICRO-ARCHITECTURE." + (package + (inherit p) + (build-system + (build-system-with-tuning-compiler (package-build-system p) + micro-architecture)) + (arguments + ;; The machine building this package may or may not be able to run code + ;; for MICRO-ARCHITECTURE. Because of that, skip tests; they are run for + ;; the "baseline" variant anyway. + (substitute-keyword-arguments (package-arguments p) + ((#:tests? _ #f) #f))) + + (properties + `((cpu-tuning . ,micro-architecture) + + ;; Remove the 'tunable?' property so that 'package-tuning' does not + ;; call 'tuned-package' again on this one. + ,@(alist-delete 'tunable? (package-properties p)))))) + +(define (tunable-package? package) + "Return true if package PACKAGE is \"tunable\"--i.e., if tuning it for the +host CPU is worthwhile." + (assq 'tunable? (package-properties package))) + +(define package-tuning + (mlambda (micro-architecture) + "Return a procedure that maps the given package to its counterpart tuned +for MICRO-ARCHITECTURE, a string suitable for GCC's '-march'." + (define rewriting-property + (gensym " package-tuning")) + + (package-mapping (lambda (p) + (cond ((assq rewriting-property (package-properties p)) + p) + ((assq 'tunable? (package-properties p)) + (info (G_ "tuning ~a for CPU ~a~%") + (package-full-name p) micro-architecture) + (package/inherit p + (replacement (tuned-package p micro-architecture)) + (properties `((,rewriting-property . #t) + ,@(package-properties p))))) + (else + p))) + (lambda (p) + (assq rewriting-property (package-properties p))) + #:deep? #t))) + +(define (transform-package-tuning micro-architectures) + "Return a procedure that, when " + (match micro-architectures + ((micro-architecture _ ...) + (let ((rewrite (package-tuning micro-architecture))) + (lambda (obj) + (if (package? obj) + (rewrite obj) + obj)))))) + (define (transform-package-with-debug-info specs) "Return a procedure that, when passed a package, set its 'replacement' field to the same package but with #:strip-binaries? #f in its 'arguments' field." @@ -601,6 +782,7 @@ (define %transformations (with-commit . ,transform-package-source-commit) (with-git-url . ,transform-package-source-git-url) (with-c-toolchain . ,transform-package-toolchain) + (tune . ,transform-package-tuning) (with-debug-info . ,transform-package-with-debug-info) (without-tests . ,transform-package-tests) (with-patch . ,transform-package-patches) @@ -640,6 +822,28 @@ (define %transformation-options (parser 'with-git-url)) (option '("with-c-toolchain") #t #f (parser 'with-c-toolchain)) + (option '("tune") #f #t + (lambda (opt name arg result . rest) + (define micro-architecture + (match arg + ((or #f "native") + (unless (string=? (or (assoc-ref result 'system) + (%current-system)) + %system) + (leave (G_ "\ +building for ~a instead of ~a, so tuning cannot be guessed~%") + (assoc-ref result 'system) %system)) + + (cpu->gcc-architecture (current-cpu))) + ("generic" #f) + (_ arg))) + + (apply values + (if micro-architecture + (alist-cons 'tune micro-architecture + result) + (alist-delete 'tune result)) + rest))) (option '("with-debug-info") #t #f (parser 'with-debug-info)) (option '("without-tests") #t #f diff --git a/tests/transformations.scm b/tests/transformations.scm index 09839dc1c5..8db85b4305 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -38,12 +38,14 @@ (define-module (test-transformations) #:use-module (guix utils) #:use-module (guix git) #:use-module (guix upstream) + #:use-module (guix diagnostics) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages busybox) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) #:use-module (srfi srfi-64)) @@ -465,6 +467,39 @@ (define (package-name* obj) `((with-latest . "foo"))))) (package-version (t p))))) +(test-equal "options->transformation, tune" + '(cpu-tuning . "superfast") + (let* ((p0 (dummy-package "p0")) + (p1 (dummy-package "p1" + (inputs `(("p0" ,p0))) + (properties '((tunable? . #t))))) + (p2 (dummy-package "p2" + (inputs `(("p1" ,p1))))) + (t (options->transformation '((tune . "superfast")))) + (p3 (t p2))) + (and (not (package-replacement p3)) + (match (package-inputs p3) + ((("p1" tuned)) + (match (package-inputs tuned) + ((("p0" p0)) + (and (not (package-replacement p0)) + (assq 'cpu-tuning + (package-properties + (package-replacement tuned))))))))))) + +(test-assert "options->transformations, tune, wrong micro-architecture" + (let ((p (dummy-package "tunable" + (properties '((tunable? . #t))))) + (t (options->transformation '((tune . "nonexistent-superfast"))))) + ;; Because GCC used by P's build system does not support + ;; '-march=nonexistent-superfast', we should see an error when lowering + ;; the tuned package. + (guard (c ((formatted-message? c) + (member "nonexistent-superfast" + (formatted-message-arguments c)))) + (package->bag (t p)) + #f))) + (test-equal "options->transformation + package->manifest-entry" '((transformations . ((without-tests . "foo")))) (let* ((p (dummy-package "foo")) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 06/12] gnu: Add eigen-benchmarks. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967756926030 (code B ref 52283); Thu, 16 Dec 2021 18:00:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:29 +0000 Received: from localhost ([127.0.0.1]:36700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2B-0006lI-7Y for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1n-0006hs-Tc for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:52 -0500 Received: from [2001:470:142:3::e] (port=44370 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1i-0007tl-Jd; Thu, 16 Dec 2021 12:58:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=a/87rTX3i21SX5TarF3RqNqUIj/uyM5qeiQOTlxu2AI=; b=M6xu06Boof8Ma4i0xPvQ crN9lsppx69Y44/XllLDxBpEKQ2xYr6J/GgZaoRTeJiIDVMXxL0ZGDMFaI8ABJVKgAVJHdpYvePir h7RSsnDU5mqHZQ0xnbDp0lQ6SkDc9cIxN7AJ2+nejOpycWo2Sz1i8T1yq1pYRytVVQmFAN4yTYT2i aab4CagjLXixO7hmQYD6jJyyY8YBzV17aRy6v0UuCgWc33IQRzTQZ15gr+9R820Z8Cl+tzLbabT06 n3ZuvMT5SnfKzpv4LjSZM05WsUq4UTEEJlx9PzfkwoURmEzWw1EwRMOED5G+ocmihkhtd3w1ZipZm e8t+KzwysVxSDQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1h-0000YX-SZ; Thu, 16 Dec 2021 12:58:46 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:21 +0100 Message-Id: <20211216175827.2077-7-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/algebra.scm (eigen-benchmarks): New variable. --- gnu/packages/algebra.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 79785bd463..e92ef4bf3f 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1044,6 +1044,44 @@ (define-public eigen ;; See 'COPYING.README' for details. (license license:mpl2.0))) +(define-public eigen-benchmarks + (package + (inherit eigen) + (name "eigen-benchmarks") + (arguments + '(#:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define (compile file) + (format #t "compiling '~a'...~%" file) + (let ((target + (string-append bin "/" + (basename file ".cpp")))) + (invoke "c++" "-o" target file + "-I" ".." "-O2" "-g" + "-lopenblas" "-Wl,--as-needed"))) + + (mkdir-p bin) + (with-directory-excursion "bench" + ;; There are more benchmarks, of varying quality. + ;; Here we pick some that appear to be useful. + (for-each compile + '("benchBlasGemm.cpp" + "benchCholesky.cpp" + ;;"benchEigenSolver.cpp" + "benchFFT.cpp" + "benchmark-blocking-sizes.cpp")))))) + (delete 'install)))) + (inputs (list boost openblas)) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t))) + + (synopsis "Micro-benchmarks of the Eigen linear algebra library"))) + (define-public eigen-for-tensorflow (let ((changeset "fd6845384b86") (revision "1")) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 07/12] gnu: Add xsimd-benchmark. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757026037 (code B ref 52283); Thu, 16 Dec 2021 18:00:03 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:30 +0000 Received: from localhost ([127.0.0.1]:36706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2P-0006ln-Tc for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1o-0006ht-Gy for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:52 -0500 Received: from [2001:470:142:3::e] (port=44372 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1j-0007ty-6w; Thu, 16 Dec 2021 12:58:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=yMSFjWt0a17tktaO/Ghg6EPyWlrK/ME/DmoWyiVf4Zg=; b=ftIgDnawoPyjjRA2wX80 EwrAoX3nSq+kLGtYKV68alOc9F4yGmQ3bOpvE4dpUQKDvQ156TIxcfZKVZ8OxNc22yKua7PeGP4pZ l6XnjVLQbmExqRVGL4CrtcX8kLR4V6LAwdOQYm51Tlu1ySkDrFqoZXBUUIyDAaDgLcfjfC8JjCcEx oGy8S2hBQ5GX2d6MHC9+dr4u8LcKmOyN2R6ozH8n2EiMj3yt6Arfd3sHgTAveGh67cj/bievwNro5 KuoYSxDkGdw1AsYZqE9Q4oDheKCNo0gt7Ffqkit9ieTx9ZQob/ldytFaGXm1ON0HOzQHrqSEFuEQd JfX4JQKUnPXRsg==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1j-0000YX-6I; Thu, 16 Dec 2021 12:58:47 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:22 +0100 Message-Id: <20211216175827.2077-8-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/cpp.scm (xsmimd-benchmark): New variable. --- gnu/packages/cpp.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 718fb20652..da26a4e346 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -300,6 +300,29 @@ (define-public xsimd operating on batches.") (license license:bsd-3))) +(define-public xsmimd-benchmark + (package + (inherit xsimd) + (name "xsimd-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xsimd" + (string-append out "/bin")))))))) + (synopsis "Benchmark of the xsimd library") + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public chaiscript (package (name "chaiscript") -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 08/12] gnu: Add xtensor-benchmark. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757026046 (code B ref 52283); Thu, 16 Dec 2021 18:00:04 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:30 +0000 Received: from localhost ([127.0.0.1]:36708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2Q-0006lu-5e for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1p-0006i0-Ac for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:53 -0500 Received: from [2001:470:142:3::e] (port=44374 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1k-0007uC-10; Thu, 16 Dec 2021 12:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=IbTzhDpHN0QtO7GQyDgmET4uA6RPaTiu8j267LQhM5Y=; b=VNNGnlPdtxQHTqp2M671 6OCK6hcNU8YCrTtl5g2FeGY+N+A4XQq0Oazjk/YrCrFHQxT5LYPk4CJnL4kBV9Y1imQivL2F6gEaB Rn8hwsyN0uZZjtZxMydtUX3XAu/RUucnP/MxttrlrYOF3fm04cMry1eOl6Lb5pLvFTgm42rsF77Bu qe96iqJ6v3Y9fbS7msWFQRxLvvu371Xjv5WUHZzfkxRbPyMOSBhg1lERBPucRLGW+sKnbtil4w/iL tPQ1zb5DFPebK9rB3YGDNJIGJqzHnxZT1ymfDc1zYRwhlzBvCyHlhJGdK2CQcCkQvTXK7z9lOhzG0 ogzCvA7KGXIpZA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1j-0000YX-Pd; Thu, 16 Dec 2021 12:58:47 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:23 +0100 Message-Id: <20211216175827.2077-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/algebra.scm (xtensor-benchmark): New variable. --- gnu/packages/algebra.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index e92ef4bf3f..c129e0f4e0 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1169,6 +1169,45 @@ (define-public xtensor @end itemize") (license license:bsd-3))) +(define-public xtensor-benchmark + (package + (inherit xtensor) + (name "xtensor-benchmark") + (arguments + `(#:configure-flags (list "-DBUILD_BENCHMARK=ON" + "-DDOWNLOAD_GBENCHMARK=OFF") + #:tests? #f + #:phases (modify-phases %standard-phases + (add-after 'unpack 'remove-march=native + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("-march=native") "")))) + (add-after 'unpack 'link-with-googlebenchmark + (lambda _ + (substitute* "benchmark/CMakeLists.txt" + (("find_package\\(benchmark.*" all) + (string-append + all "\n" + "set(GBENCHMARK_LIBRARIES benchmark)\n"))))) + (replace 'build + (lambda _ + (invoke "make" "benchmark_xtensor" "-j" + (number->string (parallel-job-count))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Install nothing but the executable. + (let ((out (assoc-ref outputs "out"))) + (install-file "benchmark/benchmark_xtensor" + (string-append out "/bin")))))))) + (synopsis "Benchmarks of the xtensor library") + (native-inputs '()) + (inputs + (modify-inputs (package-native-inputs xtensor) + (prepend googlebenchmark xsimd))) + + ;; Mark as tunable to take advantage of SIMD code in xsimd/xtensor. + (properties '((tunable? . #t))))) + (define-public gap (package (name "gap") -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 09/12] gnu: ceres-solver: Mark as tunable. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757026053 (code B ref 52283); Thu, 16 Dec 2021 18:00:04 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:30 +0000 Received: from localhost ([127.0.0.1]:36710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2Q-0006m3-GY for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1p-0006i7-W8 for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:54 -0500 Received: from [2001:470:142:3::e] (port=44376 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1k-0007uQ-M5; Thu, 16 Dec 2021 12:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=B/W211dW7rCm6lGJbZmiPoHJ/59ZvQYvGBzYbB2CDFs=; b=Q7lwcuErgp3aEwEgaVVs NcFjsVClGA6nUdzf9F4XflK0h+94Y9aPHC5q7Mcst7CguTJjESxc+W6f2a3kTZl1jDWPTWlBoqLGJ 9YaXP/zROcYlZ93ORuv24g2xvmeJo+MADOiOWlvnGibr7ZX4t+FV75DCzW88r1u0xj0Q+GX1qGMdu Bbkip7uqF6yv3uQXalwI6jn/pu8hMOztgIk6gdLX7HZklZORXM9prNv+Xzx0FNP6FhHJ7rFhgY3E2 404smzvp8za62rlcHXcqb3906yjPjBxz09tDu/94S52Ei/30AA0ZZa6gNUWfsVEDAOJxB5a/Gt4U+ heRq2aeZlpj3JA==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1k-0000YX-Jz; Thu, 16 Dec 2021 12:58:48 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:24 +0100 Message-Id: <20211216175827.2077-10-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/maths.scm (ceres)[properties]: New field. --- gnu/packages/maths.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 3bac086666..256b1c4421 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2411,7 +2411,10 @@ (define-public ceres @item non-linear least squares problems with bounds constraints; @item general unconstrained optimization problems. @end enumerate\n") - (license license:bsd-3))) + (license license:bsd-3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties `((tunable? . #t))))) ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 10/12] gnu: Add ceres-solver-benchmarks. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757126060 (code B ref 52283); Thu, 16 Dec 2021 18:00:05 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:31 +0000 Received: from localhost ([127.0.0.1]:36712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2Q-0006mA-PW for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1r-0006iQ-RZ for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:56 -0500 Received: from [2001:470:142:3::e] (port=44378 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1m-0007ui-IC; Thu, 16 Dec 2021 12:58:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=PNyHqzixGiqZL1t497RfTSgAB8s4ZvZXWuIcVJSLi0s=; b=BaMTjbz9nHHcPd97D4NP Ouen7lOcPBGlqgP58xbTaw8UeY9gSghr6/fCJ6BQSlpBehyB+cvdZQWQfBMBEPRIrtPyfiNfFU+9J XS0yXEnvOy137KpCmGs/5yWj7k9TD/mELPes37696fI9cgpXgMNfq0tr0JMEtWfhb4Kh63am7FMA4 Jc1/FDeJ9t0ZpX1sUkdJfPOe40LhS756OXwqNHKSILLFgJoa1GPKuIs0qCEUETQA3j0Op7yKuPnE6 e4jZXXkQgKTRbL25ixOs8uMPQ0Q7H9CoVDzrNZ+3M4zO+L/IeM52COH9KA05qbacsEz6dGg4/yV6Q hps6y2UrOBH9ng==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1l-0000YX-7F; Thu, 16 Dec 2021 12:58:50 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:25 +0100 Message-Id: <20211216175827.2077-11-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/maths.scm (ceres-solver-benchmarks): New variable. --- gnu/packages/maths.scm | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 256b1c4421..7f2994d10b 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -2416,6 +2416,49 @@ (define-public ceres ;; Mark as tunable to take advantage of SIMD code in Eigen. (properties `((tunable? . #t))))) +(define-public ceres-solver-benchmarks + (package + (inherit ceres) + (name "ceres-solver-benchmarks") + (arguments + '(#:modules ((ice-9 popen) + (ice-9 rdelim) + (guix build utils) + (guix build cmake-build-system)) + + #:phases (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (define flags + (string-tokenize + (read-line (open-pipe* OPEN_READ + "pkg-config" "eigen3" + "--cflags")))) + + (define (compile-file file) + (let ((source (string-append file ".cc"))) + (format #t "building '~a'...~%" file) + (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG" + source "-lceres" "-lbenchmark" "-lglog" + "-pthread" + "-o" (string-append bin "/" file) + "-I" ".." flags))) + + (mkdir-p bin) + (with-directory-excursion "internal/ceres" + (for-each compile-file + '("small_blas_gemm_benchmark" + "small_blas_gemv_benchmark" + "autodiff_cost_function_benchmark")))))) + (delete 'check) + (delete 'install)))) + (inputs (modify-inputs (package-inputs ceres) + (prepend googlebenchmark ceres))) + (synopsis "Benchmarks of the Ceres optimization problem solver"))) + ;; For a fully featured Octave, users are strongly recommended also to install ;; the following packages: less, ghostscript, gnuplot. (define-public octave-cli -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 11/12] gnu: libfive: Mark as tunable. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757126068 (code B ref 52283); Thu, 16 Dec 2021 18:00:05 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:31 +0000 Received: from localhost ([127.0.0.1]:36714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2R-0006mH-4U for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1t-0006ij-Pj for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:57 -0500 Received: from [2001:470:142:3::e] (port=44380 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1o-0007v9-Fc; Thu, 16 Dec 2021 12:58:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=ha9K5tW7mbDgE/AeWFkG3tkTh0+53WG5lIHz2X9B7FM=; b=KXgeHNCwJvl9n6vr7RAx wjrpJIKgb7+U8+V0+DsTdHNPtkq6++gF8KdMk1AAnurIipuyPlKZWxyxikjNFw5c9bijs2Y/RqL2s zRqF7i1CCdBoic3Xjmzdcw+bMWoFa3DLLqRmDyHNpiLi7OU00l4wvFX+pUDErmKAdTY2pUZU7/6uy JNS33QrsNEe6g0F97At7oso1jfbT3vryZ9W/Q2dJI4FT+HmW7sJUzSoeHgb7q8hdX/I8Aabslv6A4 ubA9erIMcbFVI69OXXao6QaY66TB+2HVK1WKq+PsD9JYgD5mCHTO7CoCMK3ExmW9bJx9Pw4QlDxwA yl6i0XNlXA+OLQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1n-0000YX-4e; Thu, 16 Dec 2021 12:58:52 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:26 +0100 Message-Id: <20211216175827.2077-12-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/engineering.scm (libfive)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index edc0f51d8d..709b6d2864 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -829,7 +829,10 @@ (define-public libfive Even fundamental, primitive shapes are represented as code in the user-level language.") (license (list license:mpl2.0 ;library - license:gpl2+))))) ;Guile bindings and GUI + license:gpl2+)) ;Guile bindings and GUI + + ;; Mark as tunable to take advantage of SIMD code in Eigen. + (properties '((tunable? . #t)))))) (define-public inspekt3d (let ((commit "703f52ccbfedad2bf5240bf8183d1b573c9d54ef") -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#52283] [PATCH v2 12/12] gnu: prusa-slicer: Mark as tunable. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Dec 2021 18:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52283 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52283@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 52283-submit@debbugs.gnu.org id=B52283.163967757126075 (code B ref 52283); Thu, 16 Dec 2021 18:00:05 +0000 Received: (at 52283) by debbugs.gnu.org; 16 Dec 2021 17:59:31 +0000 Received: from localhost ([127.0.0.1]:36716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv2R-0006mO-EQ for submit@debbugs.gnu.org; Thu, 16 Dec 2021 12:59:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxv1u-0006io-CE for 52283@debbugs.gnu.org; Thu, 16 Dec 2021 12:58:58 -0500 Received: from [2001:470:142:3::e] (port=44382 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1p-0007vP-2g; Thu, 16 Dec 2021 12:58:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Kt3Ts0RyVfB58IBBqLsj5KrIJ6RpBbr6wviibgKvjOo=; b=HVf1355bmgq8febnqzaP JSbfVTr11BzjViAmHfn6FlZKp2oLNmTz/9tHO+h+00aRfMbkFwtVrfQu/tSv9sA+0DJtZy2tZwW0l +kAnqH8I2jEL5EROJjqRDiYy8u0fCworOadSI05ZJPRZjSkfdL5VbdjgmGiz6IQiRoqGeHzdctzwj wLG5FEo/AU6YaMJ1jRDUGO1zpgGoawIyHDQSvC7LdyGupWHMeYGpJ9fg1gY776uU3usFJ6UUGJ/l2 IAIwnxSy4p6+WZMiG8fFGzsc/1mbQt2bZYJUkbvTE9IL8JcuR5WPhzzn7xREx2D6JCFKQ8KjEI45W iuKNfSELrENNtQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42202 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1p-0000YX-2P; Thu, 16 Dec 2021 12:58:53 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 16 Dec 2021 18:58:27 +0100 Message-Id: <20211216175827.2077-13-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/engineering.scm (prusa-slicer)[properties]: New field. --- gnu/packages/engineering.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 709b6d2864..fa82448736 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -3121,4 +3121,7 @@ (define-public prusa-slicer (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)") (description "PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into G-code instructions for FFF printers or PNG layers for mSLA 3D printers.") - (license license:agpl3))) + (license license:agpl3) + + ;; Mark as tunable to take advantage of SIMD code in Eigen and in libigl. + (properties '((tunable? . #t))))) -- 2.33.0 From unknown Wed Jun 18 23:17:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#52283: closed (Re: bug#52283: [PATCH 00/10] Tuning packages for CPU micro-architectures) Message-ID: References: <871r1rpknf.fsf_-_@gnu.org> <20211204203447.15200-1-ludo@gnu.org> X-Gnu-PR-Message: they-closed 52283 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 52283@debbugs.gnu.org Date: Sat, 01 Jan 2022 15:00:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1641049202-32669-1" This is a multi-part message in MIME format... ------------=_1641049202-32669-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #52283: [PATCH 00/10] Tuning packages for CPU micro-architectures which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 52283@debbugs.gnu.org. --=20 52283: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D52283 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1641049202-32669-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 52283-done) by debbugs.gnu.org; 1 Jan 2022 14:59:10 +0000 Received: from localhost ([127.0.0.1]:59186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3fqg-0008TG-7t for submit@debbugs.gnu.org; Sat, 01 Jan 2022 09:59:10 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:47396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3fqe-0008Sq-8P for 52283-done@debbugs.gnu.org; Sat, 01 Jan 2022 09:59:08 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 8CBFF2C3 for <52283-done@debbugs.gnu.org>; Sat, 1 Jan 2022 15:59:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cWLkb7L95m4k for <52283-done@debbugs.gnu.org>; Sat, 1 Jan 2022 15:59:00 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 772E317D for <52283-done@debbugs.gnu.org>; Sat, 1 Jan 2022 15:59:00 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 52283-done@debbugs.gnu.org Subject: Re: bug#52283: [PATCH 00/10] Tuning packages for CPU micro-architectures References: <87lf0wkcam.fsf@gnu.org> <20211216175827.2077-1-ludo@gnu.org> Date: Sat, 01 Jan 2022 15:59:00 +0100 In-Reply-To: <20211216175827.2077-1-ludo@gnu.org> ("Ludovic =?utf-8?Q?Cour?= =?utf-8?Q?t=C3=A8s=22's?= message of "Thu, 16 Dec 2021 18:58:15 +0100") Message-ID: <871r1rpknf.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-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 8CBFF2C3 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[52283-done@debbugs.gnu.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 52283-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello! Ludovic Court=C3=A8s skribis: > Here is v2 of the patch set implementing the =E2=80=98--tune=E2=80=99 pac= kage > transformation option. Changes since v1: Pushed! 40662f7da8 news: Add entry about '--tune'. 4cd0b37f6b gnu: gsl: Add 'tunable?' property. 1fcb98ca54 gnu: prusa-slicer: Mark as tunable. 6554294754 gnu: libfive: Mark as tunable. 6b70412370 gnu: Add ceres-solver-benchmarks. 24667081ad gnu: ceres-solver: Mark as tunable. 182b97dac0 gnu: Add xtensor-benchmark. f5873949f3 gnu: Add xsimd-benchmark. 6542e5713a gnu: Add eigen-benchmarks. 6756c64a8f ci: Add extra jobs for tunable packages. d090e9c37d transformations: Add '--tune'. 0a767f02d4 gnu: clang: Add 'compiler-cpu-architectures' property. 2576e2019d gnu: gcc: Add 'compiler-cpu-architectures' property. a644f88d28 Add (guix cpu). Ludo=E2=80=99. ------------=_1641049202-32669-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Dec 2021 20:35:14 +0000 Received: from localhost ([127.0.0.1]:55152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbkS-0000xE-CZ for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:35:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:58576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtbkQ-0000x7-JO for submit@debbugs.gnu.org; Sat, 04 Dec 2021 15:35:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbkN-0007Ui-Ou for guix-patches@gnu.org; Sat, 04 Dec 2021 15:35:05 -0500 Received: from [2001:470:142:3::e] (port=44842 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtbkK-0005b1-5M; Sat, 04 Dec 2021 15:35:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=kMeqSPIHiZoI+FvIU1i0vtGJ1hrPsS2V61xXqZYteqw=; b=jBxANkV0ePfCwk PLwIWAya18r6OBdJpATPZKuzUiqQdgmcH5mcoXJz4UbDZY2Akcf7es76rvFpmXrx/R8tY9RvuHOUS LHzSZ5wi/rVkd8sreXg+Dkw5j9dvtCJgK8fFxNRzuZcATO4+ULF8dUgk/jiJ6XoodGETgziERhvBH nMRMmfYGw1124slycZTITf4fY8vyOaqfY85K1NPRPb8M0qDpGRW1nUoHSJvAJgs7WVv3eBow4iVsf R/qfNukkhydEFeGOXBpCQ05iQxZ5a79Rnp+vm2gllHNEsMNP+MvUr5r5Jfbpdlg1xIYkJR3uxTgLY rGtK2Sifjpqe7gnBUbTw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:54570 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtbkK-0003SD-1y; Sat, 04 Dec 2021 15:35:00 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH 00/10] Tuning packages for CPU micro-architectures Date: Sat, 4 Dec 2021 21:34:47 +0100 Message-Id: <20211204203447.15200-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Guix! This patch series is an attempt to allow users to build or substitute packages for the very CPU they are using, as opposed to using a generic binary that targets the baseline architecture—e.g., x86_64 without AVX extensions. As a reminder, my take on this is that The Right Thing is for code to select optimized implementations for the host CPU at load time, using (possibly hand-crafted) “function multi-versioning”: https://hpc.guix.info/blog/2018/01/pre-built-binaries-vs-performance/ Now, there’s at least one situation where developers don’t do “the right thing”: C++ header-only libraries. It turns out header-only libraries with #ifdef’d SIMD code are quite common: Eigen, xsimd, xtensor, etc. Every user of those libs has to be compiled with ‘-march=native’ to take advantage of those SIMD-optimized routines and there’s little hope of seeing those libraries implement load-time or run-time selection¹. This patch set implements “package multi-versioning”, where a package can have different variants users may choose from: baseline, haswell, skylake, etc. This is implemented as a package transformation option, ‘--tune’. Without any argument, ‘--tune’ grafts tuned package variants for each package that has the ‘tunable?’ property. For example: guix shell eigen-benchmarks --tune -- benchBlasGemm 16 16 16 100 100 runs one of the Eigen benchmarks tuned for the host CPU, because ‘eigen-benchmarks’ is marked as “tunable”. This is achieved not by passing ‘-march=native’, because the daemon might be running on a separate machine with a different CPU, but by identifying the ‘-march’ value corresponding to the host CPU and passing ‘-march’ to the compiler, via a wrapper. On my skylake laptop, that gives a noticeable difference on the GEMM benchmark of Eigen and good results on the xtensor benchmarks too, unsurprisingly. I don’t have figures for higher-level applications, but it’d be nice to benchmark some of Eigen’s dependents for instance, as shown by: guix graph -M2 -t reverse-package eigen | xdot -f fdp - If you could run such benchmarks, that’d be great! :-) Things like Fenics may benefit from it. Nix people chose to introduce separate system types for the various x86_64 micro-architecture levels: x86_64-linux-v1, x86_64-linux-v2, etc.² I think this is somewhat wasteful and unpractical though. It’s also unclear whether those levels, defined in the new x86_64 psABI³, are a viable abstraction: vendors seem to be mixing features rather than really following the accumulative pattern that those levels imply. Thoughts? Ludo’. ¹ https://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2021/11/msg00006.html ² https://discourse.nixos.org/t/nix-2-4-released/15822 ³ https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex Ludovic Courtès (10): Add (guix cpu). transformations: Add '--tune'. ci: Add extra jobs for tunable packages. gnu: Add eigen-benchmarks. gnu: Add xsimd-benchmark. gnu: Add xtensor-benchmark. gnu: ceres-solver: Mark as tunable. gnu: Add ceres-solver-benchmarks. gnu: libfive: Mark as tunable. gnu: prusa-slicer: Mark as tunable. Makefile.am | 1 + doc/guix.texi | 54 ++++++++++++++ gnu/ci.scm | 43 ++++++++--- gnu/packages/algebra.scm | 79 ++++++++++++++++++++ gnu/packages/cpp.scm | 23 ++++++ gnu/packages/engineering.scm | 10 ++- gnu/packages/maths.scm | 49 ++++++++++++- guix/cpu.scm | 137 +++++++++++++++++++++++++++++++++++ guix/transformations.scm | 134 ++++++++++++++++++++++++++++++++++ tests/transformations.scm | 20 +++++ 10 files changed, 538 insertions(+), 12 deletions(-) create mode 100644 guix/cpu.scm base-commit: 052f56e5a614854636563278ee5a2248b3609d87 prerequisite-patch-id: 7e5c2bb5942496daf01a7f6dfc1b0b5b214f1584 -- 2.33.0 ------------=_1641049202-32669-1--