Skip to content

Commit

Permalink
wrap plugin calls into federated
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyueXu77 committed Aug 1, 2024
1 parent aa5b51b commit 7480ed3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tree/gpu_hist/histogram.cu
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ void DeviceHistogramBuilder::BuildHistogram(Context const* ctx,
this->p_impl_->BuildHistogram(ctx->CUDACtx(), matrix, feature_groups,
gpair, ridx, histogram, rounding);
} else {
#if defined(XGBOOST_USE_FEDERATED)
// Encrypted vertical, build histogram using federated plugin
auto const &comm = collective::GlobalCommGroup()->Ctx(ctx, DeviceOrd::CPU());
auto const &fed = dynamic_cast<collective::FederatedComm const &>(comm);
Expand Down Expand Up @@ -480,6 +481,9 @@ void DeviceHistogramBuilder::BuildHistogram(Context const* ctx,
dh::safe_cuda(cudaMemcpyAsync(histogram.data(), host_histogram.data(),
histogram.size() * sizeof(GradientPairInt64),
cudaMemcpyHostToDevice));
#else
LOG(FATAL) << error::NoFederated();
#endif
}
}
} // namespace xgboost::tree

0 comments on commit 7480ed3

Please sign in to comment.