MCPcopy Create free account
hub / github.com/LBANN/lbann / load_from_checkpoint_shared

Method load_from_checkpoint_shared

src/models/model.cpp:1974–1998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1972}
1973
1974bool model::load_from_checkpoint_shared(persist& p)
1975{
1976 const std::string trainer_dir = p.get_checkpoint_dir();
1977 p.open_restart(file::join_path(trainer_dir, get_name()));
1978 // Assume checkpoint reload from epoch end not step end
1979
1980 std::ifstream ifs;
1981 if (m_comm->am_trainer_master()) {
1982 ifs.open(file::join_path(p.get_checkpoint_dir(), "model.bin"));
1983 LBANN_ASSERT(ifs.good());
1984 }
1985
1986 // Restore the checkpoint
1987 {
1988 lbann::RootedBinaryInputArchive ar(ifs, m_comm->get_trainer_grid());
1989 ar(*this);
1990 }
1991
1992 m_model_is_setup = false;
1993 p.set_restart_dir(trainer_dir);
1994#ifdef LBANN_HAS_GPU
1995 hydrogen::gpu::SynchronizeDevice();
1996#endif // LBANN_HAS_GPU
1997 return true;
1998}
1999
2000bool model::save_to_checkpoint_distributed(persist& p)
2001{

Callers 5

load_inference_modelFunction · 0.45
exchange_modelsMethod · 0.45
reload_modelMethod · 0.45
reload_trainerMethod · 0.45
restartMethod · 0.45

Calls 4

open_restartMethod · 0.80
am_trainer_masterMethod · 0.80
join_pathFunction · 0.50
set_restart_dirMethod · 0.45

Tested by

no test coverage detected