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

Triangular solves and Cholesky inverse whose floating-point result does not depend on the process grid. More...

#include <mpi.h>
#include <Eigen/Cholesky>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <algorithm>
#include <atomic>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <limits>
#include <memory>
#include <new>
#include <optional>
#include <stdexcept>
#include <utility>
#include <vector>
#include "CanonicalTileKernels.h"
#include "DistributedState.h"
#include "FixedOrderKernels.h"
#include "MemoryBudget.h"
#include "TeamFactor.h"
#include "TileParallel.h"
#include "TrainingProduct.h"
#include "schemeii/SchemeII.h"

Go to the source code of this file.

Classes

struct  gpr::linalg::canonical::TileGeometry
class  gpr::linalg::canonical::AlignedBlockCache
class  gpr::linalg::canonical::AlignedTile
class  gpr::linalg::canonical::AlignedBuffer
struct  gpr::linalg::canonical::SubstitutionCache

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.
namespace  gpr::linalg::canonical

Typedefs

using gpr::linalg::canonical::TileMap = Eigen::Map<Eigen::MatrixXd, 0, Eigen::OuterStride<>>
using gpr::linalg::canonical::AlignedMap = Eigen::Map<Eigen::MatrixXd, Eigen::Aligned64>
 A packed tile of an AlignedBuffer, typed as AlignedTile::map().

Enumerations

enum class  gpr::linalg::canonical::Triangle { gpr::linalg::canonical::Lower , gpr::linalg::canonical::Upper }

Functions

std::atomic< int > & gpr::linalg::canonical::choleskyPanelGroup () noexcept
TileGeometry gpr::linalg::canonical::geometryOf (DistributedState &st, const int *desc)
TileMap gpr::linalg::canonical::tileAt (double *base, int lld, const TileGeometry &g, int row_tile, int col_tile, int rows, int cols)
void gpr::linalg::canonical::requireWorkspaceBudget (DistributedState &st, const char *what, std::int64_t needed, AvailableMemory available)
void gpr::linalg::canonical::trsm (DistributedState &st, Triangle triangle, const double *T, const int *desc_t, double *B, const int *desc_b, int n, int ncols, bool lower_rhs)
std::int64_t gpr::linalg::canonical::transposeWorkspaceBytes (const int *desc, int local_cols, std::int64_t batch_entries)
std::vector< double > gpr::linalg::canonical::transposeFactor (DistributedState &st, const double *L, const int *desc, int n, std::int64_t batch_entries=0)
void gpr::linalg::canonical::trsmLowerFactor (DistributedState &st, const double *L, const int *desc_l, double *B, const int *desc_b, int n, int ncols, bool transpose)
void gpr::linalg::canonical::trsmCachedLowerFactor (DistributedState &st, double *B, const int *desc_b, int n, int ncols, bool transpose)
void gpr::linalg::canonical::trsmLowerFactorCached (DistributedState &st, SubstitutionCache &cache, const double *L, const int *desc_l, double *B, const int *desc_b, int n, int ncols, bool transpose)
void gpr::linalg::canonical::solveLowerFactorCached (DistributedState &st, SubstitutionCache &cache, const double *L, const int *desc_l, double *B, const int *desc_b, int n, int ncols)
 Solves L L^T X = B in place against a cached factor.
Eigen::MatrixXd gpr::linalg::canonical::gramTiles (const Eigen::MatrixXd &x, int nb)
void gpr::linalg::canonical::solveLowerFactor (DistributedState &st, const double *L, const int *desc_l, double *B, const int *desc_b, int n, int ncols)
void gpr::linalg::canonical::choleskyInverseLower (DistributedState &st, const double *L, const int *desc, int n, std::vector< double > &inverse, std::optional< const double * > upper=std::nullopt)
void gpr::linalg::canonical::extendBorder (DistributedState &st, const DistributedState::TileCommunicators &comms, const TileGeometry &g, double *A, int lld, int n, int first_new, int tiles)
int gpr::linalg::canonical::exactOuterWidth ()
bool gpr::linalg::canonical::potrfLowerExact (DistributedState &st, const schemeii::Context &ctx, double *A, const int *desc, int n, int n_factored)
bool gpr::linalg::canonical::potrfLower (DistributedState &st, double *A, const int *desc, int n, int n_factored=0)

Variables

constexpr int gpr::linalg::canonical::kExactMinColumns = 32
constexpr std::int64_t gpr::linalg::canonical::kTransposeBatchEntries = std::int64_t{1} << 24

Detailed Description

Triangular solves and Cholesky inverse whose floating-point result does not depend on the process grid.

ScaLAPACK's pdtrsm and pdpotri choose their update and combine order from the process grid, so the same factor yields different low-order bits at different rank counts. The routines here fix the arithmetic instead:

  • The matrices stay in the ScaLAPACK block-cyclic layout; tiles are the nb x nb blocks of that layout (nb is the descriptor block size, which does not depend on the rank count for a training matrix).
  • Every tile update runs on exactly one rank as a single dense kernel on a tile-shaped operand, so its rounding is a function of the tile contents and shape only.
  • A tile receives its updates one panel at a time in a fixed order (ascending panel index for forward substitution, descending for back substitution), never as a partial sum combined across ranks.
  • Communication moves whole tiles by broadcast along process rows and columns; no floating-point reduction crosses a rank boundary.

The result is bit-identical for every process grid and rank count that shares the block size.

Definition in file CanonicalTriangular.h.