Skip to content

Commit

Permalink
Use stream allocator adaptor for hash join table (#9704)
Browse files Browse the repository at this point in the history
Depends on NVIDIA/cuCollections#119

This PR replaces the default hash join allocator with the corresponding `rmm::mr::stream_allocator_adaptor`. It accommodates new `cuco::allocator` APIs that don't take stream as input argument.

Authors:
  - Yunsong Wang (https://github.com/PointKernel)

Approvers:
  - Karthikeyan (https://github.com/karthikeyann)
  - Mark Harris (https://github.com/harrism)

URL: #9704
  • Loading branch information
PointKernel authored Dec 6, 2021
1 parent 8002cbd commit 3b93f5c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cpp/cmake/thirdparty/get_cucollections.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function(find_and_configure_cucollections)
cuco 0.0
GLOBAL_TARGETS cuco::cuco
CPM_ARGS GITHUB_REPOSITORY NVIDIA/cuCollections
GIT_TAG f0eecb203590f1f4ac4a9f1700229f4434ac64dc
GIT_TAG 6433e8ad7571f14cc5384051b049029c60dd1ce0
OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF"
)

Expand Down
3 changes: 2 additions & 1 deletion cpp/src/join/hash_join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ hash_join::hash_join_impl::hash_join_impl(cudf::table_view const& build,
_hash_table{compute_hash_table_size(build.num_rows()),
std::numeric_limits<hash_value_type>::max(),
cudf::detail::JoinNoneValue,
stream.value()}
stream.value(),
detail::hash_table_allocator_type{default_allocator<char>{}, stream}}
{
CUDF_FUNC_RANGE();
CUDF_EXPECTS(0 != build.num_columns(), "Hash join build table is empty");
Expand Down
10 changes: 8 additions & 2 deletions cpp/src/join/join_common_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
*/
#pragma once

#include <cudf/detail/utilities/device_atomics.cuh>
#include <cudf/detail/utilities/hash_functions.cuh>
#include <cudf/table/row_operators.cuh>
#include <cudf/table/table_view.hpp>

#include <hash/concurrent_unordered_multimap.cuh>
#include <hash/hash_allocator.cuh>
#include <hash/helper_functions.cuh>

#include <rmm/mr/device/polymorphic_allocator.hpp>

#include <cuco/static_multimap.cuh>

Expand All @@ -38,11 +42,13 @@ using pair_type = cuco::pair_type<hash_value_type, size_type>;

using hash_type = cuco::detail::MurmurHash3_32<hash_value_type>;

using hash_table_allocator_type = rmm::mr::stream_allocator_adaptor<default_allocator<char>>;

using multimap_type =
cuco::static_multimap<hash_value_type,
size_type,
cuda::thread_scope_device,
default_allocator<char>,
hash_table_allocator_type,
cuco::double_hashing<DEFAULT_JOIN_CG_SIZE, hash_type, hash_type>>;

using row_hash = cudf::row_hasher<default_hash, cudf::nullate::YES>;
Expand Down

0 comments on commit 3b93f5c

Please sign in to comment.