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

Update MurmurHash3_x64_128 to use the cuco equivalent implementation #17457

Merged

Conversation

PointKernel
Copy link
Member

Description

This PR modifies MurmurHash3_x64_128 to utilize the cuco equivalent implementation, eliminating duplication.

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. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Nov 26, 2024
@PointKernel PointKernel self-assigned this Nov 26, 2024
@PointKernel PointKernel requested a review from a team as a code owner November 26, 2024 21:53
template <typename Key>
struct MurmurHash3_x64_128 {
using result_type = thrust::pair<uint64_t, uint64_t>;
using result_type = cuda::std::array<uint64_t, 2>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any benefit from this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

cuda::std::array is the proper type.

In the original implementation, the output was an array of two elements. Since cuda::std::array was not available when the hasher was introduced into libcudf, we used thrust::pair instead. Looking ahead, if we adopt more 128-bit hashers where the return type could consist of four 32-bit integers, cuda::std::array would still be a suitable choice, whereas thrust::pair would not.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

One suggestion otherwise LGTM.

cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh Outdated Show resolved Hide resolved
@PointKernel PointKernel added the cuco cuCollections related issue label Dec 2, 2024
@PointKernel
Copy link
Member Author

/merge

@rapids-bot rapids-bot bot merged commit b67c0a9 into rapidsai:branch-25.02 Dec 3, 2024
106 checks passed
@PointKernel PointKernel deleted the cleanup-murmurhash-128 branch December 3, 2024 00:05
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 cuco cuCollections related issue 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.

5 participants