arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.00661cs.AR
收藏

基于开源矩阵指令集扩展(向量点积)的高性能RISC-V处理器“香山”(南湖版本)的LLM加速研究

Research on LLM Acceleration Using the High-Performance RISC-V Processor "Xiangshan" (Nanhu Version) Based on the Open-Source Matrix Instruction Set Extension (Vector Dot Product)

Xu-Hao Chen, Si-Peng Hu, Hong-Chao Liu, Bo-Ran Liu, Dan Tang, Di Zhao

AI总结:

本文基于开源高性能RISC-V处理器香山南湖架构扩展向量点积自定义指令,实现专用处理器Nanhu-vdot,在FPGA测试中向量点积计算速度达标量方法四倍以上,GPT-2推理速度较纯软件提升约30%且几乎不增加硬件资源与功耗。

摘要:

考虑到边缘AI对高性能和低功耗的要求,本研究基于RISC-V指令集架构设计了一款面向边缘AI的专用指令集处理器,以解决边缘设备数字信号处理中的实际问题。该设计在有限硬件开销下提升了边缘AI的执行效率并降低了能耗,满足边缘AI应用中对高效大语言模型(LLM)推理计算的需求。本文的主要贡献如下:针对大语言模型的特点,在RISC-V指令集基础上扩展了自定义指令以执行向量点积计算,从而在专用向量点积加速硬件上加速大语言模型的计算。基于开源高性能RISC-V处理器核心香山南湖架构,实现了向量点积专用指令集处理器Nanhu-vdot,该处理器在香山南湖基础上增加了向量点积计算单元和流水线处理逻辑。Nanhu-vdot经过FPGA硬件测试,在向量点积计算中达到了标量方法四倍以上的速度。采用硬件-软件协同设计方法进行第二代生成式预训练Transformer(GPT-2)模型推理,与纯软件实现相比,速度提升约30%,且几乎不增加额外的硬件资源和功耗消耗。

英文摘要:

Considering the high-performance and low-power requirements of edge AI, this study designs a specialized instruction set processor for edge AI based on the RISC-V instruction set architecture, addressing practical issues in digital signal processing for edge devices. This design enhances the execution efficiency of edge AI and reduces its energy consumption with limited hardware overhead, meeting the demands for efficient large language model (LLM) inference computation in edge AI applications. The main contributions of this paper are as follows: For the characteristics of large language models, custom instructions were extended based on the RISC-V instruction set to perform vector dot product calculations, accelerating the computation of large language models on dedicated vector dot product acceleration hardware. Based on the open-source high-performance RISC-V processor core XiangShan Nanhu architecture, the vector dot product specialized instruction set processor Nanhu-vdot was implemented, which adds vector dot product calculation units and pipeline processing logic on top of the XiangShan Nanhu.The Nanhu-vdot underwent FPGA hardware testing, achieving over four times the speed of scalar methods in vector dot product computation. Using a hardware-software co-design approach for second-generation Generative Pre-Trained Transformer (GPT-2) model inference, the speed improved by approximately 30% compared to pure software implementation with almost no additional consumption of hardware resources and power consumption.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