School/✦ Research Engineer/Week 26
Ablations: which part made it better?
Your new design is 40% faster. It has a bigger cache, a new predictor and a compiler flag. Which one did the work?
About 40 min · 3 goals · Checked by automated tests
1.Why should I care?
Claims like 'our architecture is faster' are only useful if you know why. Ablations isolate each change, so the next engineer knows which idea to keep. They are expected in any serious systems or ML paper.
- ◇ Design an ablation study that changes one component at a time against a fixed baseline.
- ◇ Attribute performance to components and recognise interactions between them.
- ◇ Explain an ablation's result from first principles (for example with AMAT or the Iron Law).
2.Predict
In the cache simulator, the 'Two arrays that collide' pattern runs direct-mapped. You change to 2-way AND 32-byte blocks at once, and misses drop. What can you conclude?
Guess first. Being wrong here is how the surprise works.
3.Understand
One change at a time
Start from the full system and remove (or start from the baseline and add) one component per run, holding everything else fixed: same inputs, same metric, same conditions. The difference from the reference attributes performance to that component.
Interactions
Components can interact: a bigger cache may make a prefetcher less useful, or a predictor may matter only with a deep pipeline. A full factorial design (every combination; 2ⁿ runs for n on/off components) reveals interactions; with many components, test the most plausible pairs.
Explain, don't just tabulate
Tie each effect to a mechanism. 'Two-way associativity removed the conflict misses because a[i] and b[i] share index bits' is a finding; '2-way is 4× better' is only a number. Mechanism-level explanations generalise to new workloads; raw numbers may not.
Explain it another way
A cake tastes better after you changed the flour, the oven and the recipe. Bake it again changing only one of them to find out which one mattered.
Ablation design: define the reference configuration, the component list, the metric with uncertainty, and the order of runs (randomised). Report each ablation's effect with an interval, plus any interaction terms measured.
In a 2×2 factorial with outcomes y₀₀, y₁₀, y₀₁, y₁₁: main effect of A = ½[(y₁₀ − y₀₀) + (y₁₁ − y₀₁)]; interaction = ½[(y₁₁ − y₀₁) − (y₁₀ − y₀₀)].
Processor design teams evaluate each proposed feature with simulation ablations on benchmark suites, using the Iron Law to check whether a gain came through CPI, clock or instruction count.
Worked example 1
Simulator misses for the colliding arrays: baseline (direct-mapped, 16 B) 16; 2-way only 4; 32 B blocks only 2; both 2. Main effects and interaction?
Associativity: ½[(4 − 16) + (2 − 2)] = −6. Block size: ½[(2 − 16) + (2 − 4)] = −8. Interaction: ½[(2 − 2) − (4 − 16)] = +6: once one fix removes the conflict, the other adds nothing. Mechanism: with 8 lines fixed, 32 B blocks double the cache to 256 B, so a[i] and b[i] no longer share an index. A cleaner ablation holds capacity fixed (halve the lines when doubling the block).
Common mix-ups
- If the full system is better, every component must be helping.
✓ Some may do nothing or even hurt; only ablations show it. - Ablating each component once is enough.
✓ Components can interact; check plausible combinations and report uncertainty on each effect.
4.Discover
Baseline: 'Two arrays that collide', direct-mapped, 16 B blocks. Record the misses. Now change only associativity, then only block size (back to direct-mapped), then both. Fill a 2×2 table of misses. Then read the note under the simulator: what else changes when the block size changes with 8 lines fixed?
Loading the interactive…
Can't use the interactive? Read a description instead
With 'Two arrays that collide' (16 reads): direct-mapped with 16 B blocks gives 16 misses; 2-way gives 4; direct-mapped with 32 B blocks gives 2, because the 8-line cache doubles in size; 2-way with 32 B blocks also gives 2.
5.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
Which is an ablation?
6.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2
A 2×2 study of predictor (P) and cache (C) gives run times (ms): neither 100, P only 80, C only 70, both 55. What is the main effect of P (ms)?
Practice 3 · a fresh version every time
A direct-mapped cache has 4 lines of 16 bytes and starts empty. The CPU reads these byte addresses in order: 124, 272, 272, 368, 20, 20, 272, 144, 144, 144. How many reads hit?
Practice 4 · a fresh version every time
A cache has a hit time of 2 cycles, a miss rate of 8% and a miss penalty of 150 cycles. What is the AMAT in cycles?
Practice 5
Doubling the L1 cache cut run time by 20%. Which follow-up best explains it from first principles?
7.Apply it
Plan the ablations for your term project: which components (precision of weights, precision of the accumulator, rounding mode, sample rate) will you vary one at a time, from which reference, and what mechanism do you predict for each effect?
8.Reflect
Concepts: Baselines and ablation studies · Variables, controls and confounders · Experimental design and test protocols