From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pjotr Prins Subject: Re: Optionally using more advanced CPU features Date: Sat, 26 Aug 2017 07:14:50 +0200 Message-ID: <20170826051450.GA22234@thebird.nl> References: <87inhhw1ms.fsf@elephly.net> <19eb4906-44d1-723b-94ba-9ab86dfbedf5@uq.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlTRh-0002k8-DV for guix-devel@gnu.org; Sat, 26 Aug 2017 01:15:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlTRe-0006Yi-7U for guix-devel@gnu.org; Sat, 26 Aug 2017 01:15:45 -0400 Received: from mail.thebird.nl ([95.154.246.10]:35181) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlTRd-0006XI-Tf for guix-devel@gnu.org; Sat, 26 Aug 2017 01:15:42 -0400 Content-Disposition: inline In-Reply-To: <19eb4906-44d1-723b-94ba-9ab86dfbedf5@uq.edu.au> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ben Woodcroft Cc: guix-devel On Sat, Aug 26, 2017 at 11:39:41AM +0800, Ben Woodcroft wrote: > I was wondering how we should go about optionally building software for > more advanced CPU features. Currently, we build software for the lowes= t > common feature set among x86_64 CPUs. That=E2=80=99s good for portabil= ity, but > not so good for performance. >=20 > In many cases we can set the --with-arch flag when configuring GCC, = so > that packages built with that GCC are optimised for that architectur= e > by default. > We have discussed this in the past, > ([1]https://lists.gnu.org/archive/html/guix-devel/2016-10/msg00005.h= tml > ) but as you say individual packages sometimes need individual > attention. > Anyway, to move forward I created a repo so that package recipes can= be > modified to use a GCC that has been optimised for a particular > architecture. I put it out there so that it is more than just a patc= h > on this ML, but I'd be happy to incorporate it into Guix proper if t= hat > is desired. > [2]https://github.com/wwood/cpu-specific-guix > For instance, to build DIAMOND optimised for sandybridge: > GUILE_LOAD_PATH=3D/path/to/cpu-specific-guix:$GUILE_LOAD_PATH\ > guix build -e '(begin (use-modules (cpu-specific-guix) (gnu packages = bioinform > atics))\ > (cpu-specific-package diamond "sandybridge"))' >=20 > HTH, ben Pretty cool. This works for leave-packages. For libraries we'll need to have something that goes deeper into the graph. Openblas/atlas/GSL are prime examples that would benefit a wide range of applications. I am working on GEMMA these days and I will target supercomputing architectures. Having math libraries that target vectorization optimizations for gcc and LLVM would be very useful. The current deployment strategy is 'one-offs' on the GUIX_PACKAGE_PATH. Just as a note, it makes no sense to optimize all Guix packages. In fact I prefer we have the non-optimized by default since that is what everyone is using and is (arguably) well tested. We only have the 1 in a thousand library we want to specialize/optimize aggressively. Pj.