[GPU-Plugin] Multi-GPU gpu_id bug fixes for grow_gpu_hist and grow_gpu methods, and additional documentation for the gpu plugin. (#2463)
This commit is contained in:
committed by
Rory Mitchell
parent
91dae84a00
commit
6b287177c8
@@ -157,11 +157,11 @@ class ColMaker: public TreeUpdater {
|
||||
feat_index.push_back(i);
|
||||
}
|
||||
}
|
||||
unsigned n = static_cast<unsigned>(param.colsample_bytree * feat_index.size());
|
||||
unsigned n = std::max(static_cast<unsigned>(1),
|
||||
static_cast<unsigned>(param.colsample_bytree * feat_index.size()));
|
||||
std::shuffle(feat_index.begin(), feat_index.end(), common::GlobalRandom());
|
||||
CHECK_GT(n, 0U)
|
||||
<< "colsample_bytree=" << param.colsample_bytree
|
||||
<< " is too small that no feature can be included";
|
||||
CHECK_GT(param.colsample_bytree, 0U)
|
||||
<< "colsample_bytree cannot be zero.";
|
||||
feat_index.resize(n);
|
||||
}
|
||||
{
|
||||
@@ -627,9 +627,10 @@ class ColMaker: public TreeUpdater {
|
||||
std::vector<bst_uint> feat_set = feat_index;
|
||||
if (param.colsample_bylevel != 1.0f) {
|
||||
std::shuffle(feat_set.begin(), feat_set.end(), common::GlobalRandom());
|
||||
unsigned n = static_cast<unsigned>(param.colsample_bylevel * feat_index.size());
|
||||
CHECK_GT(n, 0U)
|
||||
<< "colsample_bylevel is too small that no feature can be included";
|
||||
unsigned n = std::max(static_cast<unsigned>(1),
|
||||
static_cast<unsigned>(param.colsample_bylevel * feat_index.size()));
|
||||
CHECK_GT(param.colsample_bylevel, 0U)
|
||||
<< "colsample_bylevel cannot be zero.";
|
||||
feat_set.resize(n);
|
||||
}
|
||||
dmlc::DataIter<ColBatch>* iter = p_fmat->ColIterator(feat_set);
|
||||
|
||||
@@ -409,11 +409,11 @@ class FastHistMaker: public TreeUpdater {
|
||||
feat_index.push_back(i);
|
||||
}
|
||||
}
|
||||
unsigned n = static_cast<unsigned>(param.colsample_bytree * feat_index.size());
|
||||
unsigned n = std::max(static_cast<unsigned>(1),
|
||||
static_cast<unsigned>(param.colsample_bytree * feat_index.size()));
|
||||
std::shuffle(feat_index.begin(), feat_index.end(), common::GlobalRandom());
|
||||
CHECK_GT(n, 0U)
|
||||
<< "colsample_bytree=" << param.colsample_bytree
|
||||
<< " is too small that no feature can be included";
|
||||
CHECK_GT(param.colsample_bytree, 0U)
|
||||
<< "colsample_bytree cannot be zero.";
|
||||
feat_index.resize(n);
|
||||
}
|
||||
if (data_layout_ == kDenseDataZeroBased || data_layout_ == kDenseDataOneBased) {
|
||||
|
||||
Reference in New Issue
Block a user