From 1de34e7a814a5fd89cbef218c6ad8d2a9dadf978 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Tue, 28 Feb 2023 11:50:11 -0500 Subject: [PATCH 1/3] Fix cudf::hash_partition kernel launch error with decimal128 types --- cpp/src/partitioning/partitioning.cu | 12 ++++++++++-- cpp/tests/partitioning/hash_partition_test.cpp | 14 +++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/cpp/src/partitioning/partitioning.cu b/cpp/src/partitioning/partitioning.cu index edf5d6d6612..3d031e25ae1 100644 --- a/cpp/src/partitioning/partitioning.cu +++ b/cpp/src/partitioning/partitioning.cu @@ -389,7 +389,15 @@ rmm::device_uvector compute_gather_map(size_type num_rows, } struct copy_block_partitions_dispatcher { - template ()>* = nullptr> + template + constexpr static bool is_copy_block_supported() + { + // The shared-memory used for fixed-width types in the copy_block_partitions_impl function + // will be too large for any DataType greater than int64_t. + return is_fixed_width() && (sizeof(DataType) <= sizeof(int64_t)); + } + + template ()>* = nullptr> std::unique_ptr operator()(column_view const& input, const size_type num_partitions, size_type const* row_partition_numbers, @@ -416,7 +424,7 @@ struct copy_block_partitions_dispatcher { return std::make_unique(input.type(), input.size(), std::move(output)); } - template ()>* = nullptr> + template ()>* = nullptr> std::unique_ptr operator()(column_view const& input, const size_type num_partitions, size_type const* row_partition_numbers, diff --git a/cpp/tests/partitioning/hash_partition_test.cpp b/cpp/tests/partitioning/hash_partition_test.cpp index 7731ad815d2..9d206c5397d 100644 --- a/cpp/tests/partitioning/hash_partition_test.cpp +++ b/cpp/tests/partitioning/hash_partition_test.cpp @@ -349,21 +349,21 @@ TEST_F(HashPartition, FixedPointColumnsToHash) { fixed_width_column_wrapper to_hash({1}); cudf::test::fixed_point_column_wrapper first_col({7}, numeric::scale_type{-1}); + cudf::test::fixed_point_column_wrapper<__int128_t> second_col({77}, numeric::scale_type{0}); - auto first_input = cudf::table_view({to_hash, first_col}); + auto input = cudf::table_view({to_hash, first_col, second_col}); auto columns_to_hash = std::vector({0}); cudf::size_type const num_partitions = 1; - auto [first_result, first_offsets] = - cudf::hash_partition(first_input, columns_to_hash, num_partitions); + auto [result, offsets] = cudf::hash_partition(input, columns_to_hash, num_partitions); // Expect offsets to be equal and num_partitions in length - EXPECT_EQ(static_cast(num_partitions), first_offsets.size()); - - CUDF_TEST_EXPECT_COLUMNS_EQUAL(first_result->get_column(0).view(), first_input.column(0)); + EXPECT_EQ(static_cast(num_partitions), offsets.size()); - CUDF_TEST_EXPECT_COLUMNS_EQUAL(first_result->get_column(1).view(), first_input.column(1)); + CUDF_TEST_EXPECT_COLUMNS_EQUAL(result->get_column(0).view(), input.column(0)); + CUDF_TEST_EXPECT_COLUMNS_EQUAL(result->get_column(1).view(), input.column(1)); + CUDF_TEST_EXPECT_COLUMNS_EQUAL(result->get_column(2).view(), input.column(2)); } TEST_F(HashPartition, ListWithNulls) From d79571c521a4e3cdac7339f47edfe880590dbb5a Mon Sep 17 00:00:00 2001 From: David Wendt Date: Tue, 28 Feb 2023 13:49:24 -0500 Subject: [PATCH 2/3] minor fixes to include stmts --- cpp/src/partitioning/partitioning.cu | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cpp/src/partitioning/partitioning.cu b/cpp/src/partitioning/partitioning.cu index 3d031e25ae1..f7fe4976081 100644 --- a/cpp/src/partitioning/partitioning.cu +++ b/cpp/src/partitioning/partitioning.cu @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include #include @@ -36,6 +35,9 @@ #include #include +#include +#include + namespace cudf { namespace { // Launch configuration for optimized hash partition @@ -721,7 +723,7 @@ struct dispatch_map_type { } // namespace namespace detail { -namespace local { +namespace { template