I/O Analysis is All You Need: An I/O Analysis for Long-Sequence Attention
I/O Analysis is All You Need: An I/O Analysis for Long-Sequence Attention
Xiaoyang Lu,Boyu Long,2 Authors,Xian-He Sun
TLDR
This study develops AttenIO, an I/O-driven accelerator for exact long-sequence self-attention with three key optimizations: an analytically derived I/O-optimal tiling and scheduling to minimize I/O operations, and fine-grained three-level communication-computation overlapping to hide I/O stalls.
Abstract
As GPUs and other accelerators become increasingly popular, optimizing I/O operations between on-chip and off-chip memory is increasingly critical. I/O analysis, however, is complex, requiring a deep understanding of application dataflow and memory hierarchy. Developing a practical I/O analysis methodology remains a timely challenge. Self-attention is employed extensively in transformer models, but its quadratic memory complexity poses significant challenges to modern memory systems. In this study, we explore how to use I/O analysis to develop optimal solutions for accelerating exact long-sequence self-attention. We first introduce a novel I/O analysis for tall-and-skinny matrix-matrix multiplication, which captures the dominant data movement behavior of long-sequence self-attention. Guided by systematic I/O analysis, we develop AttenIO, an I/O-driven accelerator for exact long-sequence self-attention with three key optimizations: (1) an analytically derived I/O-optimal tiling and scheduling to minimize I/O operations, (2) fine-grained three-level communication-computation overlapping to hide I/O stalls, and (3) parallel execution patterns for efficient softmax. Our evaluation shows that AttenIO achieves a 1.6×-8.8× speedup over the state-of-the-art solutions. Although AttenIO is designed for self-attention, it also highlights the broader potential of I/O analysis as a principled foundation for guiding high-performance I/O optimizations.
