arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.06339cs.DCcs.MS

跨硬件与精度的便携式高性能统一GPU奇异值计算内核

Performant Unified GPU Kernels for Portable Singular Value Computation Across Hardware and Precision

Evelyne Ringoot, Rabab Alomairy, Valentin Churavy, Alan Edelman

AI总结:

本文提出一种基于QR两阶段约简的Julia统一GPU奇异值分解内核,支持多硬件与半精度,性能优于多数库,大矩阵达cuSOLVER的80%-90%。

摘要:

本文提出了一种在Julia中实现的基于QR分解的奇异值计算算法的便携式GPU加速实现。奇异值分解(SVD)是科学计算和机器学习中的基础数值工具,提供最优低秩矩阵近似。其重要性在大规模机器学习流程中更加凸显,包括大型语言模型(LLMs),其中它支持低秩适应(LoRA)。所实现的算法基于经典的两阶段QR约简,包括连续将矩阵约简为带状形式和对角形式。我们的实现利用Julia的多重分派和元编程能力,与GPUArrays和KernelAbstractions框架集成,提供统一的类型和硬件无关函数。它支持多种GPU架构和数据类型,据我们所知,这是首个支持Apple Metal GPU和半精度的GPU加速奇异值实现。在多个GPU后端和数据类型上的性能结果表明,便携性并不需要牺牲性能:对于大于1024x1024的矩阵,该统一函数优于大多数线性代数库(MAGMA、SLATE、rocSOLVER、oneMKL),对于大矩阵,其性能达到cuSOLVER的80%-90%。

英文摘要:

This paper presents a portable, GPU-accelerated implementation of a QR-based singular value computation algorithm in Julia. The singular value ecomposition (SVD) is a fundamental numerical tool in scientific computing and machine learning, providing optimal low-rank matrix approximations. Its importance has increased even more in large-scale machine learning pipelines, including large language models (LLMs), where it enables low-rank adaptation (LoRA). The implemented algorithm is based on the classic two-stage QR reduction, consisting of successive matrix reduction to band form and bidiagonal form. Our implementation leverages Julia's multiple dispatch and metaprogramming capabilities, integrating with the GPUArrays and KernelAbstractions frameworks to provide a unified type and hardware-agnostic function. It supports diverse GPU architectures and data types, and is, to our knowledge, the first GPU-accelerated singular value implementation to support Apple Metal GPUs and half precision. Performance results on multiple GPU backends and data types demonstrate that portability does not require sacrificing performance: the unified function outperforms most linear algebra libraries (MAGMA, SLATE, rocSOLVER, oneMKL) for matrix sizes larger than 1024x1024, and achieves 80%-90% of the performance of cuSOLVER for large matrices.

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

↑