gko::solver::CbGmres#

Compressed-basis GMRES. A mixed-precision variant of GMRES that stores the Krylov basis in a lower precision than the working precision of the matrix and right-hand side. Reduces memory bandwidth and storage for the basis vectors without sacrificing the final residual accuracy.

template<typename ValueType = default_precision>
class CbGmres #

Inherits from

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

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

CB-GMRES or the compressed basis generalized minimal residual method is an iterative type Krylov subspace method which is suitable for nonsymmetric linear systems.

The implementation in Ginkgo makes use of the merged kernel to make the best use of data locality. The inner operations in one iteration of CB-GMRES are merged into 2 separate steps. Classical Gram-Schmidt with reorthogonalization is used.

The Krylov basis can be stored in reduced precision (compressed) to reduce memory accesses, while all computations (including Krylov basis operations) are performed in the same arithmetic precision ValueType. By default, the Krylov basis are stored in one precision lower than ValueType.

Mathematically CB-GMRES is the same algorithm as standard GMRES — the Arnoldi process produces an orthonormal basis \( V_m \) and an upper Hessenberg \( \bar H_m \) with \( A V_m = V_{m+1} \bar H_m \), and the iterate is chosen as

\[ x_m = x_0 + V_m\, y_m, \qquad y_m = \arg\min_{y} \| \beta\, e_1 - \bar H_m\, y \|_2. \]
The “compressed basis” variant stores the columns of \( V_m \) in a precision lower than ValueType: each basis vector is cast down to the storage type when written and cast back up when read. The Hessenberg matrix, the Givens rotations, and the working residual all stay in full ValueType precision, so the final approximation has the same accuracy as standard GMRES while the basis storage and the bandwidth needed to apply it are reduced. See the storage_precision enum for the supported compression options.

Template Parameters:

ValueType – the arithmetic precision and the precision of matrix elements

Public Functions

inline size_type get_krylov_dim() const#

Returns the Krylov dimension.

Returns:

the Krylov dimension

inline void set_krylov_dim(size_type other)#

Sets the Krylov dimension

Parameters:

other – the new Krylov dimension

inline cb_gmres::storage_precision get_storage_precision() const#

Returns the storage precision used internally.

Returns:

the storage precision used internally

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>

Public Members

cb_gmres::storage_precision storage_precision#

Determines which storage type is used.

size_type krylov_dim#

Krylov dimension factory.