From 405133acb2f579b35d74f5ae8850180c67fad7b1 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Mon, 1 May 2023 15:45:14 -0700 Subject: [PATCH 1/6] Update cuco git tag --- cpp/cmake/thirdparty/get_cucollections.cmake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cpp/cmake/thirdparty/get_cucollections.cmake b/cpp/cmake/thirdparty/get_cucollections.cmake index 9758958b44f..bf31a379537 100644 --- a/cpp/cmake/thirdparty/get_cucollections.cmake +++ b/cpp/cmake/thirdparty/get_cucollections.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021-2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -14,12 +14,14 @@ # This function finds cuCollections and performs any additional configuration. function(find_and_configure_cucollections) - include(${rapids-cmake-dir}/cpm/cuco.cmake) - if(BUILD_SHARED_LIBS) - rapids_cpm_cuco(BUILD_EXPORT_SET cudf-exports) - else() - rapids_cpm_cuco(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports) - endif() + rapids_cpm_find( + cuco 0.0.1 + GLOBAL_TARGETS cuco::cuco + CPM_ARGS + GIT_REPOSITORY https://github.com/NVIDIA/cuCollections.git + GIT_TAG 1a841121d1a32b83c6de0ccccbcdf037790d61ad + OPTIONS "BUILD_TESTS OFF"  "BUILD_BENCHMARKS OFF"  "BUILD_EXAMPLES OFF" + ) endfunction() find_and_configure_cucollections() From 1f85bb4c99ca4ca520acaceee7d74f27f88194a1 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Tue, 9 May 2023 11:37:50 -0700 Subject: [PATCH 2/6] Move distinct_count benchmark to the proper folder --- cpp/benchmarks/CMakeLists.txt | 7 +++---- .../{reduction => stream_compaction}/distinct_count.cpp | 8 +++++--- 2 files changed, 8 insertions(+), 7 deletions(-) rename cpp/benchmarks/{reduction => stream_compaction}/distinct_count.cpp (88%) diff --git a/cpp/benchmarks/CMakeLists.txt b/cpp/benchmarks/CMakeLists.txt index 565a396d913..fc46b0da9fc 100644 --- a/cpp/benchmarks/CMakeLists.txt +++ b/cpp/benchmarks/CMakeLists.txt @@ -153,8 +153,8 @@ ConfigureBench(APPLY_BOOLEAN_MASK_BENCH stream_compaction/apply_boolean_mask.cpp # ################################################################################################## # * stream_compaction benchmark ------------------------------------------------------------------- ConfigureNVBench( - STREAM_COMPACTION_NVBENCH stream_compaction/distinct.cpp stream_compaction/unique.cpp - stream_compaction/unique_count.cpp + STREAM_COMPACTION_NVBENCH stream_compaction/distinct.cpp stream_compaction/distinct_count.cpp + stream_compaction/unique.cpp stream_compaction/unique_count.cpp ) # ################################################################################################## @@ -195,8 +195,7 @@ ConfigureBench( reduction/reduce.cpp reduction/scan.cpp ) ConfigureNVBench( - REDUCTION_NVBENCH reduction/distinct_count.cpp reduction/rank.cpp reduction/scan_structs.cpp - reduction/segmented_reduce.cpp + REDUCTION_NVBENCH reduction/rank.cpp reduction/scan_structs.cpp reduction/segmented_reduce.cpp ) # ################################################################################################## diff --git a/cpp/benchmarks/reduction/distinct_count.cpp b/cpp/benchmarks/stream_compaction/distinct_count.cpp similarity index 88% rename from cpp/benchmarks/reduction/distinct_count.cpp rename to cpp/benchmarks/stream_compaction/distinct_count.cpp index d2218c270a8..bb9458e3076 100644 --- a/cpp/benchmarks/reduction/distinct_count.cpp +++ b/cpp/benchmarks/stream_compaction/distinct_count.cpp @@ -15,7 +15,6 @@ */ #include -#include #include @@ -40,10 +39,13 @@ static void bench_reduction_distinct_count(nvbench::state& state, nvbench::type_ auto const& data_column = data_table->get_column(0); auto const input_table = cudf::table_view{{data_column, data_column, data_column}}; + auto mem_stats_logger = cudf::memory_stats_logger(); // init stats logger + state.set_cuda_stream(nvbench::make_cuda_stream_view(cudf::get_default_stream().value())); state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { - rmm::cuda_stream_view stream{launch.get_stream()}; - cudf::detail::distinct_count(input_table, cudf::null_equality::EQUAL, stream); + cudf::detail::distinct_count(input_table, cudf::null_equality::EQUAL); }); + state.add_buffer_size( + mem_stats_logger.peak_memory_usage(), "peak_memory_usage", "peak_memory_usage"); } using data_type = nvbench::type_list; From 23fa255ea877d438792d459104328699d04f1c0e Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Tue, 9 May 2023 11:50:08 -0700 Subject: [PATCH 3/6] Include missing header --- cpp/benchmarks/stream_compaction/distinct_count.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/benchmarks/stream_compaction/distinct_count.cpp b/cpp/benchmarks/stream_compaction/distinct_count.cpp index bb9458e3076..45620e314e4 100644 --- a/cpp/benchmarks/stream_compaction/distinct_count.cpp +++ b/cpp/benchmarks/stream_compaction/distinct_count.cpp @@ -15,6 +15,7 @@ */ #include +#include #include From 9420e9036bbb1a00cd7d32cd67480fd40dc70dcf Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Tue, 9 May 2023 12:05:36 -0700 Subject: [PATCH 4/6] Include proper header + renaming --- cpp/benchmarks/stream_compaction/distinct_count.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/benchmarks/stream_compaction/distinct_count.cpp b/cpp/benchmarks/stream_compaction/distinct_count.cpp index 45620e314e4..2b2c901b90f 100644 --- a/cpp/benchmarks/stream_compaction/distinct_count.cpp +++ b/cpp/benchmarks/stream_compaction/distinct_count.cpp @@ -17,12 +17,12 @@ #include #include -#include +#include #include template -static void bench_reduction_distinct_count(nvbench::state& state, nvbench::type_list) +static void bench_distinct_count(nvbench::state& state, nvbench::type_list) { auto const dtype = cudf::type_to_id(); auto const size = static_cast(state.get_int64("num_rows")); @@ -43,7 +43,7 @@ static void bench_reduction_distinct_count(nvbench::state& state, nvbench::type_ auto mem_stats_logger = cudf::memory_stats_logger(); // init stats logger state.set_cuda_stream(nvbench::make_cuda_stream_view(cudf::get_default_stream().value())); state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { - cudf::detail::distinct_count(input_table, cudf::null_equality::EQUAL); + cudf::distinct_count(input_table, cudf::null_equality::EQUAL); }); state.add_buffer_size( mem_stats_logger.peak_memory_usage(), "peak_memory_usage", "peak_memory_usage"); @@ -51,8 +51,8 @@ static void bench_reduction_distinct_count(nvbench::state& state, nvbench::type_ using data_type = nvbench::type_list; -NVBENCH_BENCH_TYPES(bench_reduction_distinct_count, NVBENCH_TYPE_AXES(data_type)) - .set_name("reduction_distinct_count") +NVBENCH_BENCH_TYPES(bench_distinct_count, NVBENCH_TYPE_AXES(data_type)) + .set_name("distinct_count") .add_int64_axis("num_rows", { 10000, // 10k From e9021027939743c2354b203c3ead97b9c1594138 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Tue, 9 May 2023 12:20:20 -0700 Subject: [PATCH 5/6] Revert unrelated changes --- cpp/cmake/thirdparty/get_cucollections.cmake | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cpp/cmake/thirdparty/get_cucollections.cmake b/cpp/cmake/thirdparty/get_cucollections.cmake index bf31a379537..97850eb29a6 100644 --- a/cpp/cmake/thirdparty/get_cucollections.cmake +++ b/cpp/cmake/thirdparty/get_cucollections.cmake @@ -14,14 +14,12 @@ # This function finds cuCollections and performs any additional configuration. function(find_and_configure_cucollections) - rapids_cpm_find( - cuco 0.0.1 - GLOBAL_TARGETS cuco::cuco - CPM_ARGS - GIT_REPOSITORY https://github.com/NVIDIA/cuCollections.git - GIT_TAG 1a841121d1a32b83c6de0ccccbcdf037790d61ad - OPTIONS "BUILD_TESTS OFF"  "BUILD_BENCHMARKS OFF"  "BUILD_EXAMPLES OFF" - ) + include(${rapids-cmake-dir}/cpm/cuco.cmake) + if(BUILD_SHARED_LIBS) + rapids_cpm_cuco(BUILD_EXPORT_SET cudf-exports) + else() + rapids_cpm_cuco(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports) + endif() endfunction() find_and_configure_cucollections() From 5562a07863b7c40e367cf65a512688b1ea09d37c Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Tue, 9 May 2023 12:22:27 -0700 Subject: [PATCH 6/6] Fix copyyear --- cpp/cmake/thirdparty/get_cucollections.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/thirdparty/get_cucollections.cmake b/cpp/cmake/thirdparty/get_cucollections.cmake index 97850eb29a6..9758958b44f 100644 --- a/cpp/cmake/thirdparty/get_cucollections.cmake +++ b/cpp/cmake/thirdparty/get_cucollections.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at