arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.13839cs.DCcs.PF
收藏

面向 RISC-V 处理器的带状矩阵 BLAS 算法性能优化

Performance optimization of BLAS algorithms with band matrices for RISC-V processors

Anna Pirova, Anastasia Vodeneeva, Konstantin Kovalev, Alexander Ustinov, Evgeny Kozinov, Alexey Liniov, Valentin Volokitin, Iosif Meyerov

AI总结:

本文针对 RISC-V 平台优化四种带状矩阵 BLAS 算法,通过强化计算密集循环向量化和 RVV 向量寄存器分组,在两款开发板上实现相对 OpenBLAS 基线 1.5–10 倍加速。

摘要:

RISC-V 指令集架构的快速发展为软件开发者带来了新的机遇与挑战。仅仅将面向 x86-64 优化的高性能软件重新编译到 RISC-V CPU 上是否足够?当前编译器能否有效优化 C 和 C++ 代码,还是必须使用 intrinsics 或汇编?能否在缺乏成熟性能分析工具的情况下分析并改进性能?标准优化技术是否有效?是否存在需要考虑的 RISC-V 特有特性?这些问题及其他问题都需要审慎考量。本文介绍了我们在 RISC-V 处理器上优化四种带状矩阵运算 BLAS 算法的经验。我们展示了如何通过改进计算密集型循环的向量化,显著加速面向 RISC-V 优化的 OpenBLAS 算法实现。分别在 Lichee Pi 4A 和 Banana Pi BPI-F3 设备上使用 RVV 0.7.1 与 RVV 1.0 向量指令集进行的实验表明,相对于 OpenBLAS 基线,根据运算不同可获得 1.5 倍至 10 倍的加速。特别地,成功结合 RVV 使用向量寄存器分组能够带来显著的性能提升。

英文摘要:

The rapid development of RISC-V instruction set architecture presents new opportunities and challenges for software developers. Is it sufficient to simply recompile high-performance software optimized for x86-64 onto RISC-V CPUs? Are current compilers capable of effectively optimizing C and C++ codes or is it necessary to use intrinsics or assembler? Can we analyze and improve performance without well-developed profiling tools? Do standard optimization techniques work? Are there specific RISC-V features that need to be considered? These and other questions require careful consideration. In this paper, we present our experience optimizing four BLAS algorithms for band matrix operations on RISC-V processors. We demonstrate how RISC-V-optimized implementations of OpenBLAS algorithms can be significantly accelerated through improved vectorization of computationally intensive loops. Experiments on Lichee Pi 4A and Banana Pi BPI-F3 devices using RVV 0.7.1 and RVV 1.0 vector instruction sets respectively, show speedups of 1.5x to 10x depending on the operation compared to the OpenBLAS baseline. In particular, the successful use of vector register grouping with RVV can lead to significant performance improvements.

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

↑