LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::ExecutionContext Class Referenceabstract

#include <execution_context.hpp>

Inheritance diagram for lbann::ExecutionContext:
[legend]

Public Member Functions

 ExecutionContext ()
 
virtual ~ExecutionContext ()=default
 
virtual std::unique_ptr< ExecutionContextget_new () const =0
 
virtual std::string get_type () const =0
 Get a string identifying the type of execution context. More...
 
virtual std::string get_state_string () const noexcept=0
 Return the state of the execution context as a string. More...
 
virtual execution_mode get_execution_mode () const noexcept
 
size_t get_step () const noexcept
 Current step in the training algorithm. More...
 
void inc_step () noexcept
 Increment the current step in the training algorithm. More...
 
Checkpointing and Serialization
template<class Archive >
void serialize (Archive &ar)
 
virtual void save_to_checkpoint_shared (persist &p)=0
 Checkpoint exection_context to a shared checkpoint. More...
 
virtual void load_from_checkpoint_shared (persist &p)=0
 Restore execution_context from a shared checkpoint. More...
 
virtual void save_to_checkpoint_distributed (persist &p)=0
 Checkpoint exection_context to a distributed checkpoint. More...
 
virtual void load_from_checkpoint_distributed (persist &p)=0
 Restore execution_context from a distributed checkpoint. More...
 

Protected Member Functions

 ExecutionContext (const ExecutionContext &other)=delete
 
ExecutionContextoperator= (const ExecutionContext &other)=delete
 
 ExecutionContext (ExecutionContext &&other)=default
 
ExecutionContextoperator= (ExecutionContext &&other)=default
 

Private Attributes

size_t m_step = 0UL
 Current step in the training algorithm. More...
 

Friends

class cereal::access
 

Detailed Description

Definition at line 47 of file execution_context.hpp.

Constructor & Destructor Documentation

◆ ExecutionContext() [1/3]

lbann::ExecutionContext::ExecutionContext ( )

Constructor.

◆ ~ExecutionContext()

virtual lbann::ExecutionContext::~ExecutionContext ( )
virtualdefault

Destructor.

◆ ExecutionContext() [2/3]

lbann::ExecutionContext::ExecutionContext ( const ExecutionContext other)
protecteddelete

Copy constructor.

◆ ExecutionContext() [3/3]

lbann::ExecutionContext::ExecutionContext ( ExecutionContext &&  other)
protecteddefault

Move constructor.

Member Function Documentation

◆ get_execution_mode()

virtual execution_mode lbann::ExecutionContext::get_execution_mode ( ) const
inlinevirtualnoexcept

Reimplemented in lbann::SGDExecutionContext.

Definition at line 68 of file execution_context.hpp.

◆ get_new()

virtual std::unique_ptr<ExecutionContext> lbann::ExecutionContext::get_new ( ) const
pure virtual

Get a "clean" execution_context of the same type.

Implemented in lbann::kfac::KFACExecutionContext, lbann::SGDExecutionContext, and lbann::ltfb::LTFBExecutionContext.

◆ get_state_string()

virtual std::string lbann::ExecutionContext::get_state_string ( ) const
pure virtualnoexcept

Return the state of the execution context as a string.

Implemented in lbann::kfac::KFACExecutionContext, lbann::SGDExecutionContext, and lbann::ltfb::LTFBExecutionContext.

◆ get_step()

size_t lbann::ExecutionContext::get_step ( ) const
inlinenoexcept

Current step in the training algorithm.

Step counts the number of iterations in the training algorithm's internal state

Definition at line 77 of file execution_context.hpp.

Here is the caller graph for this function:

◆ get_type()

virtual std::string lbann::ExecutionContext::get_type ( ) const
pure virtual

Get a string identifying the type of execution context.

Should match the training algorithm.

Todo:
Absorb completely into get_state_string().

Implemented in lbann::SGDExecutionContext, lbann::kfac::KFACExecutionContext, and lbann::ltfb::LTFBExecutionContext.

◆ inc_step()

void lbann::ExecutionContext::inc_step ( )
inlinenoexcept

Increment the current step in the training algorithm.

Increment the step count in the training algorithm's internal state

Definition at line 83 of file execution_context.hpp.

Here is the call graph for this function:

◆ load_from_checkpoint_distributed()

virtual void lbann::ExecutionContext::load_from_checkpoint_distributed ( persist p)
pure virtual

Restore execution_context from a distributed checkpoint.

Implemented in lbann::kfac::KFACExecutionContext, lbann::SGDExecutionContext, and lbann::ltfb::LTFBExecutionContext.

◆ load_from_checkpoint_shared()

virtual void lbann::ExecutionContext::load_from_checkpoint_shared ( persist p)
pure virtual

Restore execution_context from a shared checkpoint.

Implemented in lbann::kfac::KFACExecutionContext, lbann::SGDExecutionContext, and lbann::ltfb::LTFBExecutionContext.

◆ operator=() [1/2]

ExecutionContext& lbann::ExecutionContext::operator= ( const ExecutionContext other)
protecteddelete

Copy assignment operator.

◆ operator=() [2/2]

ExecutionContext& lbann::ExecutionContext::operator= ( ExecutionContext &&  other)
protecteddefault

Move assignment operator.

◆ save_to_checkpoint_distributed()

virtual void lbann::ExecutionContext::save_to_checkpoint_distributed ( persist p)
pure virtual

Checkpoint exection_context to a distributed checkpoint.

Implemented in lbann::kfac::KFACExecutionContext, lbann::SGDExecutionContext, and lbann::ltfb::LTFBExecutionContext.

◆ save_to_checkpoint_shared()

virtual void lbann::ExecutionContext::save_to_checkpoint_shared ( persist p)
pure virtual

Checkpoint exection_context to a shared checkpoint.

Implemented in lbann::kfac::KFACExecutionContext, lbann::SGDExecutionContext, and lbann::ltfb::LTFBExecutionContext.

◆ serialize()

template<class Archive >
void lbann::ExecutionContext::serialize ( Archive &  ar)

Archive for checkpoint and restart

Friends And Related Function Documentation

◆ cereal::access

friend class cereal::access
friend

Definition at line 103 of file execution_context.hpp.

Member Data Documentation

◆ m_step

size_t lbann::ExecutionContext::m_step = 0UL
private

Current step in the training algorithm.

Step counts the number of iterations in the training algorithm's internal state

Definition at line 118 of file execution_context.hpp.


The documentation for this class was generated from the following file: