Loading...
Searching...
No Matches
IterativeSolver.h File Reference

Preconditioned conjugate gradient (PCG) solver for symmetric positive-definite systems. Replaces the Cholesky factor + pdtrsm path of the strong-scaling-limited regime with a matrix-free Krylov solver. The CG state and the caller-supplied matvec are replicated across ranks, so the per-iteration inner products are taken on local replicated vectors with no cross-rank reduction. More...

#include <Eigen/Core>
#include <cassert>
#include <cmath>
#include <functional>
#include <limits>
#include "../../backend/Macros.h"

Go to the source code of this file.

Classes

struct  gpr::linalg::PCGResult
struct  gpr::linalg::PCGSettings

Namespaces

namespace  gpr
 Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
namespace  gpr::linalg
 Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators, backend selection.

Functions

double gpr::linalg::pcg_dot (const Eigen::VectorXd &a, const Eigen::VectorXd &b)
PCGResult gpr::linalg::preconditioned_cg (const std::function< Eigen::VectorXd(const Eigen::VectorXd &)> &apply_A, const std::function< Eigen::VectorXd(const Eigen::VectorXd &)> &apply_M_inv, const Eigen::VectorXd &b, const PCGSettings &settings={})

Detailed Description

Preconditioned conjugate gradient (PCG) solver for symmetric positive-definite systems. Replaces the Cholesky factor + pdtrsm path of the strong-scaling-limited regime with a matrix-free Krylov solver. The CG state and the caller-supplied matvec are replicated across ranks, so the per-iteration inner products are taken on local replicated vectors with no cross-rank reduction.

Reference: Wenger, Pleiss, Reuther, Hennig, Cunningham, "Reducing the variance of Gaussian process hyperparameter optimisation with preconditioning", AISTATS 2022. The block-Jacobi preconditioner is the inverse of each rank's diagonal block of the kernel matrix; the matvec is supplied by the caller (e.g. accumulateCrossCovarianceMatVecLocal in GaussianProcessRegression, which is matrix-free in the Schmitz eq-6 sense).

Determinism: bit-identical results across rank counts when (a) the matvec callback is bit-deterministic and returns a replicated result, and (b) the preconditioner is bit-deterministic. The solver runs the same loop on every rank with replicated state and takes the inner products locally, so the floating-point trajectory does not depend on the rank count.

Definition in file IterativeSolver.h.