Efficient Hardware Architecture Design for Rotary Position Embedding of Large Language Models
Due to the substantial demands of storage and computation imposed by large language models (LLMs), there has been a surge of research interest in their hardware acceleration. As a technique involving non-linear operations, rotary position embedding (RoPE) has been adopted by some recently released LLMs. However, there is currently no reported research on its hardware design. This paper, for the first time, presents an efficient hardware architecture design for RoPE of LLMs. We first explore the similarities between RoPE and the coordinate rotation digital computer (CORDIC) algorithm, while also considering the commonly used quantization scheme for LLMs. Additionally, we propose a hardware-friendly solution to address the issue of excessively large input angle ranges. Then we present a CORDIC-based approximation for RoPE and develop a hardware architecture for it. The experimental results demonstrate that our design can save up to 45.7% area cost and 31.0% power consumption when compared with the fixed-point counterpart, while maintaining almost the same model performance. Compared to the straightforward implementation using floating-point arithmetic, our design can reduce up to 91.4% area cost and 88.9% power consumption, with negligible performance loss.
Authors
- Gang Wang (ORCID: https://orcid.org/0009-0003-6944-2958)
- Ningyi Xu (ORCID: https://orcid.org/0009-0004-6809-7694)
- Guanghui He (ORCID: https://orcid.org/0000-0002-0486-6421)
- Dongxu Lyu (ORCID: https://orcid.org/0000-0001-6826-2670)
- Wenjie Li (ORCID: https://orcid.org/0000-0002-1244-7657)
Institutions
- Shanghai Jiao Tong University (CN)
Publication Details
- Journal
- IEEE Journal on Emerging and Selected Topics in Circuits and Systems
- Published
- 2025-03-31
- DOI
- https://doi.org/10.1109/jetcas.2025.3556443
- Citations
- 1
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 2.48
Funders
- National Natural Science Foundation of China