S4 · Problem set 6
Problem set 6: the roofline model, snooping and directory coherence, networks and synchronization
These problems cover lessons 31 to 35: attainable performance and arithmetic intensity, bus bandwidth and MESI traffic, false sharing, directory storage and network topology, on-chip network latency and saturation, lock traffic, critical sections and barriers.
Check
A machine peaks at 900 GFLOPS with 80 GB/s; a kernel has intensity 40 flop/byte.
(a)
Ridge point?
(b)
Attainable performance?
Check
A streaming loop does 4 operations per element, reading 2 arrays and writing 1, with 8-byte elements, on a machine with 300 GB/s.
(a)
Intensity?
(b)
Performance if memory-bound?
Check
A kernel of 2 billion elements, 6 ops and 40 bytes each, on a 5000 GFLOPS, 150 GB/s machine; separately, a matrix multiply blocked by 32 with 8-byte numbers.
(a)
The kernel's minimum time?
Write units the way you normally would: 1.5 s and 1500 ms are the same answer.
(b)
The multiply's intensity?
Check
Cores at 2.5 GHz, IPC 1, 0.003 bus misses per instruction, 128-byte lines, on a 240 GB/s bus.
(a)
Traffic per core?
(b)
Cores at saturation?
Check
A thread reads then writes 400 lines, 0.4 of them unshared; separately, two cores increment falsely shared counters 5000 times each, alternately.
(a)
MSI bus transactions?
(b)
MESI bus transactions?
(c)
Coherence misses from the false sharing, about?
Check
A directory for 256 cores with 64-byte lines.
(a)
Full bit-vector overhead?
(b)
Overhead with 6 limited pointers?
Check
A 10 × 10 network with 25 GB/s links.
(a)
Mesh diameter?
(b)
Mesh average distance between distinct nodes?
(c)
Torus bisection bandwidth (one direction)?
Check
A directory miss with 2 critical-path messages on an 8 × 8 mesh at average distance, 3 ns per hop and 20 ns overhead per message.
(a)
Average hops per message?
(b)
Network latency of the miss?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
Check
16 cores contend for a lock, one holding it, until all have held it.
(a)
Test-and-test-and-set transactions (two misses per waiter per handoff)?
(b)
Ticket lock (one per waiter per handoff)?
(c)
MCS lock (one per handoff)?
Check
Threads spend 0.02 of their time under one lock; 16 threads meet at a barrier (tree of fan-in 8 at 70 ns per level, or a central counter at 25 ns per atomic).
(a)
Throughput limit, in threads?
(b)
Tree barrier arrival time?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(c)
Central counter arrival time?
Check
A machine of 1200 GFLOPS and 100 GB/s, whose peak assumes 16-lane SIMD; a kernel of intensity 30 doesn't vectorize.
(a)
The scalar compute ceiling?
(b)
What the kernel attains?
Check
A line shared by 7 other caches is written 20 times, with rereads between writes; separately, 8 cores each read then write a private line under MESI, 0.9 of the time finding no other copy.
(a)
Invalidations?
(b)
MESI transactions for the private lines?
Check
An 8 × 8 mesh has 2-cycle routers and 1-cycle, 16-byte links; messages carry 80 bytes.
(a)
What is the zero-load latency at the average distance?
Check
Uniform random traffic runs on an 8 × 8 network.
(a)
What injection rate per node saturates a mesh?
(b)
And a torus?
Check
A link's credit loop is 1 cycle(s) across, 2 through the router and 2 back.
(a)
How many buffers per virtual channel keep the link busy?
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
15 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.