Add warnings for large labels when using GPU histogram algorithms (#2834)

This commit is contained in:
Rory Mitchell
2017-10-26 17:31:10 +13:00
committed by GitHub
parent 13e7a2cff0
commit d9d5293cdb
5 changed files with 51 additions and 23 deletions

View File

@@ -171,19 +171,19 @@ class bst_gpair_internal {
template<>
inline XGBOOST_DEVICE float bst_gpair_internal<int64_t>::GetGrad() const {
return grad_ * 1e-5f;
return grad_ * 1e-4f;
}
template<>
inline XGBOOST_DEVICE float bst_gpair_internal<int64_t>::GetHess() const {
return hess_ * 1e-5f;
return hess_ * 1e-4f;
}
template<>
inline XGBOOST_DEVICE void bst_gpair_internal<int64_t>::SetGrad(float g) {
grad_ = static_cast<int64_t>(std::round(g * 1e5));
grad_ = static_cast<int64_t>(std::round(g * 1e4));
}
template<>
inline XGBOOST_DEVICE void bst_gpair_internal<int64_t>::SetHess(float h) {
hess_ = static_cast<int64_t>(std::round(h * 1e5));
hess_ = static_cast<int64_t>(std::round(h * 1e4));
}
} // namespace detail
@@ -194,10 +194,10 @@ typedef detail::bst_gpair_internal<float> bst_gpair;
/*! \brief High precision gradient statistics pair */
typedef detail::bst_gpair_internal<double> bst_gpair_precise;
/*! \brief High precision gradient statistics pair with integer backed
* storage. Operators are associative where floating point versions are not
* associative. */
typedef detail::bst_gpair_internal<int64_t> bst_gpair_integer;
/*! \brief High precision gradient statistics pair with integer backed
* storage. Operators are associative where floating point versions are not
* associative. */
typedef detail::bst_gpair_internal<int64_t> bst_gpair_integer;
/*! \brief small eps gap for minimum split decision. */
const bst_float rt_eps = 1e-6f;