This was basically five questions dressed up as one and I didn't realize it until I was already three minutes into talking about core counts.
Start by contrasting the fundamental design philosophies: CPUs optimize for low-latency serial execution with large caches and out-of-order cores, while GPUs optimize for high-throughput parallel execution with thousands of simple cores and massive multithreading. Then explain how matrix multiplication's regular, data-parallel structure maps naturally to GPU architecture, and finish by discussing scenarios where CPU might still win (small matrices, branch-heavy code, low parallelism, or when data transfer overhead dominates).
Pro tip: Mention that for NVIDIA GPUs, libraries like cuBLAS and CUTLASS already achieve near-peak performance, so the real engineering trade-off is often about data movement and kernel fusion rather than raw compute. Also note that modern CPUs with AVX-512 and AMX can be surprisingly competitive for small-to-medium matrices, especially when the data is already in cache.
Contrast CPU cores (few, complex, out-of-order, deep pipelines, large caches) with GPU cores (many, simple, in-order, high occupancy). Emphasize that CPUs excel at latency-sensitive tasks while GPUs excel at throughput-oriented tasks.
Explain CPU cache hierarchy (L1/L2/L3) and GPU memory hierarchy (registers, shared memory, L1/L2, global memory). Highlight that GPUs rely on shared memory and coalesced global memory access to feed thousands of threads, while CPUs use large caches to hide latency.
Describe how CPUs hide latency via out-of-order execution, speculative execution, and prefetching. For GPUs, explain hardware multithreading (warp scheduling) and how many warps hide memory latency by switching contexts.
Matrix multiplication is highly data-parallel with regular memory access patterns and high arithmetic intensity (O(N^3) compute vs O(N^2) data). This allows GPUs to use tiling, shared memory, and register blocking to achieve near-peak FLOPs.
Discuss cases: small matrices where kernel launch and data transfer overhead dominate, branch-heavy or irregular computations, low parallelism, or when the data is already in CPU cache and the problem is latency-bound rather than throughput-bound.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.