3 ms·
Instead of doing more work with idle cores, why not spread the work out amongst them? This might provide a net savings in power consumption... Given that tech
by comatose_kid 18y ago
Instead of doing more work with idle cores, why not spread the work out amongst them? This might provide a net savings in power consumption...
Given that technologies like speedstep allow the voltage and frequency of a cpu to be modified dynamically, and that power consumption is governed by P = CV^2f:
Say we have a CPU with 4 cores with each core equivalent to a 1.6 GHz Pentium M. According to Wikipedia, the clock frequency on such a device can be stepped in 200 MHz increments over the range from 1.6 to 0.6 GHz. At the same time, the voltage requirement decreases from 1.484 V to 0.956 V.
So, say you have a workload that keeps one 1.6GHz core pegged to near 100%. Instead, why not spread this work to 3 cores, while lowering the speed to 0.6GHz and the voltage to 0.956V?
This would be equivalent to a 1.8GHz machine.
Would this save energy? The original power factor is:
1 core * (1.484^2) * 1.6 = 3.52
The new power factor is:
3 cores * (0.956^2) * 0.6 = 1.645
So, about half the power for this example. Of course, nothing is perfect, and spreading your workload amongst 3 cores will lose efficiency, and gain implementation complexity.
- jmtulloss 18y agoOf course spreading the work is a good idea, but most apps aren't built for multiple processors now, and unless they need to be, they won't be in the future. If an app is fast enough on one core, it won't be optimized for 8.
- wheels 18y agoOne thing that's interesting there is that toolkits are starting to contain elements to make parallelization easier. Qt specifically now has support via QtConcurrent for map and map-reduce patterns that are automatically farmed out to a threadpool the same size as the number of cores and it handles most of the hairy bits of doing threading. I've had to patch it heavily for my own use, but it's still a promising advance. I suspect we'll see more of the same in toolkits in the future.
- pmjordan 18y agoAnother thing you're not taking into account is that on modern CPUs, execution units that aren't being used are put in low-power states. So in the simplest case, pure integer code uses less power than integer/floating-point code, and a core doing nothing at all goes into "deep sleep". A practical consequence of this appears on a modern Core2 laptop, if you have a computational task of fixed size and let it run, once with speedstep locked to the lowest level and once with dynamic clocks. Obviously the dynamically clocked one will finish more quickly and sit idle after that. If you let it sit idle until the low-clocked one has finished, you'll find the low-clocked one will have consumed more total energy. This means that for occasional-load scenarios, the dynamic clocking gives longer battery life, and for heavy load it gives shorter waits. Spreading does make sense even in this light of course, as things like shared caches, memory and bus controllers need to run as soon as at least one core is active.
- Andys 18y agoThat would be a good idea for older chips like the Pentium M, but Intel's latest CPUs feature power gates so efficient that the current draw of an idle CPU that has been shut down, is very close to zero. Furthermore when all but one core is shut down, the clock speed of the remaining core can actually go UP by about 200mhz (called Turbo mode), providing a speed benefit to a single-threaded task.