Question The AVX-512 thread

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Thunder 57

Diamond Member
Aug 19, 2007
3,402
5,624
136
That C&C article is very in-depth but... it repeatedly compares against Intel's first gen AVX-512 - Skylake-X. That means a 2024 core vs a 2017 core which is rather unfortunate given there are Cooper Lake, Ice Lake, Sapphire Rapids, Emerald Rapids, and Granite Rapids.

They work with what they have. They don't get free parts unfortunately. Quality articles though. It's what Anandtech used to be.
 

soresu

Diamond Member
Dec 19, 2014
3,613
2,927
136
^^^ Dang! The odds of asking a fitness trainer chick out and becoming a dad one year later seem easier than what happened there!
I mean, at the end of the day the saying "the customer is always right" is pretty valid in the processor market as long as there is enough of a possible user base to take advantage of it.
 

soresu

Diamond Member
Dec 19, 2014
3,613
2,927
136
You can implement a LERP in two instructions with a FMA and an FNMSub (subtract instead of multiply on the third operand, and negate the multiplicand). And with AVX-512 you can do 16 of them simultaneously!
Yeah that fits with what I saw on Intel's dev forum.
 
Jul 27, 2020
23,093
16,257
146
Psst...




EDIT: Sadly, looks like the compiler cheated and didn't let the AVX-512 instructions go into the executable. Need to figure out how to stop the compiler from doing that...
 
Last edited:
Jul 27, 2020
23,093
16,257
146
EDIT: Sadly, looks like the compiler cheated and didn't let the AVX-512 instructions go into the executable. Need to figure out how to stop the compiler from doing that...
I hadn't looked around in Visual Studio Project properties. Apparently, you can force it to compile only for AVX-512 and even AVX 10.1 and Schmide also helped with code that doesn't let the compiler optimize away the AVX-512 instructions so it's now working in the AVX-512-only v0.02a executable of Rudi_Float_Bench.

Funny thing I found when searching for CPU feature detection in Microsoft docs. And I mean, I found it to be REALLY funny. Like LOL funny. Get this. Microsoft only provides AVX-512F feature detection support. That means, if you have anything less than an Ice Lake, the code will report that AVX-512 is not supported by your CPU.

How effing ironic that Microsoft thinks that all Intel Xeon CPUs with AVX-512 units before Ice Lake are worthless for AVX-512 execution so they didn't even provide API level support for detecting AVX-512 on them. I tested the code on Cascade Lake and Ice Lake Xeons. It only worked on the Ice Lake Xeon. And the worst thing was, the Cascade Lake Xeon is my company's $7000 server! Their fault for cheaping out and not going with Genoa like I asked them to.
 

MS_AT

Senior member
Jul 15, 2024
526
1,110
96
Because every AVX512 enabled CPU has to support AVX512F. F stands for foundation.

I tested the code on Cascade Lake and Ice Lake Xeons. It only worked on the Ice Lake Xeon.

That means msvc generated code that requires some subset that Icelake supports but Cascade Lake does not. But this is a problem with msvc.

Switch to clang in visual studio then enable only the subset you want using clang specific switches.

 
Jul 27, 2020
23,093
16,257
146
Because every AVX512 enabled CPU has to support AVX512F. F stands for foundation.

That means msvc generated code that requires some subset that Icelake supports but Cascade Lake does not. But this is a problem with msvc.
My complaint was regarding this: https://learn.microsoft.com/en-us/w...f-processthreadsapi-isprocessorfeaturepresent

Between AVX2 and AVX512F detection, there is no middle-ground. That means even if your AVX512 code runs fine on Cascade Lake Xeon, you can't use this function. Very unhelpful and you have no choice but to detect CPU family and use a table to decide whether to let the AVX512 codepath run.
 
Jul 27, 2020
23,093
16,257
146
Will Nova Lake bring it to par with AMD? Instruction wise
I'm not sure. They won't be able to resist making it incompatible with AMD's AVX512F by introducing a few new instructions in AVX10.2 which if we are lucky, may appear in Zen 7. So maybe (and a big one) is that ISA extension parity is achieved between Intel and AMD CPUs in Zen 7 and Razer Lake.

Interestingly, maybe it's a typo on the wiki page but what it says about AVX512F being available on Cascade Lake is wrong. Or Microsoft's function call is implemented wrong because it wouldn't detect it on Cascade Lake when I tried it.

 

MS_AT

Senior member
Jul 15, 2024
526
1,110
96
Interestingly, maybe it's a typo on the wiki page but what it says about AVX512F being available on Cascade Lake is wrong. Or Microsoft's function call is implemented wrong because it wouldn't detect it on Cascade Lake when I tried it.

View attachment 119482
It is right. As I said every CPU supports AVX512F including Cascade Lake, problem is msvc is using newer subsets but checks only for AVX512F and not the newer ones. In other words the check is insufficient for the codegen, hence my recommendation to use clang.
 
Reactions: igor_kavinski

Schmide

Diamond Member
Mar 7, 2002
5,635
832
126
I hadn't looked around in Visual Studio Project properties. Apparently, you can force it to compile only for AVX-512 and even AVX 10.1 and Schmide also helped with code that doesn't let the compiler optimize away the AVX-512 instructions so it's now working in the AVX-512-only v0.02a executable of Rudi_Float_Bench.

Funny thing I found when searching for CPU feature detection in Microsoft docs. And I mean, I found it to be REALLY funny. Like LOL funny. Get this. Microsoft only provides AVX-512F feature detection support. That means, if you have anything less than an Ice Lake, the code will report that AVX-512 is not supported by your CPU.

How effing ironic that Microsoft thinks that all Intel Xeon CPUs with AVX-512 units before Ice Lake are worthless for AVX-512 execution so they didn't even provide API level support for detecting AVX-512 on them. I tested the code on Cascade Lake and Ice Lake Xeons. It only worked on the Ice Lake Xeon. And the worst thing was, the Cascade Lake Xeon is my company's $7000 server! Their fault for cheaping out and not going with Genoa like I asked them to.

Are you saying the your Cascade Lake Xeon isn't reporting F functionality ? (PF_AVX512F_INSTRUCTIONS_AVAILABLE 41)

https://en.wikipedia.org/wiki/AVX-512#CPUs_with_AVX-512

One thing you're going to run into. If you enable AVX512f in your project, the compiler is going to use it. If you call a math library it's going to crash on lesser processors. You're probably going to have to subdivide your project into subprojects/libraries/dlls to maintain lesser compatibility.
 
Jul 27, 2020
23,093
16,257
146
One thing you're going to run into. If you enable AVX512f in your project, the compiler is going to use it. If you call a math library it's going to crash on lesser processors. You're probably going to have to subdivide your project into subprojects/libraries/dlls to maintain lesser compatibility.
It is reporting it, apparently but MS's detection routine is buggy I guess:



Going to try MS_AT's Clang suggestion first. If that doesn't work, my strategy will be to tell the user to expect a crash if they run it on unsupported hardware
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |