Skip to content

Commit

Permalink
fix fp64 support determination
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Razdoburdin committed Jun 10, 2024
1 parent 877bc96 commit ceeb00e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion plugin/sycl/tree/updater_quantile_hist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ DMLC_REGISTER_PARAMETER(HistMakerTrainParam);
void QuantileHistMaker::Configure(const Args& args) {
const DeviceOrd device_spec = ctx_->Device();
qu_ = device_manager.GetQueue(device_spec);

// initialize pruner
if (!pruner_) {
pruner_.reset(TreeUpdater::Create("prune", ctx_, task_));
Expand All @@ -37,6 +36,16 @@ void QuantileHistMaker::Configure(const Args& args) {

param_.UpdateAllowUnknown(args);
hist_maker_param_.UpdateAllowUnknown(args);

bool has_fp64_support = qu_.get_device().has(::sycl::aspect::fp64);
if (hist_maker_param_.single_precision_histogram || !has_fp64_support) {
if (!hist_maker_param_.single_precision_histogram) {
LOG(WARNING) << "Target device doesn't support fp64, using single_precision_histogram=True";
}
hist_precision_ = HistPrecision::fp32;
} else {
hist_precision_ = HistPrecision::fp64;
}
}

template<typename GradientSumT>
Expand Down

0 comments on commit ceeb00e

Please sign in to comment.