Proceedings

QFlash: Bridging Quantization and Memory Efficiency in Vision Transformer Attention

Download BibTeX Cite

Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 1496-1504.

https://doi.org/10.24963/ijcai.2026/167

Abstract

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 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.73x speedup over I-ViT and up to 8.69x 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.

  1. [Arafa et al., 2019] Yehia Arafa, AH Badawy, Gopinath Chennupati, Nandakishore Santhi, and Stephan Eiden- benz. Instructions' latencies characterization for nvidia gpgpus. arXiv preprint arXiv:1905.08778, 2019.
  2. [Bridges et al., 2016] Robert A Bridges, Neena Imam, and Tiffany M Mintz. Understanding gpu power: A survey of profiling, modeling, and simulation methods. ACM Com- puting Surveys (CSUR), 49(3):1-27, 2016.
  3. [Chen et al., 2024] Shimao Chen, Zirui Liu, Zhiying Wu, Ce Zheng, Peizhuang Cong, Zihan Jiang, Yuhan Wu, Lei Su, and Tong Yang. Int-flashattention: Enabling flash attention for int8 quantization. arXiv preprint arXiv:2409.16997, 2024.
  4. [Dally, 2023] Bill Dally. Hardware for deep learning. In 2023 IEEE Hot Chips 35 Symposium (HCS), pages 1-58. IEEE Computer Society, 2023.
  5. [Dao et al., 2022] Tri Dao, Dan Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. Flashattention: Fast and memory-efficient exact attention with io-awareness. Advances in neural information processing systems, 35:16344-16359, 2022.
  6. [Dao, 2023] Tri Dao. Flashattention-2: Faster attention with better parallelism and work partitioning. arXiv preprint arXiv:2307.08691, 2023.
  7. [Horowitz, 2014] Mark Horowitz. 1.1 computing's energy problem (and what we can do about it). In 2014 IEEE international solid-state circuits conference digest of tech- nical papers (ISSCC), pages 10-14. IEEE, 2014.
  8. [Hu et al., 2024] Xing Hu, Yuan Cheng, Dawei Yang, Zhihang Yuan, Jiangyong Yu, Chen Xu, and Sifan Zhou. I-llm: Efficient integer-only inference for fully- quantized low-bit large language models. arXiv preprint arXiv:2405.17849, 2024.
  9. [Jahadi et al., 2025] Reza Jahadi, Phil Munz, and Ehsan Atoofian. Fused tensor core: A hardware-software co- design for efficient execution of attentions on gpus. IEEE Embedded Systems Letters, 17(5):317-320, 2025.
  10. [Kim et al., 2021] Sehoon Kim, Amir Gholami, Zhewei Yao, Michael W Mahoney, and Kurt Keutzer. I-bert: Integer- only bert quantization. In International conference on ma- chine learning, pages 5506-5518. PMLR, 2021.
  11. [Kim et al., 2024] Gihwan Kim, Jemin Lee, Sihyeong Park, Yongin Kwon, and Hyungshin Kim. Mixed non-linear quantization for vision transformers. In European Confer- ence on Computer Vision, pages 97-112. Springer, 2024.
  12. [Kluska et al., 2024] Piotr Kluska, Adrián Castelló, Flo- rian Scheidegger, A Cristiano I Malossi, and Enrique S Quintana-Ortí. Qattn: Efficient gpu kernels for mixed- precision vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3648-3657, 2024.
  13. [Leinhauser et al., 2021] Matthew Leinhauser, Jeffrey Young, Sergei Bastrakov, René Widera, Ronnie Chatter- jee, and Sunita Chandrasekaran. Performance analysis of picongpu: particle-in-cell on gpus using nvidia's nsight systems and nsight compute. Technical report, Oak Ridge National Laboratory (ORNL), Oak Ridge, TN (United States), 2021.
  14. [Li and Gu, 2023] Zhikai Li and Qingyi Gu. I-vit: Integer- only quantization for efficient vision transformer infer- ence. In Proceedings of the IEEE/CVF International Con- ference on Computer Vision, pages 17065-17075, 2023.
  15. [Li et al., 2023] Zhikai Li, Junrui Xiao, Lianwei Yang, and Qingyi Gu. Repq-vit: Scale reparameterization for post- training quantization of vision transformers. In Proceed- ings of the IEEE/CVF International Conference on Com- puter Vision, pages 17227-17236, 2023.
  16. [Lin et al., 2021] Yang Lin, Tianyu Zhang, Peiqin Sun, Zheng Li, and Shuchang Zhou. Fq-vit: Post-training quantization for fully quantized vision transformer. arXiv preprint arXiv:2111.13824, 2021. IJCAI
  17. [Milakov and Gimelshein, 2018] Maxim Milakov and Na- talia Gimelshein. Online normalizer calculation for soft- max. arXiv preprint arXiv:1805.02867, 2018.
  18. [Qin et al., 2025] Jiajun Qin, Tianhua Xia, Cheng Tan, Jeff Zhang, and Sai Qian Zhang. Picachu: Plug-in cgra han- dling upcoming nonlinear operations in llms. In Proceed- ings of the 30th ACM International Conference on Archi- tectural Support for Programming Languages and Oper- ating Systems, Volume 2, pages 845-861, 2025.
  19. [Ramachandran et al., 2024] Akshat Ramachandran, Souvik Kundu, and Tushar Krishna. Clamp-vit: Contrastive data- free learning for adaptive post-training quantization of vits. In European Conference on Computer Vision, pages 307-325. Springer, 2024.
  20. [Shah et al., 2024] Jay Shah, Ganesh Bikshandi, Ying Zhang, Vijay Thakkar, Pradeep Ramani, and Tri Dao. Flashattention-3: Fast and accurate attention with asyn- chrony and low-precision. Advances in Neural Informa- tion Processing Systems, 37:68658-68685, 2024.
  21. [You et al., 2024] Haoran You, Yipin Guo, Yichao Fu, Wei Zhou, Huihong Shi, Xiaofan Zhang, Souvik Kundu, Amir Yazdanbakhsh, and Yingyan Celine Lin. Shiftaddllm: Ac- celerating pretrained llms via post-training multiplication- less reparameterization. Advances in Neural Information Processing Systems, 37:24822-24848, 2024.
  22. [Yu et al., 2023] Junyeol Yu, Jongseok Kim, and Euiseong Seo. Know your enemy to save cloud energy: Energy- performance characterization of machine learning serv- ing. In 2023 IEEE International Symposium on High- Performance Computer Architecture (HPCA), pages 842- 854. IEEE, 2023.
  23. [Yuan et al., 2022] Zhihang Yuan, Chenhao Xue, Yiqi Chen, Qiang Wu, and Guangyu Sun. Ptq4vit: Post-training quan- tization for vision transformers with twin uniform quanti- zation. In European conference on computer vision, pages 191-207. Springer, 2022.
  24. [Zhao et al., 2025] Zhixiong Zhao, Haomin Li, Fangxin Liu, Yuncheng Lu, Zongwu Wang, Tao Yang, Li Jiang, and Haibing Guan. Quark: Quantization-enabled circuit shar- ing for transformer acceleration by exploiting common patterns in nonlinear operations. In 2025 IEEE/ACM In- ternational Conference On Computer Aided Design (IC- CAD), pages 1-9. IEEE, 2025.
  25. [Zhong et al., 2024] Yunshan Zhong, Jiawei Hu, You Huang, Yuxin Zhang, and Rongrong Ji. Erq: Error reduction for post-training quantization of vision transformers. In Forty- first International Conference on Machine Learning, 2024.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards