QFlash: Bridging Quantization and Memory Efficiency in Vision Transformer Attention

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Oh, Sehyeon, Kwon, Yongin, Lee, Jemin
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866910173191208960
author Oh, Sehyeon
Kwon, Yongin
Lee, Jemin
author_facet Oh, Sehyeon
Kwon, Yongin
Lee, Jemin
contents FlashAttention improves efficiency through tiling, but its online softmax still relies on floating-point arithmetic for numerical stability, making full quantization difficult. We identify three main obstacles to integer-only FlashAttention: (1) scale explosion during tile-wise accumulation, (2) inefficient shift-based exponential operations on GPUs, and (3) quantization granularity constraints requiring uniform scales for integer comparison. To address these challenges, we propose \textit{QFlash}, an end-to-end integer FlashAttention design that performs softmax entirely in the integer domain and runs as a single Triton kernel. On seven attention workloads from ViT, DeiT, and Swin models, QFlash achieves up to 6.73$\times$ speedup over I-ViT and up to 8.69$\times$ speedup on Swin, while reducing energy consumption by 18.8\% compared to FP16 FlashAttention, without sacrificing Top-1 accuracy on ViT/DeiT and remaining competitive on Swin under per-tensor quantization. Our code is publicly available at https://github.com/EfficientCompLab/qflash.
format Preprint
id arxiv_https___arxiv_org_abs_2604_25306
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle QFlash: Bridging Quantization and Memory Efficiency in Vision Transformer Attention
Oh, Sehyeon
Kwon, Yongin
Lee, Jemin
Machine Learning
Artificial Intelligence
FlashAttention improves efficiency through tiling, but its online softmax still relies on floating-point arithmetic for numerical stability, making full quantization difficult. We identify three main obstacles to integer-only FlashAttention: (1) scale explosion during tile-wise accumulation, (2) inefficient shift-based exponential operations on GPUs, and (3) quantization granularity constraints requiring uniform scales for integer comparison. To address these challenges, we propose \textit{QFlash}, an end-to-end integer FlashAttention design that performs softmax entirely in the integer domain and runs as a single Triton kernel. On seven attention workloads from ViT, DeiT, and Swin models, QFlash achieves up to 6.73$\times$ speedup over I-ViT and up to 8.69$\times$ speedup on Swin, while reducing energy consumption by 18.8\% compared to FP16 FlashAttention, without sacrificing Top-1 accuracy on ViT/DeiT and remaining competitive on Swin under per-tensor quantization. Our code is publicly available at https://github.com/EfficientCompLab/qflash.
title QFlash: Bridging Quantization and Memory Efficiency in Vision Transformer Attention
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2604.25306