Skip to content
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

Fix GPU RF #6755

Merged
merged 3 commits into from Mar 16, 2021
Merged

Fix GPU RF #6755

merged 3 commits into from Mar 16, 2021

Conversation

trivialfis
Copy link
Member

Close #6754 .

Fix by copying out the gradient before sampling.

@trivialfis trivialfis requested a review from hcho3 March 16, 2021 20:58
thrust::copy(thrust::device, dh_gpair->ConstDevicePointer(),
dh_gpair->ConstDevicePointer() + dh_gpair->Size(),
d_gpair.begin());
auto sample = sampler->Sample(dh::ToSpan(d_gpair), dmat);
Copy link
Collaborator

@hcho3 hcho3 Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to make a copy here since Sample() is expected to modify the incoming gpair parameter? Mutating gpairs would be bad when we fit multiple trees in a single round, and this fix would make sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify the incoming gpair parameter?

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks guys!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix confirmed. Thanks.

pseudotensor added a commit to h2oai/xgboost that referenced this pull request Mar 16, 2021
@trivialfis trivialfis merged commit 4f75f51 into dmlc:master Mar 16, 2021
@trivialfis trivialfis deleted the fix-rf branch March 16, 2021 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XGBRFRegressor much worse for gpu_hist vs hist on small data
4 participants