Document current limitation in number of features (#3886)
This commit is contained in:
parent
828d75714d
commit
e38d5a6831
@ -674,11 +674,15 @@ class LearnerImpl : public Learner {
|
|||||||
inline void LazyInitModel() {
|
inline void LazyInitModel() {
|
||||||
if (this->ModelInitialized()) return;
|
if (this->ModelInitialized()) return;
|
||||||
// estimate feature bound
|
// estimate feature bound
|
||||||
|
// TODO(hcho3): Change num_feature to 64-bit integer
|
||||||
unsigned num_feature = 0;
|
unsigned num_feature = 0;
|
||||||
for (auto & matrix : cache_) {
|
for (auto & matrix : cache_) {
|
||||||
CHECK(matrix != nullptr);
|
CHECK(matrix != nullptr);
|
||||||
num_feature = std::max(num_feature,
|
const uint64_t num_col = matrix->Info().num_col_;
|
||||||
static_cast<unsigned>(matrix->Info().num_col_));
|
CHECK_LE(num_col, static_cast<uint64_t>(std::numeric_limits<unsigned>::max()))
|
||||||
|
<< "Unfortunately, XGBoost does not support data matrices with "
|
||||||
|
<< std::numeric_limits<unsigned>::max() << " features or greater";
|
||||||
|
num_feature = std::max(num_feature, static_cast<unsigned>(num_col));
|
||||||
}
|
}
|
||||||
// run allreduce on num_feature to find the maximum value
|
// run allreduce on num_feature to find the maximum value
|
||||||
rabit::Allreduce<rabit::op::Max>(&num_feature, 1);
|
rabit::Allreduce<rabit::op::Max>(&num_feature, 1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user