diff --git a/plugin/sycl/tree/updater_quantile_hist.cc b/plugin/sycl/tree/updater_quantile_hist.cc index b3128430531c..e49d5a49f1d1 100644 --- a/plugin/sycl/tree/updater_quantile_hist.cc +++ b/plugin/sycl/tree/updater_quantile_hist.cc @@ -12,10 +12,7 @@ #include -#include "xgboost/logging.h" - #include "updater_quantile_hist.h" -#include "../data.h" namespace xgboost { namespace sycl { @@ -64,9 +61,12 @@ void QuantileHistMaker::CallUpdate( xgboost::common::Span> out_position, const std::vector &trees) { const std::vector& gpair_h = gpair->ConstHostVector(); - USMVector gpair_device(&qu_, gpair_h); + gpair_device_.Resize(&qu_, gpair_h.size()); + qu_.memcpy(gpair_device_.Data(), gpair_h.data(), gpair_h.size() * sizeof(GradientPair)); + qu_.wait(); + for (auto tree : trees) { - pimpl->Update(ctx_, param, gmat_, gpair, gpair_device, dmat, out_position, tree); + pimpl->Update(ctx_, param, gmat_, gpair, gpair_device_, dmat, out_position, tree); } } diff --git a/plugin/sycl/tree/updater_quantile_hist.h b/plugin/sycl/tree/updater_quantile_hist.h index 0e48a7eb6372..e26751617830 100644 --- a/plugin/sycl/tree/updater_quantile_hist.h +++ b/plugin/sycl/tree/updater_quantile_hist.h @@ -55,23 +55,9 @@ class QuantileHistMaker: public TreeUpdater { void LoadConfig(Json const& in) override { auto const& config = get(in); FromJson(config.at("train_param"), &this->param_); - try { - FromJson(config.at("sycl_hist_train_param"), &this->hist_maker_param_); - } catch (std::out_of_range& e) { - // XGBoost model is from 1.1.x, so 'cpu_hist_train_param' is missing. - // We add this compatibility check because it's just recently that we (developers) began - // persuade R users away from using saveRDS() for model serialization. Hopefully, one day, - // everyone will be using xgb.save(). - LOG(WARNING) << "Attempted to load interal configuration for a model file that was generated " - << "by a previous version of XGBoost. A likely cause for this warning is that the model " - << "was saved with saveRDS() in R or pickle.dump() in Python. We strongly ADVISE AGAINST " - << "using saveRDS() or pickle.dump() so that the model remains accessible in current and " - << "upcoming XGBoost releases. Please use xgb.save() instead to preserve models for the " - << "long term. For more details and explanation, see " - << "https://xgboost.readthedocs.io/en/latest/tutorials/saving_model.html"; - this->hist_maker_param_.UpdateAllowUnknown(Args{}); - } + FromJson(config.at("sycl_hist_train_param"), &this->hist_maker_param_); } + void SaveConfig(Json* p_out) const override { auto& out = *p_out; out["train_param"] = ToJson(param_); @@ -116,6 +102,8 @@ class QuantileHistMaker: public TreeUpdater { ::sycl::queue qu_; DeviceManager device_manager; ObjInfo const *task_{nullptr}; + + USMVector gpair_device_; }; } // namespace tree