向后移植 RISC-V Vector 汇编
Backporting RISC-V Vector assembly
AI总结:
针对 RISC-V RVV 硬件 v0.7.1 与工具链 v1.0 不兼容问题,提出 rvv-rollback 将 v1.0 汇编转换为 v0.7.1,并对比评估 LLVM 与 GNU 的向量化性能。
摘要:
利用向量化(即 CPU 并发地对多个数据元素执行操作的能力)对于高性能工作负载至关重要。然而,在撰写本文时,市售的、提供 RISC-V 向量扩展(RVV)的物理 RISC-V 硬件仅支持 0.7.1 版本,该版本与最新批准的 1.0 版本不兼容。挑战在于,上游编译器工具链(例如 Clang)仅面向已批准的 v1.0,并不支持较旧的 v0.7.1。由于 v1.0 与 v0.7.1 不兼容,编写向量化代码的唯一方法是使用厂商提供的旧版编译器。本文介绍了 rvv-rollback 工具,它可将编译器使用向量扩展 v1.0 指令生成的汇编代码转换为 v0.7.1。我们利用该工具比较了厂商提供的 GNU 8.4 编译器(支持 v0.7.1)与 LLVM 15.0(仅支持 v1.0)的向量化性能,发现 LLVM 编译器能够对更多计算内核进行自动向量化,并且在大多数(但并非全部)情况下提供比 GNU 更高的性能。我们还使用向量长度无关和特定设置测试了 LLVM 向量化,并观察到性能存在显著差异的情况。
英文摘要:
Leveraging vectorisation, the ability for a CPU to apply operations to multiple elements of data concurrently, is critical for high performance workloads. However, at the time of writing, commercially available physical RISC-V hardware that provides the RISC-V vector extension (RVV) only supports version 0.7.1, which is incompatible with the latest ratified version 1.0. The challenge is that upstream compiler toolchains, such as Clang, only target the ratified v1.0 and do not support the older v0.7.1. Because v1.0 is not compatible with v0.7.1, the only way to program vectorised code is to use a vendor-provided, older compiler. In this paper we introduce the rvv-rollback tool which translates assembly code generated by the compiler using vector extension v1.0 instructions to v0.7.1. We utilise this tool to compare vectorisation performance of the vendor-provided GNU 8.4 compiler (supports v0.7.1) against LLVM 15.0 (supports only v1.0), where we found that the LLVM compiler is capable of auto-vectorising more computational kernels, and delivers greater performance than GNU in most, but not all, cases. We also tested LLVM vectorisation with vector length agnostic and specific settings, and observed cases with significant difference in performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。