GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
← LLM & GenAI Fundamentals / 49
hardNVIDIAOpenAIGoogle

Explain FlashAttention: why it never writes the full N x N matrix, and how it speeds up attention without changing the math.

Attention is bottlenecked by moving the N x N score matrix to and from HBM, not by FLOPs. FlashAttention tiles the computation in fast on-chip SRAM and fuses softmax with an online running statistic, so it computes the exact same output while never materializing the full matrix.

Updated Aug 2026 · Grounded in real Forward Deployed Engineer interview loops and written to a senior-engineer editorial bar.

Attention is bottlenecked by moving the N x N score matrix to and from HBM, not by FLOPs. FlashAttention tiles the computation in fast on-chip SRAM and fuses softmax with an online running statistic, so it computes the exact same output while never materializing the full matrix.

20 answers per topic instead of 10, plus saved progress and bookmarks · no cardor unlock all 548 remaining answers · ₹2,000 / $25

Every answer, concept and course, every paper breakdown, all published video lessons, hands-on FDE Lab missions, Premium PDF guides and companion files, the full practice-test bank and work-sample downloads. Referral Premium excludes guide PDFs and their companion files.

6 months · One payment · No auto-renewal

Study alongside free video lessons.

Keep practising

FEDITOR'S NOTE

The screen is whether the candidate knows attention is memory-bandwidth bound (HBM round-trips on the N x N matrix), not compute bound, and that FlashAttention is an IO-aware tiling that keeps blocks in SRAM and uses online softmax to avoid materializing the full matrix. The reserved follow-up: 'how does softmax work without seeing the whole row, and how does the backward pass avoid storing the matrix.' Saying 'it approximates attention' fails hard; the output is numerically identical (same math, fewer memory round-trips). Bonus for the memory-complexity drop from O(N^2) to O(N) and recomputation in the backward pass.

DISCUSSION · 0

No comments yet — be the first to share your approach.