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

Add detail cuco_allocator #14877

Merged
merged 8 commits into from
Jan 30, 2024

Conversation

PointKernel
Copy link
Member

@PointKernel PointKernel commented Jan 25, 2024

Description

Surpass #14827

Related to #11176

This PR adds a new cudf::detail::cuco_allocator to deprecate and replace the old default_allocator in the global namespace. Following the comments in #14827 (review), the new cudf::detail::cuco_allocator class is moved to detail/cuco_helpers.cuh. Free functions in hashing/detail/helper_functions.cuh are left in the global namespace without changes due to the verbose nested namespace expression.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@PointKernel PointKernel added 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. tech debt improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jan 25, 2024
@PointKernel PointKernel requested review from vyasr and ttnghia January 25, 2024 02:52
@PointKernel PointKernel self-assigned this Jan 25, 2024
@PointKernel PointKernel requested a review from a team as a code owner January 25, 2024 02:52
@PointKernel
Copy link
Member Author

@vyasr @ttnghia requested your feedback since you reviewed the previous PR.

@PointKernel PointKernel requested a review from ttnghia January 26, 2024 20:13
@@ -117,7 +117,7 @@ template <typename Key,
typename Element,
typename Hasher = cudf::hashing::detail::default_hash<Key>,
typename Equality = equal_to<Key>,
typename Allocator = default_allocator<thrust::pair<Key, Element>>>
typename Allocator = rmm::mr::polymorphic_allocator<thrust::pair<Key, Element>>>
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this can't use the cuco_allocator because it needs to allocate in units that aren't just raw bytes, but instead based on the Key/Element pair size?

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly, cuco uses a trait internally to convert the given allocator to the desired type thus the input data type doesn't really matter. concurrent_unordered_map doesn't have this implemented thus we have to pass the proper type to make it work.

@PointKernel
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit 57bbe94 into rapidsai:branch-24.04 Jan 30, 2024
68 checks passed
@PointKernel PointKernel deleted the add-cuco-allocator branch January 30, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants