Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve degenerate performance in create_structs_data #14761

Merged
merged 8 commits into from
Jan 18, 2024
7 changes: 6 additions & 1 deletion cpp/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. You may obtain a copy of the License at
Expand Down Expand Up @@ -183,6 +183,11 @@ ConfigureNVBench(
sort/sort_lists.cpp sort/sort_structs.cpp
)

# ##################################################################################################
# * create benchmark
SurajAralihalli marked this conversation as resolved.
Show resolved Hide resolved
# --------------------------------------------------------------------------------
ConfigureNVBench(CREATE_NVBENCH create/create_structs.cpp)
SurajAralihalli marked this conversation as resolved.
Show resolved Hide resolved

# ##################################################################################################
# * quantiles benchmark
# --------------------------------------------------------------------------------
Expand Down
31 changes: 31 additions & 0 deletions cpp/benchmarks/create/create_structs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* 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_nested_types.hpp>

#include <nvbench/nvbench.cuh>

void nvbench_create_structs(nvbench::state& state)
{
state.exec(nvbench::exec_tag::sync,
[&](nvbench::launch& launch) { auto const table_ptr = create_structs_data(state); });
}

NVBENCH_BENCH(nvbench_create_structs)
.set_name("create_structs")
.add_int64_power_of_two_axis("NumRows", {10, 18, 26})
.add_int64_axis("Depth", {1, 8, 16})
.add_int64_axis("Nulls", {0, 1});
2 changes: 2 additions & 0 deletions cpp/src/structs/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <cudf/column/column_factories.hpp>
#include <cudf/detail/copy.hpp>
#include <cudf/detail/null_mask.hpp>
#include <cudf/detail/nvtx/ranges.hpp>
#include <cudf/detail/structs/utilities.hpp>
#include <cudf/detail/unary.hpp>
#include <cudf/structs/structs_column_view.hpp>
Expand Down Expand Up @@ -229,6 +230,7 @@ std::unique_ptr<column> superimpose_nulls_no_sanitize(bitmask_type const* null_m
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr)
{
CUDF_FUNC_RANGE();
if (input->type().id() == cudf::type_id::EMPTY) {
// EMPTY columns should not have a null mask,
// so don't superimpose null mask on empty columns.
Expand Down