Sawtooth Wavefront Reordering: Enhanced CuTile FlashAttention on NVIDIA GB10
Yifan Zhu, Yekai Pan, Chen Ding
TL;DR
The paper tackles the cache bottlenecks of high-performance CuTile Flash Attention kernels on NVIDIA GB10, identifying L2 non-compulsory misses as the main limiter for large KV workloads. It combines hardware-counter–driven analysis with a deterministic CTAs scheduling study to reveal that L1 caching provides little benefit for streaming attention, and that L2 reuse scales with the number of active SMs, suggesting wavefront reuse as a key factor. The authors introduce Sawtooth Wavefront Reordering, which alternates KV traversal to reduce reuse distance and thereby dramatically cut L2 misses, validated in both CUDA and CuTile environments with substantial throughput gains (roughly 50%–60% depending on variant). A lightweight L2 sector-access model is developed to predict memory traffic and to explain observed improvements, and the approach generalizes to tile-based programming models. These results advance cache-aware design for large-sequence attention and offer practical guidance for achieving higher throughput on modern GPUs with complex memory hierarchies.
Abstract
High-performance attention kernels are essential for Large Language Models. This paper presents analysis of CuTile-based Flash Attention memory behavior and a technique to improve its cache performance. In particular, our analysis on the NVIDIA GB10 (Grace Blackwell) identifies the main cause of L2 cache miss. Leveraging this insight, we introduce a new programming technique called Sawtooth Wavefront Reordering that reduces L2 misses. We validate it in both CUDA and CuTile, observing 50\% or greater reduction in L2 misses and up to 60\% increase in throughput on GB10.
