Skip to content

Commit

Permalink
Expose default benchmark axes in the output (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel authored Nov 17, 2024
1 parent eb9319b commit 20a16ec
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
6 changes: 3 additions & 3 deletions benchmarks/benchmark_utils.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 @@ -29,10 +29,10 @@ auto dist_from_state(nvbench::state const& state)
if constexpr (std::is_same_v<Dist, cuco::utility::distribution::unique>) {
return Dist{};
} else if constexpr (std::is_same_v<Dist, cuco::utility::distribution::uniform>) {
auto const multiplicity = state.get_int64_or_default("Multiplicity", defaults::MULTIPLICITY);
auto const multiplicity = state.get_int64("Multiplicity");
return Dist{multiplicity};
} else if constexpr (std::is_same_v<Dist, cuco::utility::distribution::gaussian>) {
auto const skew = state.get_float64_or_default("Skew", defaults::SKEW);
auto const skew = state.get_float64("Skew");
return Dist{skew};
} else {
CUCO_FAIL("Unexpected distribution type");
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/bloom_filter/add_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void bloom_filter_add(nvbench::state& state,

auto const num_keys = state.get_int64("NumInputs");
auto const filter_size_mb = state.get_int64("FilterSizeMB");
auto const pattern_bits = state.get_int64_or_default("PatternBits", WordsPerBlock);
auto const pattern_bits = WordsPerBlock;

try {
auto const policy = policy_type{static_cast<uint32_t>(pattern_bits)};
Expand Down Expand Up @@ -171,4 +171,4 @@ NVBENCH_BENCH_TYPES(arrow_bloom_filter_add,
.set_type_axes_names({"Key", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE);
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE);
4 changes: 2 additions & 2 deletions benchmarks/bloom_filter/contains_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void bloom_filter_contains(

auto const num_keys = state.get_int64("NumInputs");
auto const filter_size_mb = state.get_int64("FilterSizeMB");
auto const pattern_bits = state.get_int64_or_default("PatternBits", WordsPerBlock);
auto const pattern_bits = WordsPerBlock;

try {
auto const policy = policy_type{static_cast<uint32_t>(pattern_bits)};
Expand Down Expand Up @@ -181,4 +181,4 @@ NVBENCH_BENCH_TYPES(arrow_bloom_filter_contains,
.set_type_axes_names({"Key", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::BF_N})
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE);
.add_int64_axis("FilterSizeMB", defaults::BF_SIZE_MB_RANGE_CACHE);
19 changes: 14 additions & 5 deletions benchmarks/static_multiset/retrieve_bench.cu
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ using namespace cuco::utility;
template <typename Key, typename Dist>
void static_multiset_retrieve(nvbench::state& state, nvbench::type_list<Key, Dist>)
{
auto const num_keys = state.get_int64_or_default("NumInputs", defaults::N);
auto const occupancy = state.get_float64_or_default("Occupancy", defaults::OCCUPANCY);
auto const matching_rate = state.get_float64_or_default("MatchingRate", defaults::MATCHING_RATE);
auto const num_keys = state.get_int64("NumInputs");
auto const occupancy = state.get_float64("Occupancy");
auto const matching_rate = state.get_float64("MatchingRate");

std::size_t const size = num_keys / occupancy;

Expand Down Expand Up @@ -68,20 +68,29 @@ NVBENCH_BENCH_TYPES(static_multiset_retrieve,
.set_name("static_multiset_retrieve_uniform_occupancy")
.set_type_axes_names({"Key", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_float64_axis("Occupancy", defaults::OCCUPANCY_RANGE);
.add_int64_axis("NumInputs", {defaults::N})
.add_float64_axis("Occupancy", defaults::OCCUPANCY_RANGE)
.add_float64_axis("MatchingRate", {defaults::MATCHING_RATE})
.add_int64_axis("Multiplicity", {defaults::MULTIPLICITY});

NVBENCH_BENCH_TYPES(static_multiset_retrieve,
NVBENCH_TYPE_AXES(defaults::KEY_TYPE_RANGE,
nvbench::type_list<distribution::uniform>))
.set_name("static_multiset_retrieve_uniform_matching_rate")
.set_type_axes_names({"Key", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_float64_axis("MatchingRate", defaults::MATCHING_RATE_RANGE);
.add_int64_axis("NumInputs", {defaults::N})
.add_float64_axis("Occupancy", {defaults::OCCUPANCY})
.add_float64_axis("MatchingRate", defaults::MATCHING_RATE_RANGE)
.add_int64_axis("Multiplicity", {defaults::MULTIPLICITY});

NVBENCH_BENCH_TYPES(static_multiset_retrieve,
NVBENCH_TYPE_AXES(defaults::KEY_TYPE_RANGE,
nvbench::type_list<distribution::uniform>))
.set_name("static_multiset_retrieve_uniform_multiplicity")
.set_type_axes_names({"Key", "Distribution"})
.set_max_noise(defaults::MAX_NOISE)
.add_int64_axis("NumInputs", {defaults::N})
.add_float64_axis("Occupancy", {defaults::OCCUPANCY})
.add_float64_axis("MatchingRate", {defaults::MATCHING_RATE})
.add_int64_axis("Multiplicity", defaults::MULTIPLICITY_RANGE);

0 comments on commit 20a16ec

Please sign in to comment.