Accelerator support for GPRat : a task-based Gaussian process library in Python

Thumbnail Image

Date

2025

Journal Title

Journal ISSN

Volume Title

Publisher

Abstract

Gaussian Processes (GPs) are a powerful tool for regression tasks, but their computational complexity is a limiting factor. In particular, it must calculate the Cholesky decomposition of a large covariance matrix, which results in a lower triangular matrix and is used for making predictions and calculating the uncertainty of those predictions. This step has a cubic time complexity of and is the prevalent part of the computation. Therefore, we use task-based parallelism with the High Performance ParalleX (HPX) library and tiled algorithms that view the covariance matrix as smaller tiles of equal size. The tiled algorithm executes parallel tasks that each perform a Basic Linear Algebra Subprograms (BLAS) operation on those tiles to speed up the computation. This led to the creation of the Gaussian Process Regression using Asynchronous Tasks (GPRat) Python library, which implements GPs based on this approach with the HPX runtime system. GPRat aims to provide a scalable and efficient implementation of GPs for large datasets with an implementation in C++ while leveraging the simplicity of Python for ease of use and seamless interaction with other Python libraries. It utilizes Intel oneAPI Math Kernel Library (oneMKL) to perform the BLAS operations on the Central Processing Unit (CPU). Graphics Processing Units (GPUs) are well-optimized for parallel processing, in particular for BLAS operations that operate on large matrices. This thesis extends the GPRat library with accelerator support for NVIDIA GPUs to further speed up the Cholesky decomposition and the other GP operations that utilize its result. The CUDA library includes the cuBLAS library and cuSolver library which provide the necessary Linear Algebra PACKage (LAPACK) and BLAS operations for executing computations on GPUs. This thesis presents the addition of CUDA support to the GPRat library. In particular, it describes the implementation of the tiled Cholesky decomposition on GPUs and also the other GP operations that utilize its result and therefore perform its additional operations on the GPU as well. We then compare the performance of the GPU implementation to the existing CPU implementation on a single node including a dual-socket AMD EPYC 9274F CPU and an NVIDIA A30 24 GB GPU. The results show that the GPU implementation is faster when working with at least 128 training samples and fewer but larger tiles. We also compared the performance of the GPRat library in computing the full covariance matrix prediction to the CPU implementation, but also to the GPyTorch and GPflow libraries on both CPU and GPU, which are two popular and highly efficient GP libraries for Python. We find that the GPRat library is the fastest on the CPU, competitive with the other libraries on the GPU, and scales well with the number of training samples. However, GPflow is slightly faster than GPRat on the GPU for higher numbers of training samples, and the optimal number of matrix tiles gives hardly any performance benefit on a single node.


Gauß'sche Prozesse (GPs) sind ein leistungsfähiges Werkzeug für Regressionsaufgaben, jedoch ist ihre Zeitkomplexität ein begrenzender Faktor. Insbesondere muss die Cholesky-Zerlegung einer großen Kovarianzmatrix berechnet werden, welche in einer unteren Dreiecksmatrix resultiert, zur Erstellung von Vorhersagen und zur Berechnung der Unsicherheit dieser Vorhersagen verwendet wird. Dieser Schritt hat eine kubische Zeitkomplexität von und ist der am aufwendigste Teil der Berechnung für Vorhersagen. Daher verwenden wir aufgabenbasierte Parallelität mit der High Performance ParalleX (HPX)-Bibliothek und einen Kachelalgorithmus, der die Kovarianzmatrix als kleinere Kacheln gleicher Größe betrachtet. Der Kachelalgorithmus führt parallele Aufgaben aus, die jeweils eine BLAS-Operation (Basic Linear Algebra Subprograms) auf diesen Kacheln ausführen, um die Berechnung zu beschleunigen. Dies führte zur Erstellung der Python-Bibliothek Gaussian Process Regression using Asynchronous Tasks (GPRat), die GPs auf der Grundlage dieses Ansatzes mit dem HPX-Laufzeitsystem implementiert. GPRat zielt darauf ab, eine skalierbare und effiziente Implementierung von GPs für große Datensätze mit einer Implementierung in C++ bereitzustellen und gleichzeitig die Einfachheit von Python für eine einfache Nutzung und nahtlose Interaktion mit anderen Python-Bibliotheken bereitzustellen. Es nutzt die Intel oneAPI Math Kernel Library (oneMKL), um die BLAS-Operationen auf der Central Processing Unit (CPU) auszuführen. Grafikprozessoren (GPUs) sind für die parallele Verarbeitung gut optimiert, insbesondere für BLAS-Operationen, die auf großen Matrizen arbeiten. Diese Arbeit erweitert die GPRat-Bibliothek um eine Beschleunigerunterstützung für NVIDIA-GPUs erweitert, um die Cholesky-Zerlegung und die anderen GP-Operationen, die ihr Ergebnis verwenden, weiter zu beschleunigen. Die CUDA-Bibliothek umfasst die cuBLAS-Bibliothek und die cuSolver-Bibliothek, die die notwendigen Linear Algebra PACKage (LAPACK) und BLAS Operationen für die Ausführung von Berechnungen auf GPUs bereitstellen. Diese Arbeit stellt die Erweiterung der GPRat-Bibliothek um CUDA-Unterstützung vor. Insbesondere wird die Implementierung der gekachelten Cholesky-Zerlegung auf GPUs beschrieben und auch die anderen GP-Operationen, die das Ergebnis nutzen und daher ihre zusätzlichen Operationen auch auf der GPU ausführen. Anschließend vergleichen wir die Leistung der GPU-Implementierung mit der bestehenden CPU-Implementierung auf einem einzelnen Knoten mit einer AMD EPYC 9274F CPU mit zwei Sockeln und einer NVIDIA A30 24 GB GPU. Die Ergebnisse zeigen, dass die GPU-Implementierung schneller ist, wenn mit mindestens 128 Trainingsdaten und weniger, aber größeren Kacheln gearbeitet wird. Wir haben außerdem die Leistung der GPRat-Bibliothek bei der Berechnung der vollständigen Kovarianzmatrix-Vorhersage mit der CPU Implementierung sowie mit den GPyTorch- und GPflow-Bibliotheken auf CPU und GPU verglichen, zwei beliebten und hocheffizienten GP-Bibliotheken für Python. Wir stellen fest, dass die GPRat-Bibliothek auf der CPU am schnellsten ist, mit den anderen Bibliotheken auf der GPU konkurrieren kann und gut mit der Anzahl an Trainingsdaten skaliert. Allerdings ist GPflow auf der GPU bei einer höheren Anzahl von Trainingsproben etwas schneller als GPRat, und die optimale Anzahl von Matrixkacheln bringt auf einem einzelnen Knoten kaum einen Leistungsvorteil.

Description

Keywords

Citation

Endorsement

Review

Supplemented By

Referenced By