Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into insert_or_apply_identity
Browse files Browse the repository at this point in the history
  • Loading branch information
srinivasyadav18 committed Jul 30, 2024
2 parents fac13f0 + d92aefb commit 6ca8195
Show file tree
Hide file tree
Showing 35 changed files with 951 additions and 1,000 deletions.
54 changes: 27 additions & 27 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2018-2023, NVIDIA CORPORATION.
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,52 +49,52 @@ endfunction(ConfigureBench)
###################################################################################################
# - static_set benchmarks -------------------------------------------------------------------------
ConfigureBench(STATIC_SET_BENCH
hash_table/static_set/contains_bench.cu
hash_table/static_set/find_bench.cu
hash_table/static_set/insert_bench.cu
hash_table/static_set/retrieve_all_bench.cu
hash_table/static_set/size_bench.cu
hash_table/static_set/rehash_bench.cu)
static_set/contains_bench.cu
static_set/find_bench.cu
static_set/insert_bench.cu
static_set/retrieve_all_bench.cu
static_set/size_bench.cu
static_set/rehash_bench.cu)

###################################################################################################
# - static_map benchmarks -------------------------------------------------------------------------
ConfigureBench(STATIC_MAP_BENCH
hash_table/static_map/insert_bench.cu
hash_table/static_map/find_bench.cu
hash_table/static_map/contains_bench.cu
hash_table/static_map/erase_bench.cu
hash_table/static_map/insert_or_apply_bench.cu)
static_map/insert_bench.cu
static_map/find_bench.cu
static_map/contains_bench.cu
static_map/erase_bench.cu
static_map/insert_or_apply_bench.cu)

###################################################################################################
# - static_multiset benchmarks --------------------------------------------------------------------
ConfigureBench(STATIC_MULTISET_BENCH
hash_table/static_multiset/contains_bench.cu
hash_table/static_multiset/count_bench.cu
hash_table/static_multiset/find_bench.cu
hash_table/static_multiset/insert_bench.cu)
static_multiset/contains_bench.cu
static_multiset/count_bench.cu
static_multiset/find_bench.cu
static_multiset/insert_bench.cu)

###################################################################################################
# - static_multimap benchmarks --------------------------------------------------------------------
ConfigureBench(STATIC_MULTIMAP_BENCH
hash_table/static_multimap/insert_bench.cu
hash_table/static_multimap/retrieve_bench.cu
hash_table/static_multimap/query_bench.cu
hash_table/static_multimap/count_bench.cu)
static_multimap/insert_bench.cu
static_multimap/retrieve_bench.cu
static_multimap/query_bench.cu
static_multimap/count_bench.cu)

###################################################################################################
# - dynamic_map benchmarks ------------------------------------------------------------------------
ConfigureBench(DYNAMIC_MAP_BENCH
hash_table/dynamic_map/insert_bench.cu
hash_table/dynamic_map/find_bench.cu
hash_table/dynamic_map/contains_bench.cu
hash_table/dynamic_map/erase_bench.cu)
dynamic_map/insert_bench.cu
dynamic_map/find_bench.cu
dynamic_map/contains_bench.cu
dynamic_map/erase_bench.cu)

###################################################################################################
# - hash function benchmarks ----------------------------------------------------------------------
ConfigureBench(HASH_BENCH
hash_bench.cu)
ConfigureBench(HASH_FUNCTION_BENCH
hash_function/hash_function_bench.cu)

###################################################################################################
# - distinct_count_estimator benchmarks -----------------------------------------------------------
ConfigureBench(DISTINCT_COUNT_ESTIMATOR_BENCH
distinct_count_estimator_bench.cu)
distinct_count_estimator/distinct_count_estimator_bench.cu)
596 changes: 0 additions & 596 deletions benchmarks/analysis/notebooks/StaticMultimap.ipynb

This file was deleted.

