Reducing the Cost of Dropout in Flash-Attention by Hiding RNG with GEMM
Not on the map. Why?
Abstract (arXiv)
Dropout, a network operator, when enabled is likely to dramatically impact the performance of Flash-Attention, which in turn increases the end-to-end training time of Large-Language-Models (LLMs). The main contributor to such performance degradation is the Random Number Generation (RNG) phase. The state-of-the-art optimization is to fuse RNG into the Flash-Attention kernel. However, while RNG and Attention do not compete on compute or memory resources, they are bounded on the same lower-level architecture bottlenecks. Fusion can hardly hide RNG latency within the Attention kernel. We propose overlapping RNG with previous GEMM layers in the network to hide RNG latency and improve end-to-end performance. RNG and GEMM have distinct resource requirements and hardware bottlenecks, so they can run together without compromising each other's performance. We propose a fine-grained analytical performance model that analyzes low-level architecture resource utilization to evaluate RNG-GEMM overlapping performance benefits. This model, cross-validated by silicon results, shows 1.26x speedup for overlapping RNG and GEMM layers over a sequential implementation on one Transformer Block (one LLM layer including multi-head attention and feed-forward layers), and 1.22x over state-of-the-art fusion implementation, for Llama3 on GH100 GPUs with FP8 precision. Because the kernel patterns are regular, the findings of the shared bottlenecks, as well as the achievable performance benefits, can be generalized to different model architectures, software implementations and hardware configurations.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 23 of its 47 references that are in the map. First posted on arXiv 10 Oct 2024.
Builds on
23 of 47 references.
References · 23
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,868
- 2023Splitwise: Efficient generative LLM inference using phase splittingcited by 558
- 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 519
- 2022DeepSpeed-MoE: Advancing Mixture-of-Experts Inference and Training to Power Next-Generation AI Scalecited by 404
- 2022Reducing Activation Recomputation in Large Transformer Modelscited by 302
- 2024LLM Inference Unveiled: Survey and Roofline Model Insightscited by 152
11 more
- 2021Sequence Parallelism: Long Sequence Training from System Perspectivecited by 126
- 2024Vidur: A Large-Scale Simulation Framework For LLM Inferencecited by 117
- 2023To Repeat or Not To Repeat: Insights from Scaling LLM under Token-Crisiscited by 92
- 2024FLUX: Fast Software-based Communication Overlap On GPUs Through Kernel Fusioncited by 57
- 2024MuxServe: Flexible Spatial-Temporal Multiplexing for Multiple LLM Servingcited by 52
- 2024LLM Inference Serving: Survey of Recent Advances and Opportunitiescited by 46
- 2023Dropout Reduces Underfittingcited by 21
- 2019DropAttention: A Regularization Method for Fully-Connected Self-Attention Networkscited by 20
- 2024T3: Transparent Tracking & Triggering for Fine-grained Overlap of Compute & Collectivescited by 16
- 2023Optimizing Distributed ML Communication with Fused Computation-Collective Operationscited by 15
- 2024Etalon: Holistic Performance Evaluation Framework for LLM Inference Systemscited by 10
Built on by
Not cited yet.