GPRat depends on HPX for asynchronous task-based parallelization. Furthermore, for CPU-only BLAS computation GPRat requires OpenBLAS or MKL. A CUDA installation is required for GPU-only BLAS computations.
All dependencies can be installed using Spack.
A script to install and setup spack for GPRat is provided in spack-repo.
Spack environment configurations and setup scripts for CPU and GPU use are provided in
spack-repo/environments.
GPRat makes use of CMake presets to simplify the process of configuring the project.
For example, building and testing this project on a Linux machine is as easy as running the following commands:
cmake --preset=dev-linux
cmake --build --preset=dev-linux
ctest --preset=dev-linuxAs a developer, you may create a CMakeUserPresets.json file at the root of the project that contains additional
presets local to your machine.
In addition to the build configuration dev-linux, there are release-linux, dev-linux-gpu, and release-linux-gpu.
The configurations suffixed with -gpu build the library with CUDA.
GPRat can be build with or without Python bindings. The following options can be set to include / exclude parts of the project:
| Option name | Description | Default value |
|---|---|---|
| GPRAT_BUILD_CORE | Enable/Disable building of the core library | ON |
| GPRAT_BUILD_BINDINGS | Enable/Disable building of the Python bindings | ON |
| GPRAT_ENABLE_FORMAT_TARGETS | Enable/Disable code formatting helper targets | ON if top-level |
| GPRAT_ENABLE_EXAMPLES | Enable/Disable example projects | ON if top-level |
| GPRAT_USE_MKL | Enable/Disable usage of MKL library | OFF |
| GPRAT_WITH_CUDA | Enable/disable compilation with CUDA support | OFF |
Respective scripts can be found in this directory.
We also provide a spack package for GPRat in spack-repo/packages for portable and convenient compilation. When the repository is added to spack, GPRat can be installed with spack install gprat~cuda~bindings~examples blas={mkl,openblas}
GPRat contains several examples. One to run the C++ code, one to run the Python code as well as two reference implementations based on TensorFlow (GPflow) and PyTorch (GPyTorch).
- Go to
examples/gprat_cpp - Set parameters in
execute.cpp - The example is built as part of the main project.
- Go to
build/and execute./gprat_cpp [--use_gpu]to run the example. - If you want to use an installed GPRat version:
Run
./run_gprat_cpp.sh [cpu/gpu] [x86/arm/riscv]to build and run the example.
- Go to
- Go to
examples/gprat_python - Set parameters in
config.json - Run
./run_gprat_python.sh [cpu/gpu]to run the example
- Go to
examples/gpflow_reference - Set parameters in
config.json - Run
./run_gpflow.sh [cpu/gpu/arm]to run example
- Go to
examples/gpytorch_reference - Set parameters in
config.json - Run
./run_gpytorch.sh [cpu/gpu/arm]to run example
The GPRat library is developed by the Scientific Computing department at IPVS at the University of Stuttgart. The project is a joined effort of multiple undergraduate, graduate, and PhD students under the supervision of Prof. Dr. Dirk Pflüger. We specifically thank the follow contributors:
-
Alexander Strack: Maintainer and initial framework.
-
Maksim Helmann: Optimization, Python bindings and reference implementations.
@InProceedings{GPRat2025,
author={Helmann, Maksim and Strack, Alexander and Pfl{\"u}ger, Dirk},
title={{GPRat: Gaussian Process Regression with Asynchronous Tasks}},
booktitle={Asynchronous Many-Task Systems and Applications},
year={2025},
publisher={Springer Nature}
}