falkon.ooc_ops

The out-of-core algorithms for the Cholesky decomposition and the LAUUM operation are crucial for speeding up our library. To find out more about how they work, check the source code:

The following functions provide a higher-level interface to the two operations.

gpu_cholesky

falkon.ooc_ops.gpu_cholesky(A: torch.Tensor, upper: bool, clean: bool, overwrite: bool, opt: falkon.options.FalkonOptions)torch.Tensor
Parameters
  • A (torch.Tensor) – 2D positive-definite matrix of size (n x n) that will be factorized as A = U.T @ U (if upper is True) or A = L @ L.T if upper is False.

  • upper (bool) – Whether the triangle which should be factorized is the upper or lower of A.

  • clean (bool) – Whether the “other” triangle of the output matrix (the one that does not contain the factorization) will be filled with zeros or not.

  • overwrite (bool) – Whether to overwrite matrix A or to output the result in a new buffer.

  • opt (FalkonOptions) – Options forwarded for block calculation, and other knobs in the out-of-core parallel POTRF implementation. Useful options are the ones defined in CholeskyOptions .

Notes

The factorization will always be the ‘lower’ version of the factorization which could however end up on the upper-triangular part of the matrix in case A is not Fortran contiguous to begin with.

gpu_lauum

falkon.ooc_ops.gpu_lauum(A, upper, overwrite=True, write_opposite=False, opt: Optional[falkon.options.FalkonOptions] = None)
Parameters
  • A (torch.Tensor) – (N x N) positive-definite matrix that will be factorized as A = U.T @ U (if upper is True) or A = L @ L.T if upper is False.

  • overwrite (bool) – Whether to overwrite matrix A or to output the result in a new buffer.

Returns

out (torch.Tensor) – A (N x N) tensor. This will share the same memory as the input tensor A if overwrite is set to True, otherwise it will be a newly allocated tensor.