From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mHDkF4bJo2F0vwAAgWs5BA (envelope-from ) for ; Sun, 28 Nov 2021 19:25:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kO6GE4bJo2HlNQAA1q6Kng (envelope-from ) for ; Sun, 28 Nov 2021 18:25:10 +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 05376295B6 for ; Sun, 28 Nov 2021 19:25:10 +0100 (CET) Received: from localhost ([::1]:53706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrOrN-0002JI-5T for larch@yhetil.org; Sun, 28 Nov 2021 13:25:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrOr1-0002J6-AO for guix-devel@gnu.org; Sun, 28 Nov 2021 13:24:47 -0500 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrOqz-00048t-82 for guix-devel@gnu.org; Sun, 28 Nov 2021 13:24:47 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1638123883; cv=none; d=zohomail.com; s=zohoarc; b=UQ6wy/3cjs7/Usdwp+jNeOKTl84Yi/vgBNaOb8rEi7ZgWK58lIS20QS2F/4ATBOPiNYOy7J+EhXNNyvv6KzaQCjncTttPhHfv97gV+0YN35RWwr1baWwBaOx2bPCWH7CKFNd81wzRkycYlqIzlxZtcH07AbyUYCxSAUpoM07g6k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638123883; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=cXGM1br3VaCkkAGL4ij/VH016UEhziKeUZKDWwHpaUk=; b=C26lI7q1xUhNdMuUOwsE+Jdsh4xVGVbGJxzs2ItEFOAAgURF4dgj61wz5lt8J8Pjye/Z2mHBnUH4R6SvFMLBe567Lvz22PZhqmWXgFf48Qvt7JzijhWrOjJIYn4+N2UJrVKqJX4rkz2RfvOvR2CuysoW9+gbZCGXCPswMCyfF9E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1638123883; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=cXGM1br3VaCkkAGL4ij/VH016UEhziKeUZKDWwHpaUk=; b=b0mogFlzztwTWQWRTACPZHXJR3upaEO9ttSxlM+6WtSXJ5dMknxg1jXrSUZ1CnFS nz5+8Y7DCe0ucCtUavgbTZ2L3+3KZiMZH2dyCJiexX3bQd0bltJ2ih2lAOVOZ/CnYt2 kCW7Sj5nfUKH/3JR7BCiNYKCBPORvnhdaq6pL9K4= Received: from localhost (p508e8bf2.dip0.t-ipconnect.de [80.142.139.242]) by mx.zohomail.com with SMTPS id 1638123880835829.8138966598107; Sun, 28 Nov 2021 10:24:40 -0800 (PST) References: <87ilwhu4zi.fsf@elephly.net> <86o867u6e1.fsf@gmail.com> <87sfvg9o7a.fsf@gnu.org> User-agent: mu4e 1.6.10; emacs 28.0.50 From: Ricardo Wurmus To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: build system option to allow CPU optimizations? Date: Sun, 28 Nov 2021 19:20:42 +0100 In-reply-to: <87sfvg9o7a.fsf@gnu.org> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Message-ID: <87fsrgnnoa.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.51; envelope-from=rekado@elephly.net; helo=sender4-of-o51.zoho.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638123910; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=cXGM1br3VaCkkAGL4ij/VH016UEhziKeUZKDWwHpaUk=; b=VIFN7dmb6XcL8Txfvkt8Q45XFKt90rWhTxK5ejlx2+oFGMf/uNldEoUgRMZ2vYhxNI/5Z6 MswnraklpPvFe0iRBr3hrLztpnki8LOV774hxX4vEMmYRK6+R8LZdPenl6cUzdgsQg/TDD HYIwAqEPhzBkIsp+oOVfhbpv+Dr/KHuHLhTf1bA9Px9COh3ppkdgE5I/EI6GHmNrGF76kb ksS6fuFmCksnUiNhEKH6Jy1J3deSiR/i3UcEFnHG5O7Ixc/dpYOjiEjwVqEBNvRrX0tCLH QP8QHEYW4ko0JDnwsRnIBCtMz7TuqiqwnooX5mUHodqAWgUcYZxnRmuoskZ14w== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1638123910; a=rsa-sha256; cv=fail; b=Cw/jOe+F4IWu54nmhSHDeZ+HfV2JTmG51VVhKzoh5thQidipoAl+TkVBlXbY7QM35qyOF1 KUngO3Ei7c9YVNY4m7nnH6qg+VdwlUTNF+EkVOxEUiWVG0ye6tHF6Ds5IVWHnaQoM5kds1 JvkakK/7XHPE33Axa6mYT93wkXN+f5hb3ZnZjMUU38VlQ602uEA1t/NdaCSUDlxIDafqT3 GXS4mDS5Hbjsawlsca57mPU/SroXHGddwdSEsU1kQKFnb2Upd8LG2S0XvvU7NAJlYXFs6t JW5ORyJQ/OgWqATDZKURsFenn7hURaMA5eqPS/rX9ZILiRdGhJGe3eOp2GblRw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=elephly.net header.s=zoho header.b=b0mogFlz; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=elephly.net header.s=zoho header.b=b0mogFlz; arc=reject ("signature check failed: fail, {[1] = sig:zohomail.com:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 05376295B6 X-Spam-Score: 0.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: Z0f8CTSLHmbu Ludovic Court=C3=A8s writes: > Hi, > > zimoun skribis: > >> On Wed, 24 Nov 2021 at 13:10, Ricardo Wurmus=20 >> wrote: >> >>> The build phases that patch out these features would have to=20 >>> check=20 >>> for that build system option, much like they check the TESTS?=20 >>> option before attempting to run tests. >> >> Then it could be a transformation. The idea sounds good to=20 >> me. > > I=E2=80=99ve been working on it last week with my HPC hat on. > > To be clear, I think in may cases, passing =E2=80=98-march=E2=80=99 like = you=20 > suggest is > the wrong approach; instead software should use (and usually=20 > does use) > function multi-versioning: > > https://hpc.guix.info/blog/2018/01/pre-built-binaries-vs-performance/ It may very well be the wrong approach in principle, but I also=20 think that it=E2=80=99s a neat escape hatch for specific use cases.=20 Separating reproducibility patching makes the package=20 transformation mechanism more powerful and appealing. Much like=20 respecting TESTS? makes it easy for users of modified packages to=20 bypass a failing test suite, making patching of Makefiles to=20 remove CPU tuning conditional would make for much less complex=20 custom package definitions. > I found one case though where this is not possible: C++=20 > header-only > libraries such as Eigen contain hand-optimized vectorized=20 > routines, > selected at build time, but we end up compiling Eigen users as=20 > the > x86_64/AArch64 baseline, which is a waste. (If you do know of=20 > other > problematic cases, I=E2=80=99m interested in taking a look!) > > My solution to that is =E2=80=9Cpackage multi-versioning=E2=80=9D via a=20 > transformation > option. Hopefully I=E2=80=99ll submit preliminary patches within a week= =20 > or so! Oh, exciting! --=20 Ricardo