LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
kfac_util.hpp File Reference
Include dependency graph for kfac_util.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  lbann::kfac_block< Device >
 

Namespaces

 lbann
 
 lbann::kfac
 

Enumerations

enum  lbann::kfac::kfac_inverse_strategy { lbann::kfac::kfac_inverse_strategy::ALL, lbann::kfac::kfac_inverse_strategy::EACH, lbann::kfac::kfac_inverse_strategy::ROOT }
 
enum  lbann::kfac::kfac_reduce_scatter_mode { lbann::kfac::kfac_reduce_scatter_mode::ALLREDUCE, lbann::kfac::kfac_reduce_scatter_mode::REDUCE_SCATTER, lbann::kfac::kfac_reduce_scatter_mode::REDUCE }
 
enum  lbann::kfac::kfac_allgather_mode { lbann::kfac::kfac_allgather_mode::ALLREDUCE, lbann::kfac::kfac_allgather_mode::ALLGATHER, lbann::kfac::kfac_allgather_mode::BROADCAST }
 

Functions

template<El::Device Device>
void lbann::kfac::get_matrix_inverse (El::AbstractMatrix< DataType > &Ainv, El::AbstractMatrix< DataType > &Linv, const El::AbstractMatrix< DataType > &A, bool report_time, DataType damping, DataType damping_bn_err, bool is_bn, const El::SyncInfo< Device > &sync_info)
 Gets the inverse matrix of A. More...
 
template<El::Device Device>
void lbann::kfac::get_matrix_inverse_eigen (El::AbstractMatrix< DataType > &Ainv, El::AbstractMatrix< DataType > &Linv, const El::AbstractMatrix< DataType > &A, bool report_time, DataType damping, DataType damping_bn_err, bool is_bn, const El::SyncInfo< Device > &sync_info)
 Gets the inverse matrix of A using Eigen Value Decomposition. More...
 
template<El::Device Device>
std::string lbann::kfac::get_matrix_stat (const El::Matrix< DataType, Device > &X, const char *name)
 Gets statistics of a given matrix. More...
 
template<El::Device Device>
void lbann::kfac::allreduce_lower_tri (El::AbstractMatrix< DataType > &A, El::AbstractMatrix< DataType > &AL, lbann_comm *comm, const El::SyncInfo< Device > &sync_info)
 Perform all-reduce on the lower triangular of a symmetric matrix. More...
 
bool lbann::kfac::is_reduce_scatter_buffer_required (kfac_reduce_scatter_mode mode)
 Get whether a global buffer is needed. More...
 
template<El::Device Device>
void lbann::kfac::reduce_scatter_blocks (const std::vector< std::pair< size_t, El::AbstractMatrix< DataType > *>> &blocks, El::Matrix< DataType, Device > &global_buffer, lbann_comm *comm, kfac_reduce_scatter_mode mode)
 Perform reduce-scatter on one or more blocks. More...
 
std::pair< bool, bool > lbann::kfac::is_allgather_buffer_required (kfac_allgather_mode mode)
 Get whether local and global buffers are needed. More...
 
template<El::Device Device>
void lbann::kfac::allgather_blocks (const std::vector< std::pair< size_t, El::AbstractMatrix< DataType > *>> &blocks, El::Matrix< DataType, Device > &send_buffer, El::Matrix< DataType, Device > &recv_buffer, lbann_comm *comm, kfac_allgather_mode mode)
 Perform reduce-scatter on one or more blocks. More...
 
template<El::Device Device>
void lbann::kfac::allgather_inverse_matrices (const std::vector< std::shared_ptr< kfac_block< Device >>> &blocks, El::Matrix< DataType, Device > &global_buffer, lbann_comm *comm)
 Perform allgather for inverse matrices. More...
 
template<El::Device Device>
void lbann::kfac::allgather_inverse_matrices_sizes (const std::vector< std::shared_ptr< kfac_block< Device >>> &blocks, El::Matrix< double, El::Device::CPU > &global_buffer, lbann_comm *comm)
 Perform allgather for inverse matrices size. More...
 
template<El::Device Device>
void lbann::kfac::add_to_diagonal (El::Matrix< DataType, Device > &A, DataType value, DataType value_bn_err, bool is_bn, const El::SyncInfo< Device > &sync_info)
 Add the damping value to the diagonal elements of A. More...
 
template<El::Device Device>
void lbann::kfac::make_diagonal (El::Matrix< DataType, Device > &A, El::Matrix< DataType, Device > &B, DataType value, DataType value_bn_err, bool is_bn, const El::SyncInfo< Device > &sync_info)
 Add the damping value to the diagonal elements of A from B. More...
 
template<El::Device Device>
void lbann::kfac::get_matrix_entrywise_inverse (El::Matrix< DataType, Device > &input, El::Matrix< DataType, Device > &output, const El::SyncInfo< Device > &sync_info)
 Add the damping value to the diagonal elements of A. More...
 
template<El::Device Device>
void lbann::kfac::fill_upper_tri (El::Matrix< DataType, Device > &A, const El::SyncInfo< Device > &sync_info)
 Fill the upper trianglar with the lower trianglar. More...
 
template<El::Device Device>
void lbann::kfac::update_kronecker_average (El::Matrix< DataType, Device > &Aave, const El::Matrix< DataType, Device > &A, size_t count, double decay, const El::SyncInfo< Device > &sync_info)
 Update a Kronecker factor matrix using decay. More...
 
template<El::Device Device>
void lbann::kfac::identity (El::Matrix< DataType, Device > &A, const El::SyncInfo< Device > &sync_info)
 Substitute the identity matrix. TODO: Replace with El::Identity<El::Device::GPU> once it gets supported. More...
 
template<El::Device Device>
void lbann::kfac::pack_lower_tri (El::Matrix< DataType, Device > &L, const El::Matrix< DataType, Device > &A, const El::SyncInfo< Device > &sync_info)
 Pack the lower triangular of a symmetric matrix. More...
 
template<El::Device Device>
void lbann::kfac::unpack_lower_tri (El::Matrix< DataType, Device > &A, const El::Matrix< DataType, Device > &L, const El::SyncInfo< Device > &sync_info)
 Unpack the lower triangular of a symmetric matrix. More...
 
template<typename T , El::Device Device>
void lbann::kfac::TranslateBetweenGridsVCAsync (const El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &A, El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &B, El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &subset, std::vector< ReqT > &Requests)
 
template<typename T , El::Device Device>
void lbann::kfac::TranslateBetweenGridsVCAsyncDirect (const El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &A, El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &B, El::Int featureSize, El::Int currentBatchSize, std::vector< ReqT > &Requests)
 
template<typename T , El::Device Device>
void lbann::kfac::TranslateBetweenGridsSTARAsync (const El::DistMatrix< T, El::STAR, El::STAR, El::ELEMENT, Device > &A, El::DistMatrix< T, El::STAR, El::STAR, El::ELEMENT, Device > &B, std::vector< ReqT > &Requests)
 
template<typename T , El::Device Device>
void lbann::kfac::TranslateBetweenGridsKFACAsync (const El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &A, El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &B, std::vector< ReqT > &Requests)
 
template<typename T , El::Device Device>
void lbann::kfac::TranslateBetweenGridsVC (El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > const &A, El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &B)