What GPU memory hierarchy bottleneck makes standard self-attention memory-bandwidth bound?

Last updated 22 November 2026

  • GPUs pair large but slow off-chip HBM (about 2 TB/s) with tiny but fast on-chip SRAM (about 19 TB/s), and compute has outgrown bandwidth.

  • Naive attention writes the N×N score and probability matrices to HBM and reads them back for cheap softmax, mask and dropout ops (low FLOPs per byte), so memory traffic dominates runtime.

  • Decoding is worse because each token re-reads the whole KV cache. Fixes are kernel fusion with SRAM tiling (FlashAttention) or shrinking the KV cache (GQA/MQA, quantization).

  • https://www.interview101.com/interviews/nvidia/machine-learning-engineer
  • https://github.com/ombharatiya/AI-Engineer-Interview-Questions/blob/main/02-llm-fundamentals/questions.md
  • https://ninjastudio.ai/blog/flash-attention-speeds-up-llm-inference
All Transformers interview questions