|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
Classes | |
| class | KFACExecutionContext |
Typedefs | |
| using | BackendT = ::Al::MPIBackend |
| using | ReqT = typename BackendT::req_type |
Functions | |
| template<El::Device Device> | |
| void | 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 | 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 | get_matrix_stat (const El::Matrix< DataType, Device > &X, const char *name) |
| Gets statistics of a given matrix. More... | |
| template<El::Device Device> | |
| void | 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 | is_reduce_scatter_buffer_required (kfac_reduce_scatter_mode mode) |
| Get whether a global buffer is needed. More... | |
| template<El::Device Device> | |
| void | 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 > | is_allgather_buffer_required (kfac_allgather_mode mode) |
| Get whether local and global buffers are needed. More... | |
| template<El::Device Device> | |
| void | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | TranslateBetweenGridsVC (El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > const &A, El::DistMatrix< T, El::STAR, El::VC, El::ELEMENT, Device > &B) |
Variables | |
| constexpr El::Device | Device = El::Device::CPU |
| typedef::Al::MPIBackend lbann::kfac::BackendT |
Definition at line 46 of file kfac_block.hpp.
| typedef typename BackendT::req_type lbann::kfac::ReqT |
Definition at line 49 of file kfac_block.hpp.
|
strong |
| Enumerator | |
|---|---|
| ALLREDUCE | |
| ALLGATHER | |
| BROADCAST | |
Definition at line 74 of file kfac_util.hpp.
|
strong |
| Enumerator | |
|---|---|
| ALL | |
| EACH | |
| ROOT | |
Definition at line 58 of file kfac_util.hpp.
|
strong |
| Enumerator | |
|---|---|
| ALLREDUCE | |
| REDUCE_SCATTER | |
| REDUCE | |
Definition at line 67 of file kfac_util.hpp.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| std::string lbann::kfac::get_matrix_stat | ( | const El::Matrix< DataType, Device > & | X, |
| const char * | name | ||
| ) |
Gets statistics of a given matrix.
| 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.
| std::pair<bool, bool> lbann::kfac::is_allgather_buffer_required | ( | kfac_allgather_mode | mode | ) |
Get whether local and global buffers are needed.
| bool lbann::kfac::is_reduce_scatter_buffer_required | ( | kfac_reduce_scatter_mode | mode | ) |
Get whether a global buffer is needed.
| 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.
| 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.
| 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.
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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 | ||
| ) |
| 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.
| 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.
Aave = Aave * decay + A * (1-decay)
| constexpr El::Device lbann::kfac::Device = El::Device::CPU |
Definition at line 51 of file kfac/execution_context.hpp.