LGAISep 25, 2024

INT-FlashAttention: Enabling Flash Attention for INT8 Quantization

arXiv:2409.16997v27 citationsh-index: 10
Originality Incremental advance
AI Analysis

This work addresses the problem of accelerating inference for large language models on GPUs, representing an incremental improvement by integrating quantization with an existing attention optimization method.

The paper tackled the challenge of quadratic time and memory complexity in self-attention modules for large language models by introducing INT-FlashAttention, the first INT8 quantization architecture compatible with FlashAttention, which achieved 72% faster inference speed and 82% smaller quantization error compared to standard FlashAttention with FP16 and FP8 data formats.

As the foundation of large language models (LLMs), self-attention module faces the challenge of quadratic time and memory complexity with respect to sequence length. FlashAttention accelerates attention computation and reduces its memory usage by leveraging the GPU memory hierarchy. A promising research direction is to integrate FlashAttention with quantization methods. This paper introduces INT-FlashAttention, the first INT8 quantization architecture compatible with the forward workflow of FlashAttention, which significantly improves the inference speed of FlashAttention on Ampere GPUs. We implement our INT-FlashAttention prototype with fully INT8 activations and general matrix-multiplication (GEMM) kernels, making it the first attention operator with fully INT8 input. As a general token-level post-training quantization framework, INT-FlashAttention is also compatible with other data formats like INT4, etc. Experimental results show INT-FlashAttention achieves 72% faster inference speed and 82% smaller quantization error compared to standard FlashAttention with FP16 and FP8 data format.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes