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

Patch CUB DeviceSegmentedSort and remove workaround #12234

Merged
merged 4 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/dependencies/cub/cub/agent/agent_sub_warp_merge_sort.cuh b/dependencies/cub/cub/agent/agent_sub_warp_merge_sort.cuh
index ad65f2a3..ad45a21e 100644
--- a/dependencies/cub/cub/agent/agent_sub_warp_merge_sort.cuh
+++ b/dependencies/cub/cub/agent/agent_sub_warp_merge_sort.cuh
@@ -221,7 +221,8 @@ public:
using UnsignedBitsT = typename Traits<KeyT>::UnsignedBits;
UnsignedBitsT default_key_bits = IS_DESCENDING ? Traits<KeyT>::LOWEST_KEY
: Traits<KeyT>::MAX_KEY;
- KeyT oob_default = reinterpret_cast<KeyT &>(default_key_bits);
+ KeyT oob_default = std::is_same_v<KeyT, bool> ? !IS_DESCENDING
+ : reinterpret_cast<KeyT &>(default_key_bits);

WarpLoadKeysT(storage.load_keys)
.Load(keys_input, keys, segment_size, oob_default);
5 changes: 5 additions & 0 deletions cpp/cmake/thirdparty/patches/thrust_override.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
"file" : "${current_json_dir}/thrust_faster_scan_compile_times.diff",
"issue" : "Improve Thrust scan compile times by reducing the number of kernels generated [https://github.com/rapidsai/cudf/pull/8183]",
"fixed_in" : ""
},
{
"file" : "${current_json_dir}/cub_segmented_sort_with_bool_key.diff",
"issue" : "Fix an error in CUB DeviceSegmentedSort when the keys are bool type [https://github.com/NVIDIA/cub/issues/594]",
"fixed_in" : "2.1"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/sort/segmented_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct column_fast_sort_fn {
static bool is_fast_sort_supported(column_view const& col)
{
return !col.has_nulls() and
((cudf::is_integral(col.type()) && !cudf::is_boolean(col.type())) ||
(cudf::is_integral(col.type()) ||
(cudf::is_fixed_point(col.type()) and (col.type().id() != type_id::DECIMAL128)));
}

Expand Down