Research Article

Accelerating Transformer Models: FPGA-Based Hardware Optimization and Heterogeneous Computing Strategies

Ziyi Wang*
James Watt School of Engineering, University of Glasgow, University Avenue, Glasgow, G12 8QQ, United Kingdom

* Corresponding author: [email protected]

Abstract

The Transformer model has gained widespread application in natural language processing (NLP) and computer vision due to its remarkable global dependency modeling capability. However, its large parameter size and high computational complexity pose significant challenges for resource-constrained hardware platforms. This paper thoroughly analyzes the advantages and limitations of FPGA as a hardware acceleration platform, highlighting its potential in low-power, low-latency inference through its flexible architecture and parallel processing capabilities. At the same time, it reveals the bottlenecks caused by storage capacity and loading efficiency in deploying Transformer models. By leveraging techniques such as model compression, quantization, and dataflow optimization, the loading performance of FPGA is significantly improved. Furthermore, this paper explores the collaborative mechanisms of FPGA within heterogeneous computing systems, demonstrating its capability to work alongside CPUs and GPUs in addressing complex AI tasks. Against the backdrop of limitations associated with traditional general-purpose chips, this paper examines the optimized design of application-specific chips (such as Sohu chips) and their performance advantages in Transformer tasks, while pointing out their lack of flexibility. To address the computational bottlenecks of the self-attention mechanism in Transformer models, an optimization method combining relative position encoding is proposed, effectively reducing complexity and enhancing model performance. By integrating model and hardware in a deeply synergistic manner, this paper provides theoretical foundations and practical guidance for the efficient deployment of Transformer models, opening up new possibilities for applications in edge computing and embedded systems.

Keywords: NLP; Transformer; FPGA; hardware optimization; model compression; heterogeneous systems; self-attention optimization
Published: March 7, 2025
DOI: 10.54254/2755-2721/2025.21360
Volume: ACE Vol.138
pp. 86-92
Download PDF

References

  1. Saini, Vaishali, and Nithin Joseph. "Artificial Intelligence in Robotics Using NLP." (2022).
  2. Shaw, Peter, Jakob Uszkoreit, and Ashish Vaswani. "Self-attention with relative position representations." arXiv preprint arXiv:1803.02155 (2018).
  3. Vadera, Sunil, and Salem Ameen. "Methods for pruning deep neural networks." IEEE Access 10 (2022): 63280-63300.
  4. He, Yang, et al. "Learning filter pruning criteria for deep convolutional neural networks acceleration." Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2020.
  5. Da Silva, Bruno, et al. "Comparing and combining GPU and FPGA accelerators in an image processing context." 2013 23rd International Conference on Field programmable Logic and Applications. IEEE, 2013.
  6. Qi, Panjie, et al. "Accelerating framework of transformer by hardware design and model compression co-optimization." 2021 IEEE/ACM International Conference On Computer Aided Design (ICCAD). IEEE, 2021.