Preserve order of saved updaters config. (#9355)
- Save the updater sequence as an array instead of object. - Warn only once. The compatibility is kept, but we should be able to break it as the config is not loaded in pickle model and it's declared to be not stable.
This commit is contained in:
@@ -51,5 +51,33 @@ inline void MaxFeatureSize(std::uint64_t n_features) {
|
||||
constexpr StringView InplacePredictProxy() {
|
||||
return "Inplace predict accepts only DMatrixProxy as input.";
|
||||
}
|
||||
|
||||
inline void MaxSampleSize(std::size_t n) {
|
||||
LOG(FATAL) << "Sample size too large for the current updater. Maximum number of samples:" << n
|
||||
<< ". Consider using a different updater or tree_method.";
|
||||
}
|
||||
|
||||
constexpr StringView OldSerialization() {
|
||||
return R"doc(If you are loading a serialized model (like pickle in Python, RDS in R) or
|
||||
configuration generated by an older version of XGBoost, please export the model by calling
|
||||
`Booster.save_model` from that version first, then load it back in current version. See:
|
||||
|
||||
https://xgboost.readthedocs.io/en/stable/tutorials/saving_model.html
|
||||
|
||||
for more details about differences between saving model and serializing.
|
||||
)doc";
|
||||
}
|
||||
|
||||
inline void WarnOldSerialization() {
|
||||
// Display it once is enough. Otherwise this can be really verbose in distributed
|
||||
// environments.
|
||||
static thread_local bool logged{false};
|
||||
if (logged) {
|
||||
return;
|
||||
}
|
||||
|
||||
LOG(WARNING) << OldSerialization();
|
||||
logged = true;
|
||||
}
|
||||
} // namespace xgboost::error
|
||||
#endif // XGBOOST_COMMON_ERROR_MSG_H_
|
||||
|
||||
Reference in New Issue
Block a user