GPyTorch: Blackbox Matrix-Matrix Gaussian Process Inference with GPU Acceleration
Jacob R. GardnerGeoff PleissDavid BindelKilian Q. WeinbergerAndrew Gordon Wilson
Introduces GPyTorch, a PyTorch framework that reduces exact Gaussian process inference complexity from cubic to quadratic time on GPUs using preconditioned blackbox matrix-matrix multiplication.
Gaussian processes are powerful, flexible machine learning models that provide principled uncertainty estimates, yet their computational demands have historically limited their practical adoption on large datasets. Conventional exact inference methods rely heavily on the Cholesky matrix decomposition, which scales cubically with sample size and fails to fully exploit the parallel compute capabilities of modern graphics processing units (GPUs). Furthermore, existing Gaussian process software packages often tightly couple model definitions with specialized inference algorithms, making it difficult and labor-intensive to prototype advanced architectures or scale to larger problems.
The article evaluates a unified framework called Blackbox Matrix-Matrix (BBMM) inference, introduced alongside GPyTorch, a dedicated software platform built on PyTorch. BBMM reframes the core computational bottlenecks of Gaussian processes into parallel matrix multiplications, demonstrating how exact inference and popular scalable approximations can achieve significant speedups on modern hardware.
To evaluate this framework, the authors implemented a modified batched conjugate gradients algorithm that simultaneously computes model predictions, loss estimates, and parameter gradients within a single unified call, while employing a low-rank pivoted Cholesky preconditioner to accelerate numerical convergence. They benchmarked this approach across exact models and approximation schemes using multiple standard benchmark datasets with sizes ranging from hundreds up to over 500,000 data points.
The analysis yields several key findings. First, BBMM lowers the computational complexity of exact inference from cubic to quadratic time, achieving up to 20 to 32 times faster execution on GPUs compared to traditional CPU-based inference and roughly 4 to 8 times faster performance than GPU-accelerated Cholesky baselines. Second, for scalable approximation techniques like structured kernel interpolation, BBMM accelerates computation by up to 15 times over existing iterative methods. Third, the method matches or slightly improves upon the predictive accuracy of exact models by avoiding the numerical instabilities and artificial noise adjustments frequently required by Cholesky solvers. Finally, using a low-rank preconditioner dramatically accelerates solver convergence with negligible computational overhead.
These results demonstrate that organizations can train Gaussian process models on significantly larger datasets in less time and at lower compute costs without sacrificing mathematical exactness or predictive accuracy. By requiring only standard matrix multiplication routines, the framework decouples model design from inference, allowing engineering and research teams to implement complex or structured approximations in under 50 lines of code.
The authors recommend that teams deploying Gaussian process workflows adopt the open-source GPyTorch library and default to using the pivoted Cholesky preconditioner. Next steps should focus on extending theoretical convergence guarantees beyond one-dimensional cases to multivariate and non-standard kernels, as well as applying the framework more broadly to variational classification tasks. While the results provide high confidence for regression tasks up to GPU memory limits, users applying Gaussian processes to non-Gaussian likelihoods or extreme-scale problems should evaluate specific variational approximations suited to their target domain.
- Paper: Variational Learning of Inducing Variables in Sparse Gaussian Processes, Michalis K. Titsias (2009). Titsias establishes the foundational variational framework for inducing variables in sparse Gaussian processes, which GPyTorch incorporates and accelerates using structured matrix-vector and matrix-matrix multiplications.
- Paper: A Unifying View of Sparse Approximate Gaussian Process Regression, Joaquin Quiñonero-Candela et al. (2005). Quiñonero-Candela and Rasmussen provide the unified theoretical formulation of sparse Gaussian process approximations whose computational bottlenecks and kernel structures GPyTorch is designed to generalize and scale.
- Paper: Sparse Gaussian Processes using Pseudo-inputs, Edward Snelson et al. (2005). Snelson and Ghahramani introduce continuous pseudo-inputs for sparse Gaussian processes, establishing the core inducing-point parameterization that scalable frameworks like GPyTorch optimize.
- Paper: Using the Nyström Method to Speed Up Kernel Machines, Christopher K. I. Williams et al. (2000). Williams and Seeger demonstrate low-rank Nyström approximations for large-scale kernel systems, providing essential background on matrix approximation methods relevant to GP scaling.
- Paper: Random Features for Large-Scale Kernel Machines, Ali Rahimi et al. (2007). Rahimi and Recht develop random Fourier feature mappings for scaling kernel machines, offering a classic baseline approach to scalable kernel computations.
- Paper: PyTorch: An Imperative Style, High-Performance Deep Learning Library, Adam Paszke et al. (2019). Paszke et al. present the PyTorch architecture and automatic differentiation engine upon which the GPyTorch library and its GPU-accelerated operations are built.
- Paper: A Tutorial on Bayesian Optimization, Peter I. Frazier (2018). Frazier outlines the principles of Bayesian optimization, providing a direct downstream application area that routinely employs scalable GP models implemented in frameworks like GPyTorch.
- Paper: Triton: an intermediate language and compiler for tiled neural network computations, Philippe Tillet et al. (2019). Tillet et al. present Triton for authoring custom high-performance GPU kernels, offering advanced compilation techniques to further accelerate structured matrix-matrix operations in PyTorch-based frameworks.
- Paper: PyTorch Distributed: Experiences on Accelerating Data Parallel Training, Shen Li et al. (2020). Li et al. detail PyTorch's distributed data-parallel system, showing how GPU-accelerated PyTorch models can scale out across multi-node and multi-GPU clusters.
