From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6I6MC2t+u2HcAgAAgWs5BA (envelope-from ) for ; Thu, 16 Dec 2021 18:59:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2GtQB2t+u2HPFAAA1q6Kng (envelope-from ) for ; Thu, 16 Dec 2021 17:59:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DCA6EEFD6 for ; Thu, 16 Dec 2021 18:59:06 +0100 (CET) Received: from localhost ([::1]:41668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxv22-0007dq-1Y for larch@yhetil.org; Thu, 16 Dec 2021 12:59:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxv1y-0007cH-Gq for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxv1y-0007y7-8g for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxv1x-0006k7-Ts for guix-patches@gnu.org; Thu, 16 Dec 2021 12:59:01 -0500 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639677546; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+Enig7YkUOe/RQxkhEBZFtYE9IRiqkyyIJ8hADpvy94=; b=W8gSrkXVQNdlE6sfsOqGTPOGCkpSps+o+B5WG6eAGlYLz1o7HTtImBXp4SBeVH4VSC989D 4dvWGCl9NQtuwvchfAlpbINQ+dEZcmosyf2x7Jgz2IwRFKGDXgDoiNZwuaCxtILUQiQBcU bSCR9Gawl/36BQykINKgx7vtkQ4mVyZeBN62n49IaxLngi2/5jhEIglWv7PqRlZGh5Jkis 5pXyD9U78cPNsHRSTBXgifOtaUZyfhGJ+LDDNvAw82/imimfJZq0uBqtGHy3hadZo9TZIx YbKbDza1DhKircREhLnbKsYBGBrI0WvWa5FY2WYvPUPipyr/KZf8xHoAvN8OmA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639677546; a=rsa-sha256; cv=none; b=lnp2mlmRGPdEVJh3oG7Tl3PvCK+JmyB1MSvoKOtAdlmhQjZkA61dNeH5vCmMZ1+uw8qkf1 WDYAihLoSVMwXlJFXj7SUbJM+KT67GV1Uom2LYKt4H8scwpisOd8kSMiYwxyDfOeY8PuHs 54Ft1/PVMsPamxelOW3xQavSATLRRp4DlvgJRQMcyaeHYur2AFx0xURc454Ohklc0y3CC4 UvH2JYjnW1pKte0+fkXiy61p7cYFXmGBXGCTFIN56HEm5NmFPgeEObC6CGvWKCKyMr2G5i s07fir8T7wQgVsIF0K9i1nGyVflF06Fz+fV/NufMdcrNdj6O6P+/U62J58eWDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=LC59kdbz; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=LC59kdbz; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DCA6EEFD6 X-Spam-Score: -3.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: BSf1a9uuSJ2v 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