gko::solver::PipeCg#

Pipelined conjugate gradient. Restructures the standard CG loop so that the global reductions (inner products) can overlap with the next matrix-vector product and preconditioner apply. Reduces synchronisation latency on large distributed runs at the cost of more local work and extra vector storage per iteration. The rearranged operations make it less numerically stable than standard CG, and like CG it targets symmetric positive-definite matrices.

template<typename ValueType = default_precision>
class PipeCg #

Inherits from

  • public gko::EnableLinOp<PipeCg<default_precision>>

  • public gko::solver::EnablePreconditionedIterativeSolver<default_precision, PipeCg<default_precision>>

  • public gko::Transposable

PIPE_CG or the pipelined conjugate gradient method is an iterative type Krylov subspace method which is suitable for symmetric positive definite methods. It improves upon the CG method by allowing computation of inner products and norms to be overlapped with operator and preconditioner application. The pipelined method scales up to the 10^6 nodes of the assumed exascale machine, while its standard counterpart level off about one order of magnitude earlier, as suggested in the referenced paper (see below).

Possible issues:

  1. Numerical instability: Due to the rearrangement of the operations, the method is known to be less stable than standard PCG.

  2. The method is suitable for cases where a large number of iterations need to be performed and when the solver is distributed over a large number of distributed nodes. The advantage of lesser number of reductions that need to be performed comes at the cost of increased vector operations, and the cost of increased storage of vectors.

  3. As the CG itself, this method performs very well for symmetric positive definite matrices but it is in general not suitable for general matrices.

The implementation in Ginkgo is based on the following paper: Pipelined, Flexible Krylov Subspace Methods, P. Sanan et. al, SISC, 2016, doi: 10.1137/15M1049130

Template Parameters:

ValueType – precision of matrix elements

Public Functions

virtual std::unique_ptr<LinOp> transpose() const override#

Returns a LinOp representing the transpose of the Transposable object.

Returns:

a pointer to the new transposed object

virtual std::unique_ptr<LinOp> conj_transpose() const override#

Returns a LinOp representing the conjugate transpose of the Transposable object.

Returns:

a pointer to the new conjugate transposed object

inline bool apply_uses_initial_guess() const override#

Return true as iterative solvers use the data in x as an initial guess.

Returns:

true as iterative solvers use the data in x as an initial guess.

Public Static Functions

static parameters_type parse(
const config::pnode &config,
const config::registry &context,
const config::type_descriptor &td_for_child = config::make_type_descriptor<ValueType>(),
)#

Create the parameters from the property_tree. Because this is directly tied to the specific type, the value/index type settings within config are ignored and type_descriptor is only used for children configs.

Parameters:
  • config – the property tree for setting

  • context – the registry

  • td_for_child – the type descriptor for children configs. The default uses the value type of this class.

Returns:

parameters

struct parameters_type #

Inherits from

  • public gko::solver::enable_preconditioned_iterative_solver_factory_parameters<parameters_type, Factory>