99 changes: 0 additions & 99 deletions benchmarks/analysis/notebooks/Utils.py

This file was deleted.

6 changes: 3 additions & 3 deletions benchmarks/benchmark_defaults.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,8 +28,8 @@ using VALUE_TYPE_RANGE = nvbench::type_list<nvbench::int32_t, nvbench::int64_t>;

auto constexpr N = 100'000'000;
auto constexpr OCCUPANCY = 0.5;
auto constexpr MULTIPLICITY = 8;
auto constexpr MATCHING_RATE = 0.5;
auto constexpr MULTIPLICITY = 1;
auto constexpr MATCHING_RATE = 1.0;
auto constexpr MAX_NOISE = 3;
auto constexpr SKEW = 0.5;
auto constexpr BATCH_SIZE = 1'000'000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <cmath>
#include <cstddef>

using namespace cuco::benchmark;
using namespace cuco::utility;
using namespace cuco::benchmark; // defaults, dist_from_state
using namespace cuco::utility; // key_generator, distribution

template <typename InputIt>
[[nodiscard]] std::size_t exact_distinct_count(InputIt first, std::size_t n)
Expand Down Expand Up @@ -114,7 +114,7 @@ void distinct_count_estimator_e2e(nvbench::state& state, nvbench::type_list<T, D
}

/**
* @brief A benchmark evaluating `cuco::distinct_count_estimator::add` performance
* @brief A benchmark evaluating `cuco::distinct_count_estimator::add_async` performance
*/
template <typename T, typename Dist>
void distinct_count_estimator_add(nvbench::state& state, nvbench::type_list<T, Dist>)
Expand Down Expand Up @@ -146,7 +146,7 @@ using TYPE_RANGE = nvbench::type_list<nvbench::int32_t, nvbench::int64_t, __int1

