File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -674,11 +674,15 @@ class LearnerImpl : public Learner {
674
674
inline void LazyInitModel () {
675
675
if (this ->ModelInitialized ()) return ;
676
676
// estimate feature bound
677
+ // TODO(hcho3): Change num_feature to 64-bit integer
677
678
unsigned num_feature = 0 ;
678
679
for (auto & matrix : cache_) {
679
680
CHECK (matrix != nullptr );
680
- num_feature = std::max (num_feature,
681
- static_cast <unsigned >(matrix->Info ().num_col_ ));
681
+ const uint64_t num_col = matrix->Info ().num_col_ ;
682
+ CHECK_LE (num_col, static_cast <uint64_t >(std::numeric_limits<unsigned >::max ()))
683
+ << " Unfortunately, XGBoost does not support data matrices with "
684
+ << std::numeric_limits<unsigned >::max () << " features or greater" ;
685
+ num_feature = std::max (num_feature, static_cast <unsigned >(num_col));
682
686
}
683
687
// run allreduce on num_feature to find the maximum value
684
688
rabit::Allreduce<rabit::op::Max>(&num_feature, 1 );
You can’t perform that action at this time.
0 commit comments