Define the new device parameter. (#9362)
This commit is contained in:
@@ -3,23 +3,18 @@
|
||||
*/
|
||||
#include "error_msg.h"
|
||||
|
||||
#include "../collective/communicator-inl.h" // for GetRank
|
||||
#include "xgboost/logging.h"
|
||||
|
||||
namespace xgboost::error {
|
||||
void WarnDeprecatedGPUHist() {
|
||||
bool static thread_local logged{false};
|
||||
if (logged) {
|
||||
return;
|
||||
}
|
||||
auto msg =
|
||||
"The tree method `gpu_hist` is deprecated since 2.0.0. To use GPU training, set the `device` "
|
||||
R"(parameter to CUDA instead.
|
||||
|
||||
E.g. tree_method = "hist", device = "CUDA"
|
||||
|
||||
)";
|
||||
LOG(WARNING) << msg;
|
||||
logged = true;
|
||||
}
|
||||
|
||||
void WarnManualUpdater() {
|
||||
@@ -33,4 +28,23 @@ void WarnManualUpdater() {
|
||||
"behavior. For common uses, we recommend using `tree_method` parameter instead.";
|
||||
logged = true;
|
||||
}
|
||||
|
||||
void WarnDeprecatedGPUId() {
|
||||
static thread_local bool logged{false};
|
||||
if (logged) {
|
||||
return;
|
||||
}
|
||||
LOG(WARNING) << "`gpu_id` is deprecated in favor of the new `device` parameter: "
|
||||
<< "device = cpu/cuda/cuda:0";
|
||||
logged = true;
|
||||
}
|
||||
|
||||
void WarnEmptyDataset() {
|
||||
static thread_local bool logged{false};
|
||||
if (logged) {
|
||||
return;
|
||||
}
|
||||
LOG(WARNING) << "Empty dataset at worker: " << collective::GetRank();
|
||||
logged = true;
|
||||
}
|
||||
} // namespace xgboost::error
|
||||
|
||||
@@ -82,5 +82,9 @@ inline void WarnOldSerialization() {
|
||||
void WarnDeprecatedGPUHist();
|
||||
|
||||
void WarnManualUpdater();
|
||||
|
||||
void WarnDeprecatedGPUId();
|
||||
|
||||
void WarnEmptyDataset();
|
||||
} // namespace xgboost::error
|
||||
#endif // XGBOOST_COMMON_ERROR_MSG_H_
|
||||
|
||||
Reference in New Issue
Block a user