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

Use batched copy if. #6826

Merged
merged 1 commit into from Apr 6, 2021
Merged

Use batched copy if. #6826

merged 1 commit into from Apr 6, 2021

Conversation

trivialfis
Copy link
Member

Close #6822 .

@trivialfis trivialfis mentioned this pull request Apr 6, 2021
8 tasks
@trivialfis trivialfis merged commit 7bcc8b3 into dmlc:master Apr 6, 2021
@trivialfis trivialfis deleted the fix-large-data branch April 6, 2021 02:34
void CopyIf(InIt in_first, InIt in_second, OutIt out_first, Predicate pred) {
// We loop over batches because thrust::copy_if cant deal with sizes > 2^31
// See thrust issue #1302, #6822
size_t max_copy_size = std::numeric_limits<int>::max() / 2;

Choose a reason for hiding this comment

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

Not sure what standard current compiler supports, but this can be a 'constexpr', since max is. See example:

https://en.cppreference.com/w/cpp/language/constant_expression

Choose a reason for hiding this comment

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

I see "XGBoost now adopts the C++14 standard", it should be allowed.

Copy link
Member Author

Choose a reason for hiding this comment

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

@vkuzmin-uber Thanks for the review, I will open another PR for constexpr. Most of the time the compiler should be able to eliminate these constants automatically so did not pay enough attention to it, thanks for pointing it out.

Copy link

@vkuzmin-uber vkuzmin-uber left a comment

Choose a reason for hiding this comment

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

I see it is merged already. Leave comment just in case - constexpr for expressions like this makes sense

trivialfis added a commit to trivialfis/xgboost that referenced this pull request Apr 6, 2021
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.

[Bug] DeviceQuantileDmatrix failing with memory errors on A100-80GB
3 participants