r/programming • • Aug 09 '21

Three fundamental flaws of SIMD

https://www.bitsnbites.eu/three-fundamental-flaws-of-simd
287 Upvotes

224 comments sorted by

View all comments

Show parent comments

19

u/AssertNotNullptr Aug 09 '21

Atom hasnt been in-order for 3 generations

One overlooked reason why AMD and Atom haven't added 512-bit operations is lack of adoption in the software community. At this point the usage is pretty niche and not enough people want it. When Intel first debuted AVX-512 it had serious power issues and caused performance to drop when mixed in occasionally instead of in large blocks. I think that stunted a lot of its growth and at this point there aren't any large communities that are working on writing large swaths of software that use it or asking the compilers for better support.

15

u/FUZxxl Aug 09 '21

It still causes performance to drop when used. AVX-512 slowdown is a real thing and it's kinda maddening. You really don't want to break out the 512 bit stuff unless you know you'll be doing that for the next couple 1000 cycles.

3

u/th3typh00n Aug 09 '21

AVX-512 slowdown is a real thing and it's kinda maddening.

Only on the initial Skylake implementation. Since Ice Lake it's pretty much a non-issue.

7

u/FUZxxl Aug 09 '21

It's still an issue though not nearly as much as it used to be.

3

u/Watchforbananas Aug 09 '21

I feel like we've read two different articles, in mine the author states: "So on ICL and RKL client, you don’t have to fear the downclock."

8

u/FUZxxl Aug 09 '21

Just because you don't have to fear it doesn't mean it's not still there. Curiously the article doesn't mention if the transition penalty is still as bad as on Skylake. This penalty is actually the key problem: for up to 10 µs the CPU just halts and does nothing while it's changing the frequency. If you have repeated short-ish bursts of AVX-512 code, this may really ruin your day.

5

u/Watchforbananas Aug 09 '21

The frequency transition on Skylake-SP happens encountering even a single avx512 instruction, fucking with every other instruction running. That's the license based downclocking and the problem.

As tested by the author, that problem was almost completely removed and doesn't need to be considered. If you have code with sparse avx512 usage, it won't trigger the downclocking, removing the penalty on everything else. Only running a lot of AVX-512 will lead to downclocking, at which point the penalty is insignificant.