by paulmd · 6y ago · 0 comments
Furthermore, AVX-512 is about much more than doubling the vector width, it is a significant overhaul to the instruction set and adds many new operations and "fills in gaps" that were missing from previous instruction sets. It in fact would be perfectly valid and good to implement AVX-512 with a 256-bit unit that takes twice as long to run 512-bit width instructions. This completely negates all his points about die space utilization right from the start - AVX-512 support does not imply a significantly larger use of space than previous AVX instructions. This would also fix some of the power-related problems on Skylake-SP - after all if you go from 2 512-bit wide units to 2x256 gangable units or 1x256 running at half-rate, that reduces power correspondingly and you no longer need to drop clocks so strongly to offset this, but you keep the functionality added in AVX-512.
Furthermore, it's not like there are massive gains in general IPC that haven't been tapped. AVX-512 has taken 25% of the die area in some instances, if you dropped that to AVX2 (assume 12.5% of die area) then it's not like the processor would be 12.5% faster in general, that would translate to maybe 2-3% faster in general and a 30%+ loss in specialty applications. Once you've mostly explored general-purpose gains and are into diminishing returns territory (which modern processors certainly are), it makes sense to start looking at "specialty units", like AVX, or on GPUs you've got tensor cores and BVH traversal units, and so on. These can provide big speedups in key tasks at the cost of very little "general" performance (since that's already in diminishing returns territory).
The biggest thing slowing down AVX-512 adoption has been, yet again, 10nm. Right now it is only available on Skylake-X and Skylake-SP products, and more recently Ice Lake (which came out September of last year, in only the ultrabook segment, supplemented by 14nm in the mobile workstation segment as well as the ultrabook segment). So right now it is available in less than 1% of the desktop "fleet" and probably less than 1/8th of the laptop "fleet". There is very little reason to implement code paths for an instruction set that nobody can execute. Over time, as Ice Lake and Tiger Lake build share of the laptop "fleet", Rocket Lake implements it on desktop, and AMD implements it whenever, it will see more usage, just like prior AVX sets.
It really is wider-market than people realize. I have seem many people scoff and say "well you'll never see it used in games or whatever", but for many years now there have been games that simply will not run if you don't have AVX (notably many Ubisoft titles), there is no fallback SSE/scalar codepath. In another 10 years you will probably have AVX-512 mandatory games as well.
With all due respect to his long career in software engineering, that doesn't necessarily translate to processor design. This is just one person's opinion and you are under no obligation to accept it as gospel just because it's Torvalds'. See also: his weird ZFS rant.
(This seems to be a common thing with software engineers in particular, including many on this site - can't count how many "one weird fix from a software engineer to fix [complex domain problem] in [chemical/materials/aerospace engineering]" I've seen. I of course have no particular expertise in processor design either, but the engineers at Intel presumably do, and they thought it was a good idea.
However, his particular career includes a stint at Transmeta, so he has probably thought about processor design a bit more than the average tenured software engineer. And it might also account for some of his bitterness toward Intel.
The extra registers have to be there even if the execution unit is half size. The context switching overhead grows, which is something kernel developers care about. And then with all these variants there's a push to have a single binary support them all which complicates the code too. Meanwhile the world is moving toward parallelism which is going to mean more thread creation and context switching.
Linus does have valid concerns here.
If in doubt, search on "daniel lemire" "simd".
Downclocking because of overheating and insane waitcycles to get out of this mess which is AVX512, plus poor HW support (only on insecure Intel CPU's which need to be probed at runtime) makes it an esoteric extension. AVX256 is good enough for most purposes and is not that insane.
[1] https://lemire.me/blog/2018/06/07/vectorizing-random-number-...
[2] https://lemire.me/blog/2018/09/07/avx-512-when-and-how-to-us...
[3] https://lemire.me/blog/2018/08/15/the-dangers-of-avx-512-thr...
> Lack of adoption of AVX-512 would be Intel's own issue. If they wanted it to succeed, they would try to put it on more chips than just the few lines you mentioned. As it currently stands, Intel is setting up AVX-512 to fail by only putting it in so few products.
It will be fun to revisit these sorts of comments next year when AMD releases Zen4 based processors that support it. Like with raytracing, I suspect people's tune will change when the red man does it instead of the blue man or green man ;)
(it may even be in Zen3, that "50% improved FP performance" sure is interesting if you figure that's about what you would get from ideal-case speedups of AVX-512... I suspect they are moving to dual 256b units and at that point you might as well make them gangable into a 512b unit. If they don't go there with Zen3 it is an obvious low-hanging fruit for Zen4.)
Having 2x 512b units crushes the clocks. That is a factor of vector width (and having multiple units), not the instruction set itself. Half-rate AVX-512 would in all probability run at the same speeds as AVX2, and allows significantly more flexibility than "mere" 256-bit AVX2.
That's perhaps something that is not clear from Linus - whether he is railing against the instruction set, or the implementation in Skylake-SP, or both (I think it's both). I would probably agree that Skylake-SP takes it too far with dual AVX-512 units, but the instruction set itself ("stop inventing magic instructions"), yeah he's way off base.
I am really hoping that one of these Zen generations, AMD includes half-rate AVX-512 like they had half-rate AVX2 in Zen1/Zen+. That really seems like the best of both worlds, you get the flexibility of AVX-512 but without the die area or the power issues. If not, well, Rocket Lake is coming end of this year/early next year and that should bring AVX-512 to consumer platform desktop (as it's in Tiger Lake and Rocket Lake will be a Tiger Lake backport) and will probably have only a single AVX-512 unit since it's mobile-derived.
Cloudflare had complaints as well. Even if you just have a fraction of your code running 512, you take a big hit.
Cloudflare talks about a 0.3% 512 workload (ie, a cryto library for SSL) blowing up their throughput.
"It is equivalent to giving up on two cores, for nothing."
https://blog.cloudflare.com/on-the-dangers-of-intels-frequen...
Do you / Intel GUARANTEE no frequency scaling to handle 512?
Intel quotes these specs on throughput and seem to do it using full frequency for FP. But if you have 512 in your mix (ie, 1-2% 512) do you really get that speed. Cloudflare talks about frequency dropping to 1.4Ghz
Someone made a comment about special purpose instructions being the future. I think that is true, in part, but those instructions might be better off on an accelerator of some kind, or at least interfaced to the chip in a way that is better than how AVX512 must be used.
The problem with the coprocessor model is that it adds an enormous amount of latency. A lot of things aren't worth pushing off to a GPU because it adds so much time, and because there is a limited amount of bandwidth to push it all there and back.
Furthermore, the farther you are sending something, the more power you need to do it. Sending it off-chip is significantly less efficient than doing it on-chip, all things equal.
RTX is sort of a microcosm of these problems - people really wanted NVIDIA to implement RTX as an off-die "accelerator chip" (and some dumb rumors are even bringing this topic back for the 3000 series despite all the reasons it doesn't work). But it actually makes no sense to separate this - you can't just push it off to the RT core and be done with it, after RT finds collisions you need to go back to shaders and do stuff with it, so it needs to be feasible to flip back and forth between shading, RT, and back to shading. Moving it off die would mean that you now have some kind of async thing or buffer going on and that would kill latency and make it infeasible for real-time shading at least. Furthermore you have cache benefits if everything stays paged in while you are finishing up one tile.
Or another example would be Fusion - sure the idea of having coherent memory and triggering the GPU "like an AVX unit" sounds great but it's only unidirectional cache coherency - the GPU reads an up-to-date picture of the CPU but the CPU is not optimized to read out of the GPU, so while it can work in this mode the performance is "singularly poor". This means that "flipping back and forth" does not really work here either, it is structured as a CPU-to-GPU pipeline, not a general purpose coprocessor. With as much as they were pushing Heterogeneous Systems Architecture, presumably they couldn't reasonably implement that without trashing GPU performance, cause if they could I bet they would.
https://www.realworldtech.com/fusion-llano/3/
Integrating specialty units into the core is the tradeoff between latency and performance - it's nowhere near as much performance as a dedicated accelerator, but it's nowhere near as much latency either. Depending on how much work each item needs done, it may be better to do it on-core and keep trucking. And often this is not particularly expensive - things like crypto acceleration instructions are basically uncontroversial.
And that is analogous to something like BVH traversal units on NVIDIA, where a ~5% die area expenditure speeds up that segment of the program by 8x or so and results in 2x performance improvements program-wide in some cases. The NVIDIA equivalent to AVX-512 would be tensor cores I suppose - not all that useful to general workloads (apart from DLSS), consuming a fairly significant amount of die area (around 10-15% iirc) but greatly desired by some subset of HPC customers to whom NVIDIA really wants to cater.
As we see though, if you need to "trigger" the unit you may have problems. In this case AVX triggers a cooldown. Running the AVX instructions right now is just as if you triggered an alternate mode.
The examples you give citing NVIDIA seem to be more inline with what I'm suggesting. The shared memory fabric allows fast offload the the extremely specialized processing units.
The issue is these terms are fluid. It used to be that PCIe was the fabric, but now that's too slow, so what is on the die is the fabric, etc.
Not all AVX instructions trigger a cooldown to build voltage, only 512-bit ones or 256-bit multiplies. So the penalty in these cases is in fact zero unless you are doing a lot of them and triggering cumulative power cooldowns (in which case you are seeing a large benefit in throughput, although potentially you should consider offloading them at that point, yes).
Also, AMD doesn't have cumulative power cooldowns or clockdowns at all, that is an Intel implementation detail, not a fault of the instruction set.
> The examples you give citing NVIDIA seem to be more inline with what I'm suggesting. The shared memory fabric allows fast offload the the extremely specialized processing units.
No, actually, despite some confusing block diagrams, RTX and tensor cores are actually part of the SM engine, not "standalone units" in a different part of the chip. They live right next to the shaders.
There is no "fabric" there, it is execution units working on registers just like any other instruction.