NVBENCH_BENCH_TYPES(distinct_count_estimator_e2e,
NVBENCH_TYPE_AXES(TYPE_RANGE, nvbench::type_list<distribution::uniform>))
.set_name("distinct_count_estimator_e2e")
.set_name("distinct_count_estimator_e2e_uniform")
.set_type_axes_names({"T", "Distribution"})
.add_int64_power_of_two_axis("NumInputs", {28, 29, 30})
.add_int64_axis("SketchSizeKB", {8, 16, 32, 64, 128, 256}) // 256KB uses gmem fallback kernel
Expand All @@ -155,7 +155,7 @@ NVBENCH_BENCH_TYPES(distinct_count_estimator_e2e,

NVBENCH_BENCH_TYPES(distinct_count_estimator_add,
NVBENCH_TYPE_AXES(TYPE_RANGE, nvbench::type_list<distribution::uniform>))
.set_name("distinct_count_estimator::add_async")
.set_name("distinct_count_estimator_add_uniform")
.set_type_axes_names({"T", "Distribution"})
.add_int64_power_of_two_axis("NumInputs", {28, 29, 30})
.add_int64_axis("SketchSizeKB", {8, 16, 32, 64, 128, 256})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,8 +25,8 @@
#include <thrust/device_vector.h>
#include <thrust/transform.h>

using namespace cuco::benchmark;
using namespace cuco::utility;
using namespace cuco::benchmark; // defaults, dist_from_state
using namespace cuco::utility; // key_generator, distribution

/**
* @brief A benchmark evaluating `cuco::dynamic_map::contains` performance
Expand All @@ -37,9 +37,9 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> dynamic_map_contains(
{
using pair_type = cuco::pair<Key, Value>;

auto const num_keys = state.get_int64_or_default("NumInputs", defaults::N);
auto const initial_size = state.get_int64_or_default("InitSize", defaults::INITIAL_SIZE);
auto const matching_rate = state.get_float64_or_default("MatchingRate", defaults::MATCHING_RATE);
auto const num_keys = state.get_int64("NumInputs");
auto const initial_size = state.get_int64("InitSize");
auto const matching_rate = state.get_float64("MatchingRate");

thrust::device_vector<Key> keys(num_keys);

Expand Down Expand Up @@ -77,10 +77,12 @@ NVBENCH_BENCH_TYPES(dynamic_map_contains,
NVBENCH_TYPE_AXES(defaults::KEY_TYPE_RANGE,
defaults::VALUE_TYPE_RANGE,
nvbench::type_list<distribution::unique>))
.set_name("dynamic_map_contains_unique_num_inputs")
.set_name("dynamic_map_contains_unique_capacity")
.set_type_axes_names({"Key", "Value", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", defaults::N_RANGE);
.add_int64_axis("NumInputs", defaults::N_RANGE)
.add_int64_axis("InitSize", {defaults::INITIAL_SIZE})
.add_float64_axis("MatchingRate", {defaults::MATCHING_RATE});

NVBENCH_BENCH_TYPES(dynamic_map_contains,
NVBENCH_TYPE_AXES(defaults::KEY_TYPE_RANGE,
Expand All @@ -89,4 +91,6 @@ NVBENCH_BENCH_TYPES(dynamic_map_contains,
.set_name("dynamic_map_contains_unique_matching_rate")
.set_type_axes_names({"Key", "Value", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::N})
.add_int64_axis("InitSize", {defaults::INITIAL_SIZE})
.add_float64_axis("MatchingRate", defaults::MATCHING_RATE_RANGE);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,8 +25,8 @@
#include <thrust/device_vector.h>
#include <thrust/transform.h>

using namespace cuco::benchmark;
using namespace cuco::utility;
using namespace cuco::benchmark; // defaults, dist_from_state
using namespace cuco::utility; // key_generator, distribution

/**
* @brief A benchmark evaluating `cuco::dynamic_map::erase` performance
Expand All @@ -37,9 +37,9 @@ std::enable_if_t<(sizeof(Key) == sizeof(Value)), void> dynamic_map_erase(
{
using pair_type = cuco::pair<Key, Value>;

auto const num_keys = state.get_int64_or_default("NumInputs", defaults::N);
auto const initial_size = state.get_int64_or_default("InitSize", defaults::INITIAL_SIZE);
auto const matching_rate = state.get_float64_or_default("MatchingRate", defaults::MATCHING_RATE);
auto const num_keys = state.get_int64("NumInputs");
auto const initial_size = state.get_int64("InitSize");
auto const matching_rate = state.get_float64("MatchingRate");

thrust::device_vector<Key> keys(num_keys);

Expand Down Expand Up @@ -80,10 +80,12 @@ NVBENCH_BENCH_TYPES(dynamic_map_erase,
NVBENCH_TYPE_AXES(defaults::KEY_TYPE_RANGE,
defaults::VALUE_TYPE_RANGE,
nvbench::type_list<distribution::unique>))
.set_name("dynamic_map_erase_unique_num_inputs")
.set_name("dynamic_map_erase_unique_capacity")
.set_type_axes_names({"Key", "Value", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", defaults::N_RANGE);
.add_int64_axis("NumInputs", defaults::N_RANGE)
.add_int64_axis("InitSize", {defaults::INITIAL_SIZE})
.add_float64_axis("MatchingRate", {defaults::MATCHING_RATE});

NVBENCH_BENCH_TYPES(dynamic_map_erase,
NVBENCH_TYPE_AXES(defaults::KEY_TYPE_RANGE,
Expand All @@ -92,4 +94,6 @@ NVBENCH_BENCH_TYPES(dynamic_map_erase,
.set_name("dynamic_map_erase_unique_matching_rate")
.set_type_axes_names({"Key", "Value", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::N})
.add_int64_axis("InitSize", {defaults::INITIAL_SIZE})
.add_float64_axis("MatchingRate", defaults::MATCHING_RATE_RANGE);
Loading

0 comments on commit 6ca8195

Please sign in to comment.