arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2601.02135cs.AR
收藏

HFRWKV: 一种高性能的全芯片硬件加速器用于RWKV

HFRWKV: A High-Performance Fully On-Chip Hardware Accelerator for RWKV

Sun Yat-sen University(中山大学)

Liu Shijie, Zeng Zhenghao, Jiao Han, Huang Yihua

AI总结:

HFRWKV是一种基于FPGA的全芯片硬件加速器,通过混合精度量化和优化架构提升RWKV的吞吐量和能效

摘要:

RWKV是一种现代的RNN架构,其性能接近Transformer,具有线性内存成本处理长上下文的优势。然而,其顺序计算模式难以高效利用GPU并行性,导致计算资源利用率低。此外,频繁的离芯片权重访问造成内存瓶颈。为解决这些挑战,我们提出了HFRWKV,一种基于FPGA的硬件加速器,专门针对RWKV设计。在矩阵运算模块中,我们提出了一种新颖的硬件友好的混合精度量化策略,该策略在保持可接受精度的同时提高了性能。对于包括指数运算和除法在内的复杂运算,我们引入了一种结合可重用架构和查找表或分段线性近似的 方法,该方法在算法上进行了优化,以有效平衡精度和硬件资源消耗。基于此基础,我们采用了一种完全在芯片内的计算系统,集成了并行矩阵-向量处理阵列和高效的流水线架构。通过计算重排和分块双缓冲,它有效消除了数据传输瓶颈,提高了整体吞吐量。我们将在Alveo U50和U280平台上实现HFRWKV。实验结果表明,与CPU相比,吞吐量提高了63.48倍,能效提高了139.17倍。与GPU相比,吞吐量提高了32.33倍,能效提高了171.36倍。

英文摘要:

RWKV is a modern RNN architecture that approaches the performance of Transformers, with the advantage of processing long contexts at a linear memory cost. However, its sequential computation pattern struggles to efficiently leverage GPU parallelism, which leads to low compute resource utilization. Furthermore, frequent off-chip weight accesses create a memory bottleneck. To address these challenges, we propose HFRWKV, an FPGA-based hardware accelerator specifically designed for RWKV. Within the matrix operation module, we propose a novel hardware-friendly hybrid-precision quantization strategy, which enhances performance while maintaining acceptable accuracy. For the complex operations including exponentiation and division, we introduce a method featuring reusable architectures combined with lookup tables or piecewise linear approximation, which is algorithmically refined to effectively balance precision and hardware resource consumption. Based on this foundation, we adopt a fully on-chip computing system integrating parallel matrix-vector processing array and an efficient pipeline architecture. Through computation reordering and chunked double buffering, it effectively eliminates data transfer bottlenecks and improves overall throughput. We implement HFRWKV on the Alveo U50 and U280 platform. Experimental results show that compared to a CPU, a throughput improvement of 63.48$\times$ and an energy efficiency improvement of 139.17$\times$. Compared to GPUs, achieves a throughput improvement of 32.33$\times$ and an energy efficiency improvement of 171.36$\times$.

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

↑