-
Notifications
You must be signed in to change notification settings - Fork 912
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-23.10' into progressive_chunked_reader
- Loading branch information
Showing
54 changed files
with
2,594 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Copyright (c) 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <benchmarks/common/generate_input.hpp> | ||
#include <benchmarks/fixture/benchmark_fixture.hpp> | ||
|
||
#include <cudf/detail/search.hpp> | ||
#include <cudf/lists/list_view.hpp> | ||
#include <cudf/types.hpp> | ||
|
||
#include <rmm/mr/device/per_device_resource.hpp> | ||
|
||
#include <nvbench/nvbench.cuh> | ||
|
||
auto constexpr num_unique_elements = 1000; | ||
|
||
template <typename Type> | ||
static void nvbench_contains_table(nvbench::state& state, nvbench::type_list<Type>) | ||
{ | ||
auto const size = state.get_int64("table_size"); | ||
auto const dtype = cudf::type_to_id<Type>(); | ||
double const null_probability = state.get_float64("null_probability"); | ||
|
||
auto builder = data_profile_builder().null_probability(null_probability); | ||
if (dtype == cudf::type_id::LIST) { | ||
builder.distribution(dtype, distribution_id::UNIFORM, 0, num_unique_elements) | ||
.distribution(cudf::type_id::INT32, distribution_id::UNIFORM, 0, num_unique_elements) | ||
.list_depth(1); | ||
} else { | ||
builder.distribution(dtype, distribution_id::UNIFORM, 0, num_unique_elements); | ||
} | ||
|
||
auto const haystack = create_random_table( | ||
{dtype}, table_size_bytes{static_cast<size_t>(size)}, data_profile{builder}, 0); | ||
auto const needles = create_random_table( | ||
{dtype}, table_size_bytes{static_cast<size_t>(size)}, data_profile{builder}, 1); | ||
|
||
auto mem_stats_logger = cudf::memory_stats_logger(); | ||
|
||
state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { | ||
auto const stream_view = rmm::cuda_stream_view{launch.get_stream()}; | ||
[[maybe_unused]] auto const result = | ||
cudf::detail::contains(haystack->view(), | ||
needles->view(), | ||
cudf::null_equality::EQUAL, | ||
cudf::nan_equality::ALL_EQUAL, | ||
stream_view, | ||
rmm::mr::get_current_device_resource()); | ||
}); | ||
|
||
state.add_buffer_size( | ||
mem_stats_logger.peak_memory_usage(), "peak_memory_usage", "peak_memory_usage"); | ||
} | ||
|
||
NVBENCH_BENCH_TYPES(nvbench_contains_table, | ||
NVBENCH_TYPE_AXES(nvbench::type_list<int32_t, cudf::list_view>)) | ||
.set_name("contains_table") | ||
.set_type_axes_names({"type"}) | ||
.add_float64_axis("null_probability", {0.0, 0.1}) | ||
.add_int64_axis("table_size", {10'000, 100'000, 1'000'000, 10'000'000}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (c) 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cudf/column/column_view.hpp> | ||
#include <cudf/scalar/scalar.hpp> | ||
#include <cudf/table/table_view.hpp> | ||
|
||
#include <rmm/cuda_stream_view.hpp> | ||
#include <rmm/device_uvector.hpp> | ||
|
||
#include <memory> | ||
#include <optional> | ||
|
||
namespace cudf::reduction::detail { | ||
|
||
/** | ||
* @brief Compute the frequency for each distinct row in the input table. | ||
* | ||
* @param input The input table to compute histogram | ||
* @param partial_counts An optional column containing count for each row | ||
* @param stream CUDA stream used for device memory operations and kernel launches | ||
* @param mr Device memory resource used to allocate memory of the returned objects | ||
* @return A pair of array contains the (stable-order) indices of the distinct rows in the input | ||
* table, and their corresponding distinct counts | ||
*/ | ||
[[nodiscard]] std::pair<std::unique_ptr<rmm::device_uvector<size_type>>, std::unique_ptr<column>> | ||
compute_row_frequencies(table_view const& input, | ||
std::optional<column_view> const& partial_counts, | ||
rmm::cuda_stream_view stream, | ||
rmm::mr::device_memory_resource* mr); | ||
|
||
/** | ||
* @brief Create an empty histogram column. | ||
* | ||
* A histogram column is a structs column `STRUCT<T, int64_t>` where T is type of the input | ||
* values. | ||
* | ||
* @returns An empty histogram column | ||
*/ | ||
[[nodiscard]] std::unique_ptr<column> make_empty_histogram_like(column_view const& values); | ||
|
||
} // namespace cudf::reduction::detail |
Oops, something went wrong.