Skip to content

Commit add57f8

Browse files
authored
[backport] Delay the check for vector leaf. (dmlc#9509) (dmlc#9533)
1 parent a0d3573 commit add57f8

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/gbm/gbtree.cc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,6 @@ void GBTree::Configure(Args const& cfg) {
146146
if (specified_updater_) {
147147
error::WarnManualUpdater();
148148
}
149-
150-
if (model_.learner_model_param->IsVectorLeaf()) {
151-
CHECK(tparam_.tree_method == TreeMethod::kHist || tparam_.tree_method == TreeMethod::kAuto)
152-
<< "Only the hist tree method is supported for building multi-target trees with vector "
153-
"leaf.";
154-
CHECK(ctx_->IsCPU()) << "GPU is not yet supported for vector leaf.";
155-
}
156-
157149
LOG(DEBUG) << "Using tree method: " << static_cast<int>(tparam_.tree_method);
158150

159151
if (!specified_updater_) {
@@ -225,6 +217,13 @@ void GBTree::UpdateTreeLeaf(DMatrix const* p_fmat, HostDeviceVector<float> const
225217

226218
void GBTree::DoBoost(DMatrix* p_fmat, HostDeviceVector<GradientPair>* in_gpair,
227219
PredictionCacheEntry* predt, ObjFunction const* obj) {
220+
if (model_.learner_model_param->IsVectorLeaf()) {
221+
CHECK(tparam_.tree_method == TreeMethod::kHist || tparam_.tree_method == TreeMethod::kAuto)
222+
<< "Only the hist tree method is supported for building multi-target trees with vector "
223+
"leaf.";
224+
CHECK(ctx_->IsCPU()) << "GPU is not yet supported for vector leaf.";
225+
}
226+
228227
TreesOneIter new_trees;
229228
bst_target_t const n_groups = model_.learner_model_param->OutputLength();
230229
monitor_.Start("BoostNewTrees");

0 commit comments

Comments
 (0)