Skip to content

Commit 69fe91a

Browse files
trivialfisCopilot
andauthored
Emit warning for text input. (#11590)
--------- Co-authored-by: Copilot <[email protected]>
1 parent 45da693 commit 69fe91a

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/common/error_msg.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ namespace xgboost::error {
1919
return ss.str();
2020
}
2121

22-
void WarnDeprecatedGPUHist() {
23-
auto msg =
24-
"The tree method `gpu_hist` is deprecated since 2.0.0. To use GPU training, set the `device` "
25-
R"(parameter to CUDA instead.
26-
27-
E.g. tree_method = "hist", device = "cuda"
28-
)";
29-
LOG(WARNING) << msg;
30-
}
31-
3222
void WarnManualUpdater() {
3323
static std::once_flag flag;
3424
std::call_once(flag, [] {

src/common/error_msg.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ inline void WarnOldSerialization() {
8484
logged = true;
8585
}
8686

87-
void WarnDeprecatedGPUHist();
88-
8987
void WarnManualUpdater();
9088

9189
void WarnEmptyDataset();

src/data/data.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,11 @@ DMatrix* DMatrix::Load(const std::string& uri, bool silent, DataSplitMode data_s
931931

932932
int partid = 0, npart = 1;
933933

934+
static std::once_flag warning_flag;
935+
std::call_once(warning_flag, []() {
936+
LOG(WARNING) << "Text file input has been deprecated since 3.1";
937+
});
938+
934939
fname = data::ValidateFileFormat(fname);
935940
std::unique_ptr<dmlc::Parser<std::uint32_t>> parser(
936941
dmlc::Parser<std::uint32_t>::Create(fname.c_str(), partid, npart, "auto"));

0 commit comments

Comments
 (0)