LearnQuestion bank

Explain why GPUs accelerate deep learning, and how you decide whether a kernel or model is compute-bound or memory-bound.

ML engineeringTechnicalMedium

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • GPUs accelerate deep learning via massive SIMT parallelism, tensor cores for matmuls, and high memory bandwidth.
  • Compute arithmetic intensity in FLOPs/byte and compare it to the roofline ridge point.
  • Large-batch matmul is compute-bound; elementwise ops and batch-1 LLM decode are memory-bound.
  • Raise intensity with kernel fusion, batching, tiling, and efficient data movement; watch host-device transfers and dataloader bottlenecks.

In full

GPUs accelerate deep learning because deep learning is dominated by large, regular, highly parallel operations: thousands of SIMT lanes execute the same instruction on many data elements, tensor cores accelerate dense matmuls, and high HBM bandwidth feeds those units. To decide whether a kernel or model is compute-bound or memory-bound, I estimate arithmetic intensity as useful FLOPs divided by bytes actually moved, then compare it with the machine balance from the roofline model: above the ridge point it is compute-bound, below it memory-bound, and I verify with profiling rather than trusting theory alone. Large-batch matmuls usually have high intensity and are compute-bound, while elementwise ops and batch-size-1 LLM decode are memory-bound because they move a lot of data for little math, especially when weights and KV cache are repeatedly read. The practical fixes are kernel fusion, larger batches or tiles, better reuse, and avoiding avoidable host-device transfers, but end-to-end performance can still be limited by dataloader throughput, pinned-memory/async copies, or synchronisation rather than by the GPU kernel itself. So I separate kernel-level roofline analysis from system-level profiling: if the kernel is memory-bound, I optimise data movement; if the pipeline is still slow, I look at transfers, batching, and input feeding.

Corrected by an independent AI reviewer.

What a strong answer covers

  • Massive SIMT parallelism and tensor cores for matmuls; high memory bandwidth.
  • Arithmetic intensity (FLOPs/byte) against the roofline model.
  • Large-batch matmul is compute-bound; elementwise ops and LLM decode at batch size 1 are memory-bound.
  • Kernel fusion and batching to raise intensity; host–device transfer and dataloader bottlenecks.

Common mistakes

  • quoting peak FLOPs as the throughput you get
  • ignoring memory bandwidth.