| 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 | } |
no test coverage detected