1
1
/* *
2
- * Copyright 2020-2024 , XGBoost Contributors
2
+ * Copyright 2020-2025 , XGBoost Contributors
3
3
*/
4
4
#include < thrust/binary_search.h>
5
5
#include < thrust/execution_policy.h>
@@ -565,6 +565,8 @@ void SketchContainer::AllReduce(Context const* ctx, bool is_column_split) {
565
565
allworkers.emplace_back (sketch);
566
566
offset += length_as_bytes;
567
567
}
568
+ // Stop the timer early to avoid interference from the new sketch container.
569
+ timer_.Stop (__func__);
568
570
569
571
// Merge them into a new sketch.
570
572
SketchContainer new_sketch (this ->feature_types_ , num_bins_, this ->num_columns_ , global_sum_rows,
@@ -578,7 +580,6 @@ void SketchContainer::AllReduce(Context const* ctx, bool is_column_split) {
578
580
}
579
581
580
582
*this = std::move (new_sketch);
581
- timer_.Stop (__func__);
582
583
}
583
584
584
585
namespace {
@@ -595,13 +596,13 @@ struct InvalidCatOp {
595
596
} // anonymous namespace
596
597
597
598
void SketchContainer::MakeCuts (Context const * ctx, HistogramCuts* p_cuts, bool is_column_split) {
598
- timer_.Start (__func__);
599
599
curt::SetDevice (ctx->Ordinal ());
600
600
p_cuts->min_vals_ .Resize (num_columns_);
601
601
602
602
// Sync between workers.
603
603
this ->AllReduce (ctx, is_column_split);
604
604
605
+ timer_.Start (__func__);
605
606
// Prune to final number of bins.
606
607
this ->Prune (ctx, num_bins_ + 1 );
607
608
this ->FixError ();
0 commit comments