MCPcopy Create free account
hub / github.com/catboost/catboost / MaybeSaveSnapshot

Method MaybeSaveSnapshot

catboost/cuda/methods/boosting_progress_tracker.cpp:241–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239 }
240
241 void TBoostingProgressTracker::MaybeSaveSnapshot(std::function<void(IOutputStream*)> saver) {
242 if (IsTimeToSaveSnapshot()) {
243 const auto snapshotBackup = OutputFiles.SnapshotFile + ".bak";
244 TProgressHelper(GpuProgressLabel()).Write(snapshotBackup, [&](IOutputStream* out) {
245 NJson::TJsonArray processors;
246 const auto& devicesProps = NCudaLib::NCudaHelpers::GetDevicesProps();
247 for (const auto& props : devicesProps) {
248 processors.AppendValue(props.GetName());
249 }
250 TrainingCallbacks->OnSaveSnapshot(processors, out);
251 ::Save(out, CatBoostOptionsStr);
252 ::Save(out, History);
253 ::Save(out, ProfileInfo.DumpProfileInfo());
254 ::Save(out, LearnAndTestQuantizedFeaturesCheckSum);
255 saver(out);
256 });
257 TFsPath(snapshotBackup).ForceRenameTo(OutputFiles.SnapshotFile);
258 LastSnapshotTime = Now();
259 }
260 }
261}

Callers 2

FitMethod · 0.45
FitMethod · 0.45

Calls 11

TProgressHelperClass · 0.85
GpuProgressLabelFunction · 0.85
GetDevicesPropsFunction · 0.85
AppendValueMethod · 0.80
ForceRenameToMethod · 0.80
SaveFunction · 0.50
TFsPathClass · 0.50
NowFunction · 0.50
WriteMethod · 0.45
GetNameMethod · 0.45
OnSaveSnapshotMethod · 0.45

Tested by

no test coverage detected