-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/branch-24.10' into simplify-re…
…mote-io
- Loading branch information
Showing
194 changed files
with
4,326 additions
and
1,431 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,101 @@ | ||
/* | ||
* Copyright (c) 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. | ||
* 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 <benchmarks/io/cuio_common.hpp> | ||
#include <benchmarks/io/nvbench_helpers.hpp> | ||
|
||
#include <cudf/io/parquet.hpp> | ||
#include <cudf/utilities/default_stream.hpp> | ||
|
||
#include <nvbench/nvbench.cuh> | ||
|
||
// Size of the data in the benchmark dataframe; chosen to be low enough to allow benchmarks to | ||
// run on most GPUs, but large enough to allow highest throughput | ||
constexpr size_t data_size = 512 << 20; | ||
|
||
void parquet_read_common(cudf::size_type num_rows_to_read, | ||
cudf::size_type num_cols_to_read, | ||
cuio_source_sink_pair& source_sink, | ||
nvbench::state& state) | ||
{ | ||
cudf::io::parquet_reader_options read_opts = | ||
cudf::io::parquet_reader_options::builder(source_sink.make_source_info()); | ||
|
||
auto mem_stats_logger = cudf::memory_stats_logger(); | ||
state.set_cuda_stream(nvbench::make_cuda_stream_view(cudf::get_default_stream().value())); | ||
state.exec( | ||
nvbench::exec_tag::sync | nvbench::exec_tag::timer, [&](nvbench::launch& launch, auto& timer) { | ||
try_drop_l3_cache(); | ||
|
||
timer.start(); | ||
auto const result = cudf::io::read_parquet(read_opts); | ||
timer.stop(); | ||
|
||
CUDF_EXPECTS(result.tbl->num_columns() == num_cols_to_read, "Unexpected number of columns"); | ||
CUDF_EXPECTS(result.tbl->num_rows() == num_rows_to_read, "Unexpected number of rows"); | ||
}); | ||
|
||
auto const time = state.get_summary("nv/cold/time/gpu/mean").get_float64("value"); | ||
state.add_element_count(static_cast<double>(data_size) / time, "bytes_per_second"); | ||
state.add_buffer_size( | ||
mem_stats_logger.peak_memory_usage(), "peak_memory_usage", "peak_memory_usage"); | ||
state.add_buffer_size(source_sink.size(), "encoded_file_size", "encoded_file_size"); | ||
} | ||
|
||
template <data_type DataType> | ||
void bench_batched_memset(nvbench::state& state, nvbench::type_list<nvbench::enum_type<DataType>>) | ||
{ | ||
auto const d_type = get_type_or_group(static_cast<int32_t>(DataType)); | ||
auto const num_cols = static_cast<cudf::size_type>(state.get_int64("num_cols")); | ||
auto const cardinality = static_cast<cudf::size_type>(state.get_int64("cardinality")); | ||
auto const run_length = static_cast<cudf::size_type>(state.get_int64("run_length")); | ||
auto const source_type = retrieve_io_type_enum(state.get_string("io_type")); | ||
auto const compression = cudf::io::compression_type::NONE; | ||
cuio_source_sink_pair source_sink(source_type); | ||
auto const tbl = | ||
create_random_table(cycle_dtypes(d_type, num_cols), | ||
table_size_bytes{data_size}, | ||
data_profile_builder().cardinality(cardinality).avg_run_length(run_length)); | ||
auto const view = tbl->view(); | ||
|
||
cudf::io::parquet_writer_options write_opts = | ||
cudf::io::parquet_writer_options::builder(source_sink.make_sink_info(), view) | ||
.compression(compression); | ||
cudf::io::write_parquet(write_opts); | ||
auto const num_rows = view.num_rows(); | ||
|
||
parquet_read_common(num_rows, num_cols, source_sink, state); | ||
} | ||
|
||
using d_type_list = nvbench::enum_type_list<data_type::INTEGRAL, | ||
data_type::FLOAT, | ||
data_type::DECIMAL, | ||
data_type::TIMESTAMP, | ||
data_type::DURATION, | ||
data_type::STRING, | ||
data_type::LIST, | ||
data_type::STRUCT>; | ||
|
||
NVBENCH_BENCH_TYPES(bench_batched_memset, NVBENCH_TYPE_AXES(d_type_list)) | ||
.set_name("batched_memset") | ||
.set_type_axes_names({"data_type"}) | ||
.add_int64_axis("num_cols", {1000}) | ||
.add_string_axis("io_type", {"DEVICE_BUFFER"}) | ||
.set_min_samples(4) | ||
.add_int64_axis("cardinality", {0, 1000}) | ||
.add_int64_axis("run_length", {1, 32}); |
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
Oops, something went wrong.