4 ms·
Do the instructions you use cause downclocking on Intel CPUs?
by CodesInChaos 7y ago
Do the instructions you use cause downclocking on Intel CPUs?
- eyegor 7y ago(not op) Somewhat, although it's fairly minimal for avx2. The serious downclocking problem comes from avx512 instructions, which the author seems interested in: > This algorithm should map fairly nicely to AVX-512, and should in fact be a bit faster than 2x the speed of AVX2 since a few instructions can be saved In general, you aren't going to make a faster wheel without some trickery (vectorization usually). All the obvious optimizations have already been made in the stdlibs.
- oconnor663 7y agoI can't remember where I read this, but there was an argument somewhere that worrying about downclocking only really makes sense when the instruction set in question is new. (Which AVX-512 certainly is, to be fair.) Eventually, when the instruction set is more widely used, you'll probably already be paying the downclocking penalty anyway because of someone else's code, and you might as well go ahead and use the fancy instructions in your own code. Do you think that's valid?
- oconnor663 7y ago(I remembered what it was: https://blog.cr.yp.to/20190430-vectorize.html https://blog.cr.yp.to/20190430-vectorize.html)
- littlestymaar 7y agoThere's a really good comment on reddit on the subject: https://www.reddit.com/r/rust/comments/dx6e0h/comment/f7o8avf https://www.reddit.com/r/rust/comments/dx6e0h/comment/f7o8av... TL;DR; yes but not too much if your CPU is high-end and if the number of AVX instructions is low enough (and the slowdown is negligible in front of the gains if the number of instructions is high).
- BeeOnRope 7y agoNo, because non-"FMA unit" (mostly SIMD FP) AVX2 instructions don't cause license-based downclocking on recent Intel CPUs. To get downclocking to L1 license (the middle speed tier), you need to use either FMA unit AVX/AVX2 insructions or any AVX-512 instructions. This algo doesn't use any of this, staying in the integer domain. Here's a longer description: https://stackoverflow.com/a/56861355 https://stackoverflow.com/a/56861355 Of course this doesn't address say power or temperature based throttling which might be more likely to occur when wide SIMD is used, but it's not possible to give a precise answer there, other than many low or moderate core count setups won't see this kind of throttling outside of extreme use cases.
- zwegner 7y agoThanks for the link, that's a good post! I hadn't investigated the throttling issues much in the past, not owning an AVX-512 machine, but that's much more precise than the standard "don't use AVX-512" meme that's repeated all over the place. Bookmarked!