arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.17898cs.LG
收藏

基于C++在Metal和CUDA上的轻量级高斯过程推断

Lightweight Gaussian Process Inference in C++ on Metal and CUDA

Department of Information Management, National Taiwan University(国立台湾大学信息管理系);H. Milton Stewart School of Industrial and Systems Engineering, Georgia Institute of Technology(佐治亚理工学院H. Milton Stewart工业与系统工程学院)

Yu-Hsueh Fang

AI总结:

本文提出LightGP,一个无需依赖的C++17库,用于高斯过程回归,支持Apple Metal和NVIDIA CUDA后端,以及通过Apple Accelerate和OpenBLAS优化的CPU路径。LightGP提供了四种推断路径,覆盖从N=100到N=500,000的问题规模,并在不同硬件上实现了显著的性能提升。

摘要:

高斯过程(GP)推断在Python中主要由GPyTorch和GPflow等库主导,这些库基于深度学习框架,继承了它们的调度开销和依赖项足迹。我们提出了LightGP,一个无依赖的C++17库,用于GP回归,并提供Python绑定,支持Apple Metal和NVIDIA CUDA后端,以及通过Apple Accelerate和OpenBLAS优化的CPU路径。LightGP提供了四种推断路径——精确的Cholesky分解、无矩阵的共轭梯度法、稀疏变分自由能和结构化核插值(SKI)与FFT——覆盖从N=100到N=500,000的问题。在Apple M4上,LightGP CPU在精确GP推断中比GPyTorch CPU快2.6-8.7倍,在稀疏GP推断中每种规模都快1.5倍。在NVIDIA RTX 3060上,LightGP CUDA在精确GP推断中比GPyTorch CUDA快2.3-6.7倍,直到N=2048,而在N=4096时GPyTorch缩小了差距。在Metal上融合的无矩阵核-向量乘积在N=20,000时以O(N)内存实现了32倍的性能提升,而通过Accelerate vDSP加速的SKI矩阵-向量乘法在N=200,000时运行在亚毫秒级别。LightGP编译为一个单一的静态库,无外部依赖,并可通过pip install lightgp安装。

英文摘要:

Gaussian process (GP) inference in Python is dominated by libraries such as GPyTorch and GPflow, which are built on deep-learning frameworks and inherit their dispatch overhead and dependency footprint. We present LightGP, a dependency-free C++17 library for GP regression with Python bindings, supporting Apple Metal and NVIDIA CUDA backends alongside tuned CPU paths via Apple Accelerate and OpenBLAS. LightGP provides four inference paths -- exact Cholesky, matrix-free conjugate gradients, sparse variational free energy, and structured kernel interpolation with FFT -- covering problems from $N{=}100$ to $N{=}500{,}000$. On an Apple M4, LightGP CPU is 2.6--8.7$\times$ faster than GPyTorch CPU for exact GP and ${\sim}1.5\times$ faster for sparse GP at every scale tested. On an NVIDIA RTX~3060, LightGP CUDA is 2.3--6.7$\times$ faster than GPyTorch CUDA for exact GP up to $N{=}2{,}048$, with GPyTorch closing the gap at $N{=}4{,}096$. A fused matrix-free kernel-vector product on Metal achieves 32$\times$ over the explicit path at $N{=}20{,}000$ with $O(N)$ memory, and an FFT-accelerated SKI matvec via Accelerate vDSP runs in sub-millisecond time at $N{=}200{,}000$. LightGP compiles as a single static library with zero external dependencies and is installable via \texttt{pip install lightgp

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

↑