diff --git a/src/common/quantile.cc b/src/common/quantile.cc index 602073428eb1..901b1f50de21 100644 --- a/src/common/quantile.cc +++ b/src/common/quantile.cc @@ -496,50 +496,6 @@ void SketchContainerImpl::MakeCuts(Context const *ctx, MetaInfo const p_cuts->cut_ptrs_.HostVector().push_back(cut_size); } - -/* - // save the cut values and cut pointers to files for examination - if (collective::GetRank() == 0) { - //print the entries to file for debug - std::ofstream file; - file.open("cut_info_0.txt", std::ios_base::app); - file << " Total cut ptr count: " << p_cuts->cut_ptrs_.HostVector().size() << std::endl; - file << " Total cut count: " << p_cuts->cut_values_.HostVector().size() << std::endl; - //iterate through the cut pointers - for (auto i = 0; i < p_cuts->cut_ptrs_.HostVector().size(); i++) { - file << "cut_ptr " << i << ": " << p_cuts->cut_ptrs_.HostVector()[i] << std::endl; - } - //iterate through the cut values - for (auto i = 0; i < p_cuts->cut_values_.HostVector().size(); i++) { - file << "cut_value " << i << ": " << p_cuts->cut_values_.HostVector()[i] << std::endl; - } - file.close(); - } - if (collective::GetRank() == 1) { - //print the entries to file for debug - std::ofstream file; - file.open("cut_info_1.txt", std::ios_base::app); - file << " Total cut ptr count: " << p_cuts->cut_ptrs_.HostVector().size() << std::endl; - file << " Total cut count: " << p_cuts->cut_values_.HostVector().size() << std::endl; - //iterate through the cut pointers - for (auto i = 0; i < p_cuts->cut_ptrs_.HostVector().size(); i++) { - file << "cut_ptr " << i << ": " << p_cuts->cut_ptrs_.HostVector()[i] << std::endl; - } - //iterate through the cut values - for (auto i = 0; i < p_cuts->cut_values_.HostVector().size(); i++) { - file << "cut_value " << i << ": " << p_cuts->cut_values_.HostVector()[i] << std::endl; - } - file.close(); - } - - if (info.IsVerticalFederated() && info.IsSecure()) { - // cut values need to be synced across all workers via Allreduce - auto cut_val = p_cuts->cut_values_.HostVector().data(); - std::size_t n = p_cuts->cut_values_.HostVector().size(); - collective::Allreduce(cut_val, n); - } - */ - p_cuts->SetCategorical(this->has_categorical_, max_cat); monitor_.Stop(__func__); } diff --git a/src/learner.cc b/src/learner.cc index d3b3a9bfc607..c2ad13d4e5ab 100644 --- a/src/learner.cc +++ b/src/learner.cc @@ -1286,44 +1286,6 @@ class LearnerImpl : public LearnerIO { GetGradient(predt.predictions, train->Info(), iter, &gpair_); monitor_.Stop("GetGradient"); - -/* - if(collective::GetRank()==0){ - //print the total number of samples - std::cout << "Total number of samples: " << train->Info().labels.Size() << std::endl; - auto i = 0; - // print the first five predictions - for (auto p : predt.predictions.HostVector()) { - std::cout << "Prediction " << i << ": " << p << std::endl; - i++; - if (i == 5) { - break; - } - } - - // print the first five labels - std::cout << "Labels: " << std::endl; - i = 0; - while ( i<5 ) { - std::cout << "Label " << i << ": " << train->Info().labels.HostView()(i) << std::endl; - i++; - } - - // print the first five gradients - std::cout << "Gradients: " << std::endl; - i = 0; - for (auto p : gpair_.Data()->HostVector()) { - std::cout << "Gradient " << i << ": " << p.GetGrad() << std::endl; - i++; - if (i == 5) { - break; - } - } - } -*/ - - - TrainingObserver::Instance().Observe(*gpair_.Data(), "Gradients"); gbm_->DoBoost(train.get(), &gpair_, &predt, obj_.get());