-1

I recently heard from my colleague that vectorized CPU operations (SIMD) does not go well with the overclocked CPU. I tried to search more about this online, but couldn't find any information. Could any expert explain more about this please?

Thank you!

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Hedgehog
  • 77
  • 5
  • 1
    I hope the right people, you know who you are, find and answer this question before it's closed. The answer's gonna be interesting regardless of whether it's "Your colleague is on crack and here's why." or "Your colleague is right and here's why." – user4581301 Apr 05 '23 at 20:16
  • 3
    IMO, this is off-topic here. Maybe superuser.com fits better (but there might be another better SE site). Btw, how is your question related to [eigen]? – chtz Apr 05 '23 at 20:38
  • 1
    Simd generally enables higher throughput and requires more power. If your overclocked cpu can't handle that then it's been overclocked too much and will probably be generally unstable anyway (lots of programs make use of simd, even if it's just the automatically generated compiler optimisations) – Alan Birtles Apr 05 '23 at 20:46
  • @user4581301 Looks like you got your wish... – Paul Sanders Apr 05 '23 at 21:55
  • @PaulSanders I figured I would when I saw the edit. – user4581301 Apr 05 '23 at 22:22

1 Answers1

4

This arguably belongs on https://superuser.com/ since it's not about programming, it's about overclocking, but maybe we can spin this into a question about [cpu-architecture] and how CPUs work.

SIMD instructions make more heat at the same voltage/frequency than scalar code; for example the Prime95 stress test is one of the most demanding for an overclock (near max throughput SIMD FMAs). It uses the mantissas of double-precision floats to do extended-precision integer math, because until AVX-512 IFMA, the double-precision mantissa multipliers are the highest-throughput way to do integer multiplies.

The higher the voltage, the more heat the CPU makes for the same amount of work. And at higher frequency, that work happens over less time, so also higher power.

Higher temperatures can slow down signal propagation and logic gate delay time in silicon, making the timing even tighter for having the right outputs ready for the next pipeline stage before the end of a clock cycle. This can lead to wrong computational results at high temperatures for a frequency/voltage that was stable at lower temperatures.

Some people claim their overclock is stable even if it sometimes fails (gets wrong answers or even locks up) when running Prime95. Those people are wrong. That's only stable for a limited subset of what a CPU is supposed to be able to do, like maybe they only care about some games which don't run that hot.

Also, if you're so close to the limit of stability that maybe 10 degrees C higher CPU temperature makes it start crashing or giving numerically wrong answers, there's probably a risk that you'll occasionally get problems like that at lower temperatures on other workloads that aren't quite as stressful.

Being stable with Prime95 or other very high-heat workloads gives you a lot more confidence that anything else you do with the CPU will give numerically correct results. For example, other workloads that involve heavy FP math, like matrix operations using Eigen which you tagged.

(Crashing when overclocked is often because integer math computed a wrong pointer. But I guess it could also be due to the out-of-order exec machinery itself getting errors and losing track of in-flight instructions. Maybe the critical path latencies in those parts of the CPU tend not to be so close to the cycle time, so less in danger of not getting all their work done in one clock cycle.)


Power supply voltages can dip when SIMD instructions suddenly start running, producing a huge spike in current demand; even if it doesn't last for long, this could maybe be enough to get a wrong answer. Some of this is related to why Intel CPUs cap their max turbo lower when "heavy" 256-bit or 512-bit SIMD instructions are running. Or even at the same frequency, might need to raise the voltage to give more headroom. See SIMD instructions lowering CPU frequency for how Intel does it.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • Always a pleasure to read your stuff, Peter. Overclocking = in need of a hobby, imo. – Paul Sanders Apr 05 '23 at 21:55
  • @PaulSanders: Overclocking is interesting in terms of seeing whether a new CPU design is limited in frequency just because of power / cooling and the TDP the vendor chose to spec it for (lots of overhead for frequency gains with more cooling), or if they're also close to the worst-case critical path gate delay through a pipeline stage being near the cycle time. In the latter case, the vendor's ability to make faster CPUs in the next generation might require design changes, like longer pipelines (e.g. higher latency for some instructions or some part of the front-end). – Peter Cordes Apr 05 '23 at 22:11
  • So in terms of giving some insight into the CPU design. Or a mild overclock with a beefier cooler is all well and good, and something normal people might do. (Although having a quieter more power-efficient computer is preferable to me, vs. having fans that noisily spin up.) Spending huge amounts of time pushing the limits *is* a hobby. Like collecting toys instead of playing with them. Not one I take part in, but I'm not going to crap on anyone for it, especially not those who publish their results and contribute to our understanding of current CPU designs. – Peter Cordes Apr 05 '23 at 22:15
  • Fair enough. I guess it's just not my bag. My heat sink came loose a while back and it was a while before I noticed (I know, I know, keep an eye on the temperature monitor). Turned out it was running perfectly happily around 100C, and after I re-seated the heatsink it was (and still is) perfectly OK. It's a Core i5 8th gen, they don't make 'em like they used to :) – Paul Sanders Apr 05 '23 at 23:11
  • 1
    @PaulSanders: What you describe sounds normal if you haven't overclocked the frequency. The stock speed limits are set to be able to run correctly at any temperature up to the point where it throttles to avoid damage and to avoid getting any hotter. (Also, that throttling itself reduces frequency which means you're not in danger of having a result not ready by the end of a clock cycle. Or perhaps even halts the clock if temp gets even higher.) – Peter Cordes Apr 05 '23 at 23:16
  • Thanks. Makes me even more glad that I didn't monkey with any settings. – Paul Sanders Apr 05 '23 at 23:18
  • @PaulSanders: In terms of "they don't make em like they used to" being accurate, yes technically true, much older CPUs (a decade or two before your 8th-gen maybe) didn't have nearly as good throttling, and would have crashed and/or been permanently damaged by overheating. And/or probably would have slowed down so much that you'd have noticed sooner; modern CPUs can idle or do light work at very low power. – Peter Cordes Apr 05 '23 at 23:19
  • Yes, I've had that experience. Burned my finger on the die, in fact (details irrelevant), yet the CPU still survived (Athlon 64). – Paul Sanders Apr 05 '23 at 23:23