From e38d5a6831ef15798466872496ba6eff3bdf0343 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Fri, 9 Nov 2018 00:32:43 -0800 Subject: [PATCH] Document current limitation in number of features (#3886) --- src/learner.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/learner.cc b/src/learner.cc index f7e51151f..d56f4ceb5 100644 --- a/src/learner.cc +++ b/src/learner.cc @@ -674,11 +674,15 @@ class LearnerImpl : public Learner { inline void LazyInitModel() { if (this->ModelInitialized()) return; // estimate feature bound + // TODO(hcho3): Change num_feature to 64-bit integer unsigned num_feature = 0; for (auto & matrix : cache_) { CHECK(matrix != nullptr); - num_feature = std::max(num_feature, - static_cast(matrix->Info().num_col_)); + const uint64_t num_col = matrix->Info().num_col_; + CHECK_LE(num_col, static_cast(std::numeric_limits::max())) + << "Unfortunately, XGBoost does not support data matrices with " + << std::numeric_limits::max() << " features or greater"; + num_feature = std::max(num_feature, static_cast(num_col)); } // run allreduce on num_feature to find the maximum value rabit::Allreduce(&num_feature, 1);