Zero-Shot Fused Attention-Based GPT-2 Accelerator for Resource-Constrained Embedded Platform
- 27 June 2025
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Embedded Systems Letters
- Vol. 18 (2) , 107-110
Abstract
This letter proposes a hardware-software co-design approach to accelerate inference of Generative Pre-trained Transformer (GPT-2) for resource-constrained embedded applications. Essentially, a standard configuration of GPT-2 (Python-based software implementation) is re-defined with high-level language (C++) to ultimately design a dedicated and optimized hardware logic of GPT-2 as an IP core, taking resources available on the ZCU104 FPGA board into account. The approach leverages a zero-shot learning setup, buffer tiling, and compiler directives for implementing a fused attention-based GPT-2 architecture with ZCU104, ensuring maximum computational power is effectively squeezed from available resources and trade-off between throughput (samples/second), power consumption (W), energy efficiency (mJ), and resource utilization is balanced. The proposed optimizations improve throughput by 25.3% (from 67.11 to 84.03 samples/sec) compared to the baseline. Moreover, a comprehensive investigation of the proposed optimization is done by leveraging the impact of layer fusion on latency, utilization, and throughput. Also, the generalizability of the proposed approach is validated by implementing various configurations of GPT-2. Codes and subsequent files are available at GitHub Repository.Keywords
This publication has 7 references indexed in Scilit:
- Understanding the Potential of FPGA-based Spatial Acceleration for Large Language Model InferenceACM Transactions on Reconfigurable Technology and Systems, 2024
- A Runtime Programmable Accelerator for Convolutional and Multilayer Perceptron Neural Networks on FPGA2022
- TRAC: Compilation-Based Design of Transformer Accelerators for FPGAs2022
- Hardware-Software Co-Design of an In-Memory Transformer Network AcceleratorFrontiers in Electronics, 2022
- Hardware Acceleration of Fully Quantized BERT for Efficient Natural Language Processing2021
- Energy Efficiency Exploration on the ZYNQ Ultrascale+2018
- FPGA-based accelerator for long short-term memory recurrent neural networks2017