mlsanityData to 14 Oct 2026

FlashAttention on a Napkin: A Diagrammatic Approach to Deep Learning IO-Awareness

arXiv 2412.03317 ↗First posted 4 Dec 2024cs.LGcited by 7

Not on the map. Why?

Abstract (arXiv)

Optimizing deep learning algorithms currently requires slow, manual derivation, potentially leaving much performance untapped. Methods like FlashAttention have achieved a x6 performance improvement over native PyTorch by avoiding unnecessary data transfers, but required three iterations over three years to be developed. Automated compiled methods have consistently lagged behind. This paper extends Neural Circuit Diagrams for deep learning models to consider resource usage and the distribution of tasks across a GPU hierarchy. We show how diagrams can use simple relabellings to derive high-level streaming and tiling optimization strategies along with performance models. We show how this high-level performance model allows the effects of quantization and multi-level GPU hierarchies to be readily considered. We develop a methodology for representing intermediate-level pseudocode with diagrams, allowing hardware-aware algorithms to be derived step-by-step. Finally, we show how our methodology can be used to better understand existing techniques like FlashAttention. This work uses a theoretical framework to link assumptions about GPU behaviour to claims about performance. We aim to lay the groundwork for a scientific approach to GPU optimization where experiments can address clear hypotheses rather than post-hoc rationalizations.

Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 23 of its 34 references that are in the map. First posted on arXiv 4 Dec 2024.

Builds on

23 of 34 references.

References · 23

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Denoising Diffusion Probabilistic Modelscited by 21,076
  3. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
  4. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
  5. 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,356
  6. 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,181
  7. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
  8. 2020Longformer: The Long-Document Transformercited by 3,413
  9. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
  10. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
  11. 2021A Survey of Quantization Methods for Efficient Neural Network Inferencecited by 815
  12. 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 717
11 more
  1. 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 519
  2. 2020Data Movement Is All You Need: A Case Study on Optimizing Transformerscited by 108
  3. 2024AI and Memory Wallcited by 92
  4. 2017Backprop as Functor: A compositional perspective on supervised learningcited by 44
  5. 2021Categorical Foundations of Gradient-Based Learningcited by 44
  6. 2024Benchmarking and Dissecting the Nvidia Hopper GPU Architecturecited by 24
  7. 2023Stream-K: Work-centric Parallel Decomposition for Dense Matrix-Matrix Multiplication on the GPUcited by 23
  8. 2023An Introduction to String Diagrams for Computer Scientistscited by 9
  9. 2022Markov Categories and Entropycited by 7
  10. 2023A Case Study in CUDA Kernel Fusion: Implementing FlashAttention-2 on NVIDIA Hopper Architecture using the CUTLASS Librarycited by 5
  11. 2023Reducing shared memory footprint to leverage high throughput on Tensor Cores and its flexible API extension librarycited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 5; 2026: 2.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024INT-FlashAttention: Enabling Flash Attention for INT8 Quantization
  2. 2024FastAttention: Extend FlashAttention2 to NPUs and Low-resource GPUs
  3. 2025Memory Analysis on the Training Course of DeepSeek Models
  4. 2025Estudio de la eficiencia en la escalabilidad de GPUs para el entrenamiento de Inteligencia Artificial
  5. 2026QFlash: Bridging Quantization and Memory Efficiency in Vision Transformer Attention
  6. 2024ThunderKittens: Simple, Fast, and Adorable AI Kernels
  7. 2026FlashSampling: Fast and Memory-Efficient Exact Sampling
  8. 2025Insights into DeepSeek-V3: Scaling Challenges and Reflections on Hardware for AI Architectures