Low-Cost FlashAttention with Fused Exponential and Multiplication Hardware Operators

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Alexandridis, Kosmas, Titopoulos, Vasileios, Dimitrakopoulos, Giorgos
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910975828951040
author Alexandridis, Kosmas
Titopoulos, Vasileios
Dimitrakopoulos, Giorgos
author_facet Alexandridis, Kosmas
Titopoulos, Vasileios
Dimitrakopoulos, Giorgos
contents Attention mechanisms, particularly within Transformer architectures and large language models (LLMs), have revolutionized sequence modeling in machine learning and artificial intelligence applications. To compute attention for increasingly long sequences, specialized accelerators have been proposed to execute key attention steps directly in hardware. Among the various recently proposed architectures, those based on variants of the FlashAttention algorithm, originally designed for GPUs, stand out due to their optimized computation, tiling capabilities, and reduced memory traffic. In this work, we focus on optimizing the kernel of floating-point-based FlashAttention using new hardware operators that fuse the computation of exponentials and vector multiplications, e.g., e^x, V. The proposed ExpMul hardware operators significantly reduce the area and power costs of FlashAttention-based hardware accelerators. When implemented in a 28nm ASIC technology, they achieve improvements of 28.8% in area and 17.6% in power, on average, compared to state-of-the-art hardware architectures with separate exponentials and vector multiplications hardware operators.
format Preprint
id arxiv_https___arxiv_org_abs_2505_14314
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Low-Cost FlashAttention with Fused Exponential and Multiplication Hardware Operators
Alexandridis, Kosmas
Titopoulos, Vasileios
Dimitrakopoulos, Giorgos
Hardware Architecture
Machine Learning
Attention mechanisms, particularly within Transformer architectures and large language models (LLMs), have revolutionized sequence modeling in machine learning and artificial intelligence applications. To compute attention for increasingly long sequences, specialized accelerators have been proposed to execute key attention steps directly in hardware. Among the various recently proposed architectures, those based on variants of the FlashAttention algorithm, originally designed for GPUs, stand out due to their optimized computation, tiling capabilities, and reduced memory traffic. In this work, we focus on optimizing the kernel of floating-point-based FlashAttention using new hardware operators that fuse the computation of exponentials and vector multiplications, e.g., e^x, V. The proposed ExpMul hardware operators significantly reduce the area and power costs of FlashAttention-based hardware accelerators. When implemented in a 28nm ASIC technology, they achieve improvements of 28.8% in area and 17.6% in power, on average, compared to state-of-the-art hardware architectures with separate exponentials and vector multiplications hardware operators.
title Low-Cost FlashAttention with Fused Exponential and Multiplication Hardware Operators
topic Hardware Architecture
Machine Learning
url https://arxiv.org/abs/2505.14314