all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#64188] [PATCH 0/8]  More package tuning
@ 2023-06-20  7:48 Efraim Flashner
  2023-06-20  7:51 ` [bug#64188] [PATCH 1/8] gnu: %gcc-11-x86_64-micro-architectures: Add generic options Efraim Flashner
                   ` (9 more replies)
  0 siblings, 10 replies; 31+ messages in thread
From: Efraim Flashner @ 2023-06-20  7:48 UTC (permalink / raw)
  To: 64188
  Cc: Efraim Flashner, Christopher Baines, Josselin Poiret,
	Ludovic Courtès, Mathieu Othacehe, Ricardo Wurmus,
	Simon Tournier, Tobias Geerinckx-Rice

with gcc-11, gcc gained support for using -march=x86_64-v{1,2,3,4},
which I'm calling 'generic options,' as opposed to the more targeted
tuning we have with specific architectures.

Unfortunately there doesn't seem to be a way to map our current
architectures to these ones, making it harder to swap between them. The
best I've found is that any architecture which can use the Haswell
architecture optimizations can also use x86_64-v3. I suppose we could
create a mapping so that, as a fallback, anything haswell or higher
would use x86_64-v3, anything else would use x86_64-v1. This would help
with --tune=native.

For the second patch, 'Add inexact cpu matching,' I'm unsure about
needing to check for the avx512f flag; I don't have any hardware to
test with.

Patches 3 and 4 I tested on my machine (with commenting out the AMD
branch) and it successfully decided I should use x86_64-v3.

go cpu tuning targets: I mostly used the chart¹ on the go website, and I
also checked the source code for go-1.18. I put in arm{5,6,7} as arm and
not armhf since armhf only works with armv7 and with go programs, since
they're statically linked, they can just be copied to other machines.

The 6th patch, adjusting the transformations to also do go packages, I
tested with syncthing.  with '--tune' it failed during the added phase,
trying to tune for znver2, with '--tune=x86_64-v3' it worked without
problems.

Having written this out, I think our best bet would be to use a
generalized >=haswell -> x86_64-v3, else x86_64-v1, and not worry about
individual micro-architectures and specific chipsets. That would ensure
'--tune=native' should just work with go packages.

As far as tuning go packages, my understanding is that pretty much every
non-trivial go package can benefit from tuning.

EDIT:

I added two more patches on-top of the initial 6 to implement
gcc-architecture->generic-architecture and then use it. For patch 7, the
other option I had instead of returning gcc-architecture on no-match
would be to return "generic".

¹ https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support

Efraim Flashner (8):
  gnu: %gcc-11-x86_64-micro-architectures: Add generic options.
  guix: cpu: Add inexact CPU matching.
  guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture.
  guix: cpu: Refactor cpu->gcc-architecture.
  gnu: go: Add CPU tuning targets.
  transformations: Allow tuning go packages.
  guix: cpu: Add gcc-architecture->generic-architecture mapping.
  transformations: Allow autotuning for go packages.

 gnu/packages/gcc.scm     |   4 +-
 gnu/packages/golang.scm  |  23 ++++++-
 guix/cpu.scm             | 128 ++++++++++++++++++++++-----------------
 guix/transformations.scm |  43 +++++++++++--
 4 files changed, 135 insertions(+), 63 deletions(-)


base-commit: d884fc9e2efecfba09af4694f5a13ad7fc6f704f
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2023-08-21 17:34 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-20  7:48 [bug#64188] [PATCH 0/8] More package tuning Efraim Flashner
2023-06-20  7:51 ` [bug#64188] [PATCH 1/8] gnu: %gcc-11-x86_64-micro-architectures: Add generic options Efraim Flashner
2023-06-25 20:49   ` [bug#64188] [PATCH 0/8] More package tuning Ludovic Courtès
2023-06-20  7:51 ` [bug#64188] [PATCH 2/8] guix: cpu: Add inexact CPU matching Efraim Flashner
2023-06-20  7:51 ` [bug#64188] [PATCH 3/8] guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture Efraim Flashner
2023-06-20  7:51 ` [bug#64188] [PATCH 4/8] guix: cpu: Refactor cpu->gcc-architecture Efraim Flashner
2023-06-20  7:51 ` [bug#64188] [PATCH 5/8] gnu: go: Add CPU tuning targets Efraim Flashner
2023-06-20  7:51 ` [bug#64188] [PATCH 6/8] transformations: Allow tuning go packages Efraim Flashner
2023-06-25 20:52   ` [bug#64188] [PATCH 0/8] More package tuning Ludovic Courtès
2023-06-26  8:34     ` Efraim Flashner
2023-07-13 15:27       ` Ludovic Courtès
2023-07-17 12:02         ` Efraim Flashner
2023-07-17 15:41           ` Ludovic Courtès
2023-07-18 11:17             ` Efraim Flashner
2023-07-19  8:39               ` Josselin Poiret via Guix-patches via
2023-08-07  7:33               ` Ludovic Courtès
2023-08-21 16:54                 ` bug#64188: " Ludovic Courtès
2023-06-20  7:51 ` [bug#64188] [PATCH 7/8] guix: cpu: Add gcc-architecture->generic-architecture mapping Efraim Flashner
2023-06-25 20:54   ` [bug#64188] [PATCH 0/8] More package tuning Ludovic Courtès
2023-06-26  8:34     ` Efraim Flashner
2023-06-20  7:51 ` [bug#64188] [PATCH 8/8] transformations: Allow autotuning for go packages Efraim Flashner
2023-06-25 20:47 ` [bug#64188] [PATCH 0/8] More package tuning Ludovic Courtès
2023-06-26  8:34   ` Efraim Flashner
2023-06-26 12:38 ` [bug#64188] [PATCH v2 0/7] " Efraim Flashner
2023-06-26 12:38   ` [bug#64188] [PATCH v2 1/7] gnu: %gcc-11-x86_64-micro-architectures: Add psabi entries Efraim Flashner
2023-06-26 12:38   ` [bug#64188] [PATCH v2 2/7] guix: cpu: Add generalized CPU matching Efraim Flashner
2023-06-26 12:38   ` [bug#64188] [PATCH v2 3/7] guix: cpu: Rewrite fallback for x86_64 cpu->gcc-architecture Efraim Flashner
2023-06-26 12:38   ` [bug#64188] [PATCH v2 4/7] guix: cpu: Refactor cpu->gcc-architecture Efraim Flashner
2023-06-26 12:38   ` [bug#64188] [PATCH v2 5/7] guix: cpu: Add gcc-architecture->micro-architecture-level mapping Efraim Flashner
2023-06-26 12:38   ` [bug#64188] [PATCH v2 6/7] gnu: go: Add CPU tuning targets Efraim Flashner
2023-06-26 12:38   ` [bug#64188] [PATCH v2 7/7] transformations: Allow tuning go packages Efraim Flashner

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.