-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change type for GradStats to avoid conversion for hist method #5523
Conversation
I don't think we can simply merge this PR. I did some experiments with One suggestion is to use You can check my implementation here: #5460 |
0438212
to
36e0034
Compare
src/common/hist_util.h
Outdated
@@ -407,7 +407,60 @@ class GHistIndexBlockMatrix { | |||
* for that particular bin | |||
* Uses global bin id so as to represent all features simultaneously | |||
*/ | |||
using GHistRow = Span<tree::GradStats>; | |||
|
|||
struct GradStatHist { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will stop you from continuing the process. ;-) Please avoid copying code, use template instead if applicable. Also why not GradientPair
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GradientPair
was used. Thanks :)
69ec691
to
db311a5
Compare
@trivialfis sorry, not clearly why I have error: Local lint checks for changed files were successful. |
d434bb9
to
ddb786b
Compare
3ba5362
to
6793b03
Compare
6793b03
to
fa09751
Compare
@ShvetsKS, @trivialfis, Current XGB GPU impl has |
Sounds good to me. On GPU the difference is very noticeable. |
@trivialfis, thank you. |
Optional single precision support is a great idea. |
@SmirnovEgorRu to be honest I expected the request of this changes :) |
This PR is supposed to change internal type of GradStats to avoid conversion for hist method. Also bug related to numerical instability in
NeedReplace
method.Accuracy ~ the same as was with double type, and ex. for mnist data set was even improved:
Similar changes were provided in PR:#4529 but full scope of changes was reverted in #5008.
Performance improvements (1.5x for BuildHist):