Algorithm-hardware Co-design of Attention Mechanism on FPGA Devices
Abstract
Multi-head self-attention (attention mechanism) has been employed in a variety of fields such as machine translation, language modeling, and image processing due to its superiority in feature extraction and sequential data analysis. This is benefited from a large number of parameters and sophisticated model architecture behind the attention mechanism. To efficiently deploy attention mechanism on resource-constrained devices, existing works propose to reduce the model size by building a customized smaller model or compressing a big standard model. A customized smaller model is usually optimized for the specific task and needs effort in model parameters exploration. Model compression reduces model size without hurting the model architecture robustness, which can be efficiently applied to different tasks. The compressed weights in the model are usually regularly shaped (e.g. rectangle) but the dimension sizes vary (e.g. differs in rectangle height and width). Such compressed attention mechanism can be efficiently deployed on CPU/GPU platforms as their memory and computing resources can be flexibly assigned with demand. However, for Field Programmable Gate Arrays (FPGAs), the data buffer allocation and computing kernel are fixed at run time to achieve maximum energy efficiency. After compression, weights are much smaller and different in size, which leads to inefficient utilization of FPGA on-chip buffer. Moreover, the different weight heights and widths may lead to inefficient FPGA computing kernel execution. Due to the large number of weights in the attention mechanism, building a unique buffer and computing kernel for each compressed weight on FPGA is not feasible. In this work, we jointly consider the compression impact on buffer allocation and the required computing kernel during the attention mechanism compressing. A novel structural pruning method with memory footprint awareness is proposed and the associated accelerator on FPGA is designed. The experimental results show that our work can compress Transformer (an attention mechanism based model) by 95x. The developed accelerator can fully utilize the FPGA resource, processing the sparse attention mechanism with the run-time throughput performance of 1.87 Tops in ZCU102 FPGA.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
The winning ticket hypothesis methodology shows that a sub-model created by removing the lowest-magnitude weights and training from the original initialization can achieve similar accuracy as the original unoptimized model.
“It shows that the sub-model, created by removing the lowest-magnitude weights and training from the original initialization, can achieve similar accuracy as the original unoptimized model.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Column-wise computation naturally avoids multiplications with zero operands.
“Column-wise computation naturally avoids multiplications with zero operands.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Fine-grain pruning removes redundant weights without accuracy loss.
“Fine-grain pruning, which removes redundant weights without accuracy loss.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Zhang et al.'s technique compresses the transformer by 95 times and achieves high throughput on FPGA.
“Their technique compresses the transformer by 95 times and achieves high throughput on FPGA.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Coarse-grain pruning produces pruned weight matrices of similar shape.
“Pruned weight matrices are of similar shape.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Since γ is more dominant than β, γ is taken as the column-importance factor.
“Since γ is more dominant than β , γ is taken as the column-importance factor.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Even with structured pruning, the shape of the pruned weight matrix may differ in different encoders of various heads in an MHA.
“Zhang et al. [118] note that even with structured pruning, the shape of pruned weight matrix may differ in different encoders of various heads in an MHA.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Weight-shape-aware compression improves the utilization of FPGA buffers and MAC arrays.
“This improves the utilization of FPGA buffers and MAC (multiply-accumulate) arrays.”
From A Survey of Techniques for Optimizing Transformer Inference (2023) · cites this paper as [118]
Cites
End-to-End Object Detection with Transformers
Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., & Zagoruyko, S. (2020) · Lecture Notes in Computer Science · doi:10.1007/978-3-030-58452-8_13 · Cited by 18,285 · see citing works
FTRANS: energy-efficient acceleration of transformers using FPGA
Li, B., Pandey, S., Fang, H., Lyv, Y., Li, J., Chen, J., Xie, M., Wan, L., Liu, H., & Ding, C. (2020) · Proceedings of the ACM/IEEE International Symposium on Low Power Electronics and Design · doi:10.1145/3370748.3406567 · Cited by 206 · see citing works
Flagged first, then by citations
Cited by
Sorted by citations
A Survey of Techniques for Optimizing Transformer Inference
Chitty-Venkata, K. T., Mittal, S., Emani, M., Vishwanath, V., & Somani, A. K. (2023) · Journal of Systems Architecture · doi:10.1016/j.sysarc.2023.102990 · Cited by 154 · see citing works
Li, Z., Sun, M., Lu, A., Ma, H., Yuan, G., Xie, Y., Tang, H., Li, Y., Leeser, M., Wang, Z., et al. (2022) · 2022 32nd International Conference on Field-Programmable Logic and Applications (FPL) · doi:10.1109/fpl57034.2022.00027 · Cited by 85 · see citing works
- Authors
- Zhang, X., Wu, Y., Zhou, P., Tang, X., & Hu, J.
- Affiliations
- University of Pittsburgh (US)
- Venue
- ACM Transactions on Embedded Computing Systems
- Published
- 2021-09-17
- Volume
- 20
- Issue
- 5s
- Pages
- 1-24
- ISSN
- 1539-9087 (ISSN-L)
- 1558-3465
- OpenAlex
- W3199934250
- Cited by
- 52
- References
- 2
- Citations by year
- 2026: 5 · 2025: 8 · 2024: 20 · 2023: 11 · 2022: 8
- FWCI
- 6.39
- Type
- journal article
- Language
- en
- Open access
- closed
- Locations
- ACM Transactions on Embedded Computing Systems (publishedVersion)
- Funders
- National Science Foundation (NSF IIS-2027546)
- Topics
- Physical Sciences › Computer Science › Hardware and Architecture › Embedded Systems Design Techniques
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
- Physical Sciences › Engineering › Electrical and Electronic Engineering › VLSI and FPGA Design Techniques
- Keywords
- attention mechanism, multi-head self-attention, FPGA accelerator, algorithm-hardware co-design, model compression, structural pruning, sparse attention, transformer models, resource-constrained devices
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review