Re:The least interesting part about AVX-512 is the 512 bits ...
by jeffbee on Monday June 19, 2023 @10:06PM
(#36398878)
The compiler will only choose to use AVX-512 if you give it the right `-m` flags. Most people who are running generic distros that target the basic k8 instructions benefit from AVX-512 only when some library has runtime dispatch that detects the presence of the feature and enables optimized routines. This is common in, for example, cryptography libraries.
[ Parent
| on HN ]
Re:The least interesting part about AVX-512 is the 512 bits ...
by mattst88 on Monday June 19, 2023 @11:25PM
(#36399357)
Right. Since I'm using Gentoo and compiling my whole system with `-march=tigerlake`, the compiler is free to use AVX-512.
My question is just... does it? (And does it use AVX-512 profitably?)
Re:The least interesting part about AVX-512 is the 512 bits ...
by oconnor663 on Tuesday June 20, 2023 @01:33AM
(#36400120)
Why not use -march=native?
Re:The least interesting part about AVX-512 is the 512 bits ...
by aew4ytasghe5 on Tuesday June 20, 2023 @02:29AM
(#36400440)
Why not use -march=snark?
Re:The least interesting part about AVX-512 is the 512 bits ...
by inopinatus on Tuesday June 20, 2023 @06:12AM
(#36401911)
Surprisingly, -march=native doesn’t always expand to the locally optimal build flags we might expect, particularly with gcc on non-Linux platforms.
Re:The least interesting part about AVX-512 is the 512 bits ...
by oconnor663 on Tuesday June 20, 2023 @12:46PM
(#36406797)
Oh interesting. Is this one of those things where backwards compatibility eventually got in the way of the intended purpose?
Re:The least interesting part about AVX-512 is the 512 bits ...
by mattst88 on Tuesday June 20, 2023 @09:47AM
(#36403901)
I actually do. I just said -march=tigerlake to make it clear what CPU family the compiler was targeting.
Re:The least interesting part about AVX-512 is the 512 bits ...
by secondcoming on Tuesday June 20, 2023 @04:28AM
(#36401170)
In my experience it depends on the compiler. clang seems far more willing to autovectorise than gcc. Also, when writing the code you have to write it in a way that strongly hints to the compiler that it can be autovectorised. So lots of handholding.
Re:The least interesting part about AVX-512 is the 512 bits ...
by nwallin on Tuesday June 20, 2023 @04:51AM
(#36401350)
It will not use AVX-512 if you have CFLAGS="-march=tigerlake -O2". You will, at the very least, need CFLAGS="-march=tigerlake -O3" to get it to actually use AVX2, and tigerlake's AVX512 implementation is so poor (clock throttling etc) that gcc will not use AVX-512 on tigerlake. AVX-512 is used if you have -march=znver4 though, so the support for autovectorizing to AVX-512 is clearly there.
Re:The least interesting part about AVX-512 is the 512 bits ...
by aseipp on Tuesday June 20, 2023 @01:35PM
(#36407529)
Is it actually that bad on Tiger Lake? Or just for really high-width vectors? On my old Ice Lake laptop, single-core AVX-512 workloads do not decrease frequency at all even with wider registers, and multi-core workloads will result in clock speed degradation of a small amount, maybe 100Mhz or so.
Depends on a couple factors (i.e. Ice Lake client only has 1 FMA unit) but I'd be surprised if Tiger Lake was a major regression relative to Ice Lake. It seems like they had it in an OK spot by then.