S4 Computer architecture · Practice
Advanced cache optimizations
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 11 kinds solid
Check
A 512 × 512 matrix multiply is blocked with 16 × 16 tiles. By what factor does the worst-case traffic, against , fall?
Check
A 32 KB cache holds 4-byte elements. What's the largest whole B such that three B × B blocks fit?
Check
8 independent misses of 150 cycles each overlap 8 at a time. About how many stall cycles do they cost?
Check
Memory latency is 250 cycles and each loop iteration takes 15. How many iterations ahead should the loop prefetch?
Check
Way prediction is 0.85 accurate; a correct guess hits in 1 cycle(s) and a wrong one in 4. What's the average hit time?
Check
A direct-mapped cache misses 0.04 of the time; 0.3 of its misses are conflicts, and a victim cache catches 0.7 of those. What's the new miss rate?
Check
An N × N matrix multiply (N = 1024) is blocked into 16 × 16 tiles.
(a)
About how many words does the unblocked version move in the worst case?
(b)
And the blocked version?
(c)
How much cache do three tiles of doubles need?
Check
A loop takes 10 cycles per iteration against 150 cycles of memory latency. Way prediction is 0.95 accurate, with 2-cycle predicted hits and 3-cycle mispredicted ones.
(a)
How far ahead should the loop prefetch?
(b)
What is the average hit time?
Check
Traffic reduction: N = 512, B = 8?
Check
Stall: 12 misses of 200 cycles, MLP 6?
Check
Prefetch distance: latency 180, 20 cycles per iteration?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in S4