S4 · Lesson 15 · Heterogeneous multicores
Big and little cores, asymmetric and dynamic chips, and scheduling for energy
Every phone and most laptops pair a few big, fast cores with several small, efficient ones. The reason is in two of the course's rules: Pollack's rule says a core's performance grows only as the square root of its area, while its power grows about in proportion to its area, and Amdahl's law says the serial part of a program decides how far parallelism helps. A chip with one big core for the serial part and many small ones for the parallel part beats any chip of identical cores, and a scheduler that puts each thread on the right kind of core saves energy as well.
- The curves are Hill and Marty's speedups for a chip of 256 base-core units against the size r of its cores: symmetric (all cores r units) and asymmetric (one r-unit core plus 256 − r single-unit cores), for parallel fraction f.
- The symmetric chip peaks at small cores and falls as they grow; the asymmetric chip keeps one big core for the serial part and still has many small ones.
- The dashed line is the ideal dynamic chip, which fuses all 256 units into one core for the serial part and splits them for the parallel part.
Predict
A chip has 256 base-core units and runs code that's 97.5% parallel. The best symmetric design reaches a speedup of about 51. What does an asymmetric design with one 64-unit core and 192 single-unit cores reach?
The serial 2.5% runs on the big core at times a base core; the parallel part runs on everything at once, base cores' worth: . A symmetric chip of 64-unit cores would reach only 30, because four big cores do little for the parallel part.
Name it
Pollack's rule and power
A core built from r base units performs about times as well and draws about r times the power, so its performance per watt falls as . Big cores buy speed on serial code at a steep energy price.
Hill and Marty's three chips
For n base units and parallel fraction f:
- Symmetric, n/r cores of r units:
- Asymmetric, one r-unit core plus n − r one-unit cores:
- Dynamic, all n units fused for serial work and split for parallel work:
Scheduling
An operating system with big and little cores (Arm's big.LITTLE and DynamIQ, Intel's performance and efficiency cores) moves threads by their behavior: compute-bound threads gain the most from a big core; memory-bound threads, which mostly wait for DRAM, gain little and run more efficiently on a little one. Energy for a task is power × time, so a core that's three times faster but draws ten times the power uses 3.3 times the energy.
Worked example
A big core runs 3 times faster than a little core and draws 10 times the power. How much energy does each use for the same task, and when is the big core still the right choice?
Show the solution
- Energy ratio. Energy is power × time, so the big core uses times the energy of the little one.
- When the big core is right. It's the right choice when the task is on the critical path (a user is waiting, or it's the serial part holding up parallel work).
- Or to sleep sooner. It also wins when finishing quickly lets the whole chip, with its leakage, go to sleep sooner.
Answer the big core uses 3.3 times the energy; it's still right for critical-path work, or when finishing early lets the whole chip sleep.
Worked example
For the same 256-unit chip, what does the ideal dynamic design reach at f = 0.975, and why is it better than the best asymmetric one?
Show the solution
- Dynamic speedup.
- Serial part. It runs on all 256 units fused into one core, 16 times a base core.
- Parallel part. It uses all 256 units as small cores.
- Compare with asymmetric. The asymmetric chip has to keep its big core's area as one core even in parallel phases, where it's worth only 8 small cores.
Answer the ideal dynamic design reaches 186, because it gets the big core's speed in serial phases and every unit as a small core in parallel phases.
Worked example
A memory-bound thread speeds up 1.3 times on a big core; a compute-bound one speeds up 3 times. With one big core free, which should get it?
Show the solution
- Compare the gains. The compute-bound thread gains 3 times for the big core's cost, while the memory-bound one gains only 1.3, since its time is mostly spent waiting for DRAM whatever core it's on.
- The memory-bound thread on a little core. It loses of its speed and saves most of its energy.
Answer the compute-bound thread should get the big core.
Check
A core is built from 16 base-core units.
(a)
How much faster than a base core is it, by Pollack's rule?
(b)
What is its performance per watt relative to a base core, if power grows with area?
Check
A chip has 64 base units; its parallel fraction is 0.99, and cores are 4 units.
(a)
What is the symmetric chip's speedup?
(b)
And the asymmetric chip's, with one 4-unit core and the rest single units?
(c)
And the ideal dynamic chip's?
Check
A big core runs 3 times faster than a little one and draws 4 times the power. A task takes 50 ms on the little core.
(a)
How much more energy does the big core use for the task?
(b)
How long does the big core take?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
A scheduler has one big core free and two runnable threads: a matrix multiply and a pointer-chasing database scan that misses the cache on most loads. Which should get the big core, and why?
Check
A chip has n base units with parallel fraction f; its big core has r units.
Step 1
How long does the serial part take, relative to one base core running the whole program?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
How long does the parallel part take on the asymmetric chip?
Step 3
What is the asymmetric speedup?
Check
Write best_r(n, f, kind): over r = 1, 2, 4, …, n, return (best speedup, best r) for kind 'sym' or 'asym' using Hill and Marty's formulas.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why does an asymmetric multicore beat any symmetric one for programs with a small serial fraction?
In a symmetric chip every core has the same size, so making cores bigger speeds up the serial part but leaves fewer cores for the parallel part, and since performance grows only as the square root of area, big cores are an inefficient use of area in parallel phases. Making them small does the opposite. An asymmetric chip spends area on one big core to run the serial part fast, where nothing else can help, and leaves the rest as many small, area-efficient cores for the parallel part. It gets most of the benefit of both choices at once, and the serial fraction, by Amdahl's law, is exactly the part that limits everything else.
Practice
Keep practicing
6 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.