Replace hash join internals with HashCSR - #23640
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Performance results: |
| auto const rank = slot_count_ref.fetch_add(size_type{1}, cuda::memory_order_relaxed); | ||
| build_positions[index] = {slot, rank}; |
There was a problem hiding this comment.
This, storing rank AOT, is a nice optimization the original implementation did not have! :)
| probe_slots[index] = found ? static_cast<size_type>(slot) : CUDF_SIZE_TYPE_SENTINEL; | ||
| } | ||
| if (match_counts != nullptr) { | ||
| match_counts[index] = IsOuter ? cuda::std::max(count, size_type{1}) : count; |
There was a problem hiding this comment.
I think this should be IsOuterOrLeft ?
There was a problem hiding this comment.
An outer join is any LEFT, RIGHT, or FULL OUTER JOIN, as opposed to an INNER JOIN. As we don't support right join in cudf. IsOuter is accurate. Make sense to you?
| if (found && matched_slots != nullptr) { | ||
| auto matched_slot_ref = | ||
| cuda::atomic_ref<std::uint32_t, cuda::thread_scope_device>{matched_slots[slot]}; | ||
| auto expected = std::uint32_t{0}; | ||
| if (matched_slot_ref.compare_exchange_strong( | ||
| expected, std::uint32_t{1}, cuda::memory_order_relaxed)) { | ||
| cuda::atomic_ref<unsigned long long, cuda::thread_scope_device>{*matched_build_rows} | ||
| .fetch_add(static_cast<unsigned long long>(count), cuda::memory_order_relaxed); | ||
| } | ||
| } |
There was a problem hiding this comment.
I'm a bit confused by this. Some comments could help with it. Is this implementing the right/outer join matching array we discussed?
| } | ||
|
|
||
| template <bool IsOuter> | ||
| CUDF_KERNEL void hash_csr_retrieve_kernel(std::int64_t output_size, |
There was a problem hiding this comment.
I don't see the logic for handling right/outer joins emission here. Is the IsOuter flag only for left joins for now?
There was a problem hiding this comment.
It's for both left and full join.
Description
TBD
Following the design proposed by @rootjalex
Checklist