4 ms·
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
by mattst88 3y ago
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?)
- oconnor663 3y agoWhy not use -march=native?
- aew4ytasghe5 3y agoWhy not use -march=snark?
- inopinatus 3y agoSurprisingly, -march=native doesn’t always expand to the locally optimal build flags we might expect, particularly with gcc on non-Linux platforms.
- oconnor663 3y agoOh interesting. Is this one of those things where backwards compatibility eventually got in the way of the intended purpose?
- mattst88 3y agoI actually do. I just said -march=tigerlake to make it clear what CPU family the compiler was targeting.
- secondcoming 3y agoIn 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.
- nwallin 3y agoIt 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. https://godbolt.org/z/1a39Mf3bv https://godbolt.org/z/1a39Mf3bv
- aseipp 3y agoIs 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.
- jeffbee 3y agoI guess a better question is why you rebuild the system without a rational basis to expect benefits.
- mattst88 3y agoAre you familiar with source-based distributions? I'm not rebuilding specifically for this one potential optimization.