@@ -85,11 +85,11 @@ void AssignNodes(RegTree const* p_tree, GradientQuantiser const* quantizer,
8585 auto right_sum = quantizer->ToFloatingPoint (e.split .right_sum );
8686 bool fewer_right = right_sum.GetHess () < left_sum.GetHess ();
8787 if (fewer_right) {
88- p_build_nidx[nidx_in_set] = tree.RightChild (e.nid );
89- p_sub_nidx[nidx_in_set] = tree.LeftChild (e.nid );
88+ p_build_nidx[nidx_in_set] = tree.RightChild (e.nidx );
89+ p_sub_nidx[nidx_in_set] = tree.LeftChild (e.nidx );
9090 } else {
91- p_build_nidx[nidx_in_set] = tree.LeftChild (e.nid );
92- p_sub_nidx[nidx_in_set] = tree.RightChild (e.nid );
91+ p_build_nidx[nidx_in_set] = tree.LeftChild (e.nidx );
92+ p_sub_nidx[nidx_in_set] = tree.RightChild (e.nidx );
9393 }
9494 ++nidx_in_set;
9595 }
@@ -132,13 +132,13 @@ struct GPUHistMakerDevice {
132132 auto tree = p_tree->HostScView ();
133133 for (std::size_t i = 0 , n = candidates.size (); i < n; i++) {
134134 auto const & e = candidates[i];
135- RegTree::Node split_node = tree.nodes [e.nid ];
136- auto split_type = tree.SplitType (e.nid );
137- nodes.nidx .at (i) = e.nid ;
138- nodes.left_nidx [i] = tree.LeftChild (e.nid );
139- nodes.right_nidx [i] = tree.RightChild (e.nid );
135+ RegTree::Node split_node = tree.nodes [e.nidx ];
136+ auto split_type = tree.SplitType (e.nidx );
137+ nodes.nidx .at (i) = e.nidx ;
138+ nodes.left_nidx [i] = tree.LeftChild (e.nidx );
139+ nodes.right_nidx [i] = tree.RightChild (e.nidx );
140140 nodes.split_data [i] =
141- NodeSplitData{split_node, split_type, this ->evaluator_ .GetDeviceNodeCats (e.nid )};
141+ NodeSplitData{split_node, split_type, this ->evaluator_ .GetDeviceNodeCats (e.nidx )};
142142
143143 CHECK_EQ (split_type == FeatureType::kCategorical , e.split .is_cat );
144144 }
@@ -299,8 +299,8 @@ struct GPUHistMakerDevice {
299299 auto sc_tree = tree.HostScView ();
300300 for (std::size_t i = 0 ; i < candidates.size (); i++) {
301301 auto candidate = candidates.at (i);
302- bst_node_t left_nidx = sc_tree.LeftChild (candidate.nid );
303- bst_node_t right_nidx = sc_tree.RightChild (candidate.nid );
302+ bst_node_t left_nidx = sc_tree.LeftChild (candidate.nidx );
303+ bst_node_t right_nidx = sc_tree.RightChild (candidate.nidx );
304304 nidx[i * 2 ] = left_nidx;
305305 nidx[i * 2 + 1 ] = right_nidx;
306306 auto left_sampled_features = column_sampler_->GetFeatureSet (tree.GetDepth (left_nidx));
@@ -482,7 +482,7 @@ struct GPUHistMakerDevice {
482482 bst_idx_t n_samples = 0 ;
483483 for (auto const & c : candidates) {
484484 for (auto const & part : this ->partitioners_ ) {
485- n_samples += part->GetRows (c.nid ).size ();
485+ n_samples += part->GetRows (c.nidx ).size ();
486486 }
487487 }
488488 // avoid copy if the kernel is small.
@@ -688,7 +688,7 @@ struct GPUHistMakerDevice {
688688
689689 // Sanity check - have we created a leaf with no training instances?
690690 if (!collective::IsDistributed () && partitioners_.size () == 1 ) {
691- CHECK (partitioners_.front ()->GetRows (candidate.nid ).size () > 0 )
691+ CHECK (partitioners_.front ()->GetRows (candidate.nidx ).size () > 0 )
692692 << " No training instances in this leaf!" ;
693693 }
694694
@@ -708,27 +708,27 @@ struct GPUHistMakerDevice {
708708 CHECK (common::CheckNAN (candidate.split .fvalue ));
709709 std::vector<common::CatBitField::value_type> split_cats;
710710
711- auto h_cats = this ->evaluator_ .GetHostNodeCats (candidate.nid );
711+ auto h_cats = this ->evaluator_ .GetHostNodeCats (candidate.nidx );
712712 auto n_bins_feature = cuts_->FeatureBins (candidate.split .findex );
713713 split_cats.resize (common::CatBitField::ComputeStorageSize (n_bins_feature), 0 );
714714 CHECK_LE (split_cats.size (), h_cats.size ());
715715 std::copy (h_cats.data (), h_cats.data () + split_cats.size (), split_cats.data ());
716716
717717 tree.ExpandCategorical (
718- candidate.nid , candidate.split .findex , split_cats, candidate.split .dir == kLeftDir ,
718+ candidate.nidx , candidate.split .findex , split_cats, candidate.split .dir == kLeftDir ,
719719 base_weight, left_weight, right_weight, candidate.split .loss_chg , parent_hess,
720720 left_hess, right_hess);
721721 } else {
722722 CHECK (!common::CheckNAN (candidate.split .fvalue ));
723- tree.ExpandNode (candidate.nid , candidate.split .findex , candidate.split .fvalue ,
723+ tree.ExpandNode (candidate.nidx , candidate.split .findex , candidate.split .fvalue ,
724724 candidate.split .dir == kLeftDir , base_weight, left_weight, right_weight,
725725 candidate.split .loss_chg , parent_hess,
726726 left_hess, right_hess);
727727 }
728728 evaluator_.ApplyTreeSplit (candidate, p_tree);
729729
730- const auto & parent = tree[candidate.nid ];
731- interaction_constraints.Split (candidate.nid , parent.SplitIndex (), parent.LeftChild (),
730+ const auto & parent = tree[candidate.nidx ];
731+ interaction_constraints.Split (candidate.nidx , parent.SplitIndex (), parent.LeftChild (),
732732 parent.RightChild ());
733733 }
734734
@@ -742,7 +742,7 @@ struct GPUHistMakerDevice {
742742 [=] __device__ (auto const & gpair) { return quantiser.ToFixedPoint (gpair); });
743743 GradientPairInt64 root_sum_quantised =
744744 dh::Reduce (ctx_->CUDACtx ()->CTP (), gpair_it, gpair_it + this ->gpair .size (),
745- GradientPairInt64{}, thrust ::plus<GradientPairInt64>{});
745+ GradientPairInt64{}, cuda::std ::plus<GradientPairInt64>{});
746746 using ReduceT = typename decltype (root_sum_quantised)::ValueT;
747747 auto rc = collective::GlobalSum (
748748 ctx_, p_fmat->Info (), linalg::MakeVec (reinterpret_cast <ReduceT*>(&root_sum_quantised), 2 ));
@@ -838,8 +838,6 @@ std::pair<std::shared_ptr<common::HistogramCuts const>, bool> InitBatchCuts(
838838}
839839
840840class GPUHistMaker : public TreeUpdater {
841- using GradientSumT = GradientPairPrecise;
842-
843841 public:
844842 explicit GPUHistMaker (Context const * ctx, ObjInfo const * task) : TreeUpdater(ctx), task_{task} {};
845843 void Configure (const Args& args) override {
0 commit comments