Can SF use this?
It's incoming on Emerald Rapids.
AVX 512
Moderator: Ras
-
Jouni
- Posts: 3830
- Joined: Wed Mar 08, 2006 8:15 pm
- Full name: Jouni Uski
-
Eelco de Groot
- Posts: 4698
- Joined: Sun Mar 12, 2006 2:40 am
- Full name: Eelco de Groot
Re: AVX 512
There is every chance your Xeon processor, if you have that, already supports AVX 512 if you have a Xeon from 2016 onwards. But Intel tried to do without it on Alder Lake processors, for mysterious reasons. A strange war started between Motherboard builders that enabled the Alder Lake AVX code again on their motherboards, with Intel then counteracting that. I just read that, don't know anything more about it. But if you have an Alder Lake CPU then it depends on version numbers and motherboard if you can use it.
https://www.tomshardware.com/news/how-t ... ve-avx-512
More about AVX 512:
https://en.wikipedia.org/wiki/AVX-512
https://www.tomshardware.com/news/how-t ... ve-avx-512
More about AVX 512:
https://en.wikipedia.org/wiki/AVX-512
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
-
Werewolf
- Posts: 2082
- Joined: Thu Sep 18, 2008 10:24 pm
- Full name: Carl Bicknell
-
Werewolf
- Posts: 2082
- Joined: Thu Sep 18, 2008 10:24 pm
- Full name: Carl Bicknell
Re: AVX 512
My last Xeon was a 2697 Ivy Bridge.Eelco de Groot wrote: ↑Sat Jan 06, 2024 11:31 pm There is every chance your Xeon processor, if you have that, already supports AVX 512 if you have a Xeon from 2016 onwards. But Intel tried to do without it on Alder Lake processors, for mysterious reasons. A strange war started between Motherboard builders that enabled the Alder Lake AVX code again on their motherboards, with Intel then counteracting that. I just read that, don't know anything more about it. But if you have an Alder Lake CPU then it depends on version numbers and motherboard if you can use it.
https://www.tomshardware.com/news/how-t ... ve-avx-512
More about AVX 512:
https://en.wikipedia.org/wiki/AVX-512
-
Jouni
- Posts: 3830
- Joined: Wed Mar 08, 2006 8:15 pm
- Full name: Jouni Uski
-
petero2
- Posts: 734
- Joined: Mon Apr 19, 2010 7:07 pm
- Location: Sweden
- Full name: Peter Osterlund
Re: AVX 512
On my Ryzen 9 (zen4) I get no speedup for Stockfish from using AVX-512. I compiled myself from current git, using architectures x86-64-bmi2, x86-64-vnni512 and x86-64-avx512. The bmi2 version (which implies AVX-2) was actually faster than the AVX-512 versions. I compiled like this:
make -j16 build COMP=clang ARCH=x86-64-vnni512
I also tried gcc, which similar result.
Maybe other compiler flags are needed, but at least "perf top" shows that AVX-512 registers are used for the AVX-512 compiled versions. It just does not run any faster.
When I try the same thing using Texel, I get around 8% speedup from AVX-512 + VNNI.
I find this surprising, since Stockfish uses much larger nets than Texel does, so I would have thought it had more opportunities to utilize AVX-512 instructions.
My system is Ubuntu 22.04 with gcc 11.4.0 and clang 14.0.0.
make -j16 build COMP=clang ARCH=x86-64-vnni512
I also tried gcc, which similar result.
Maybe other compiler flags are needed, but at least "perf top" shows that AVX-512 registers are used for the AVX-512 compiled versions. It just does not run any faster.
When I try the same thing using Texel, I get around 8% speedup from AVX-512 + VNNI.
I find this surprising, since Stockfish uses much larger nets than Texel does, so I would have thought it had more opportunities to utilize AVX-512 instructions.
My system is Ubuntu 22.04 with gcc 11.4.0 and clang 14.0.0.
-
Magnum
- Posts: 195
- Joined: Thu Feb 04, 2021 10:24 pm
- Full name: Arnold Magnum
Re: AVX 512
Why do you use j16?petero2 wrote: ↑Sun Jan 07, 2024 1:36 pm On my Ryzen 9 (zen4) I get no speedup for Stockfish from using AVX-512. I compiled myself from current git, using architectures x86-64-bmi2, x86-64-vnni512 and x86-64-avx512. The bmi2 version (which implies AVX-2) was actually faster than the AVX-512 versions. I compiled like this:
make -j16 build COMP=clang ARCH=x86-64-vnni512
I also tried gcc, which similar result.
Maybe other compiler flags are needed, but at least "perf top" shows that AVX-512 registers are used for the AVX-512 compiled versions. It just does not run any faster.
When I try the same thing using Texel, I get around 8% speedup from AVX-512 + VNNI.
I find this surprising, since Stockfish uses much larger nets than Texel does, so I would have thought it had more opportunities to utilize AVX-512 instructions.
My system is Ubuntu 22.04 with gcc 11.4.0 and clang 14.0.0.
Try:
make -j profile-build COMP=clang ARCH=apple-silicon
and then:
./stockfish compiler
or try:
make -j profile-build ARCH=x86-64-vnni512 COMP=clang CXX=clang++
and then:
strip Stockfish.exe
-
Magnum
- Posts: 195
- Joined: Thu Feb 04, 2021 10:24 pm
- Full name: Arnold Magnum
-
Werewolf
- Posts: 2082
- Joined: Thu Sep 18, 2008 10:24 pm
- Full name: Carl Bicknell
Re: AVX 512
And get a very poor choice of software. Running Windows on Parallels doesn't help as it doesn't even support AVX2, let alone AVX512.