基于FPGA的快速任意精度浮点运算
Fast Arbitrary Precision Floating Point on FPGA
摘要:
需要任意精度浮点(APFP)数用于其核心计算的数值代码由基本算术运算主导,这是由于尾数位的数目的乘法的超线性复杂性。传统的基于软件的架构上的APFP计算由于缺乏本地硬件支持而变得非常昂贵,需要使用在机器字大小的块上操作的指令来仿真基本操作。在这项工作中,我们展示了如何APFP乘法编译时固定精度的操作数可以实现为深FPGA流水线与递归定义的Karatsuba分解顶部的本地DSP乘法。当将我们在Alveo U250加速器上实现的设计与运行GNU多精度浮点可靠(MPFR)库的双插槽36核Xeon节点进行比较时,我们在4.8 GOp/s的速度下实现了9.8倍的加速,对于512位乘法,在1.2 GOp/s的速度下实现了5.3倍的加速,对于1024位乘法,分别对应于超过351 x和191 x CPU内核的吞吐量。我们将此架构应用于一般的矩阵-矩阵乘法,在Xeon节点上以2.0 GOp/s的速度获得10倍的加速,相当于超过375倍的CPU内核,有效地允许单个FPGA取代小型CPU集群。由于一些数值代码对APFP的依赖性很大,例如半定规划求解器,我们希望这些收益能够转化为现实世界的加速。我们的可配置和灵活的基于HLS-based的代码提供了一个高层次的软件接口,即插即用加速,作为一个开源项目发布。
英文摘要:
Numerical codes that require arbitrary precision floating point (APFP) numbers for their core computation are dominated by elementary arithmetic operations due to the super-linear complexity of multiplication in the number of mantissa bits. APFP computations on conventional software-based architectures are made exceedingly expensive by the lack of native hardware support, requiring elementary operations to be emulated using instructions operating on machine-word-sized blocks. In this work, we show how APFP multiplication on compile-time fixed-precision operands can be implemented as deep FPGA pipelines with a recursively defined Karatsuba decomposition on top of native DSP multiplication. When comparing our design implemented on an Alveo U250 accelerator to a dual-socket 36-core Xeon node running the GNU Multiple Precision Floating-Point Reliable (MPFR) library, we achieve a 9.8x speedup at 4.8 GOp/s for 512-bit multiplication, and a 5.3x speedup at 1.2 GOp/s for 1024-bit multiplication, corresponding to the throughput of more than 351x and 191x CPU cores, respectively. We apply this architecture to general matrix-matrix multiplication, yielding a 10x speedup at 2.0 GOp/s over the Xeon node, equivalent to more than 375x CPU cores, effectively allowing a single FPGA to replace a small CPU cluster. Due to the significant dependence of some numerical codes on APFP, such as semidefinite program solvers, we expect these gains to translate into real-world speedups. Our configurable and flexible HLS-based code provides as high-level software interface for plug-and-play acceleration, published as an open source project.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。