更接近间隙:面向RISC-V向量处理器的可移植性能
Closer in the Gap: Towards Portable Performance on RISC-V Vector Processors
AI总结:
通过汇编微基准测试和编译器自动向量化评估,揭示了RVV硬件上谓词开销和步长加载的性能挑战,并比较了GCC 15与LLVM 21在HPC和ML代理应用中的表现。
摘要:
RISC-V向量扩展(RVV)是支持科学和机器学习工作负载计算吞吐量的基石。然而,在真实的RVV 1.0硬件上,编译器支持和性能监控仍在发展中。在这项工作中,我们设计了一套汇编微基准测试,以建立性能上限并校准RVV硬件上的性能计数器。利用汇编基准测试,我们发现谓词开销和步长加载带来了当前编译器成本模型尚未完全解决的性能挑战。此外,我们首次在HPC和ML代理应用中评估了GCC 15和LLVM 21的自动向量化。在六个应用中的四个,GCC 15优于LLVM 21。LLVM 21仅在SGEMM和DGEMM中优于GCC 15,这是通过更激进的指令缩减实现的,这一点通过RVV硬件上经过验证的\texttt{perf}计数器得到证实。我们还表明,编译器中的默认LMUL选择接近最优。为了研究RVV对产品级应用的支持,我们还评估了状态向量量子模拟器Google的Qsim,使用手动RVV内联函数和编译器自动向量化,揭示了当前RVV编译器在处理复杂内存访问模式方面的不成熟。
英文摘要:
The RISC-V Vector Extension~(RVV) is a cornerstone for supporting compute throughout in scientific and machine learning workloads. Yet compiler support and performance monitoring on real RVV~1.0 hardware are still evolving. In this work, we design a suite of assembly microbenchmarks to establish performance ceilings and calibrate performance counters on RVV hardware. Leveraging the assembly benchmarks, we find that predication overhead and stride load pose performance challenges that current compiler cost models do not yet fully address. Moreover, we present the first evaluation of GCC~15 and LLVM~21 autovectorization in HPC and ML proxy applications. GCC~15 outperforms LLVM~21 in four out of six applications. LLVM~21 only outperforms GCC~15 in SGEMM and DGEMM, driven by more aggressive instruction reduction confirmed through validated \texttt{perf} counters on the RVV hardware. We further show that the default LMUL selection in compilers performs close to the optimal. To study the RVV support for product-level application, we also evaluate the state-vector quantum simulator, Google's Qsim, with both manual RVV intrinsics and compiler auto-vectorization, revealing immaturity in current RVV compiler for complicated memory access pattern.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。