Lightweight Gaussian Process Inference in C++ on Metal and CUDA
Organizations: Department of Information Management, National Taiwan University · 2H. Milton Stewart School of Industrial and Systems Engineering, Georgia Institute of Technology
Abstract
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 to . On an Apple M4, LightGP CPU is 2.6--8.7 faster than GPyTorch CPU for exact GP and faster for sparse GP at every scale tested. On an NVIDIA RTX~3060, LightGP CUDA is 2.3--6.7 faster than GPyTorch CUDA for exact GP up to , with GPyTorch closing the gap at . A fused matrix-free kernel-vector product on Metal achieves 32 over the explicit path at with memory, and an FFT-accelerated SKI matvec via Accelerate vDSP runs in sub-millisecond time at . LightGP compiles as a single static library with zero external dependencies and is installable via \texttt{pip install lightgp