-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework some code logic to reduce iterator and comparator inlining to …
…improve compile time (#12900) Disables inlining the device code logic for the row operators for nested column types did not work as hoped. Some files took longer to compile and some functions ran 20% slower for large rows. Reworking individual source files to break up the code logic into multiple kernels seems to work well for compile time while having a smaller effect on performance. The goal is to only rework the nested column code paths. Here are some source files that have compile time issues and are improved in this PR. | source file | current | PR | |:--- | ---:| ---:| | stream_compaction/unique_count.cu | 18 min | 13 min | | groupby/sort/group_nunique.cu | 16 min | 2 min | | stream_compaction/unique.cu | 16 min | 5 min | | groupby/sort/sort_helper.cu | 10 min | 6.5 min | | search/contains_scalar.cu | 12 min | 4.7 min | | sort/is_sorted.cu | 9 min | 7 min | | groupby/sort/group_std.cu | 7 min | 1.2 min | | groupby/sort/group_m2.cu | 6 min | 1.2 min | Available benchmarks showed minimal impact to performance. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Yunsong Wang (https://github.com/PointKernel) - Mike Wilson (https://github.com/hyperbolic2346) - Bradley Dice (https://github.com/bdice) - Nghia Truong (https://github.com/ttnghia) URL: #12900
- Loading branch information
1 parent
698fcf6
commit 12dc130
Showing
10 changed files
with
217 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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/rmm_pool_raii.hpp> | ||
|
||
#include <cudf/column/column_view.hpp> | ||
#include <cudf/sorting.hpp> | ||
#include <cudf/stream_compaction.hpp> | ||
#include <cudf/types.hpp> | ||
|
||
#include <nvbench/nvbench.cuh> | ||
|
||
template <typename Type> | ||
void nvbench_unique_count(nvbench::state& state, nvbench::type_list<Type>) | ||
{ | ||
auto const num_rows = static_cast<cudf::size_type>(state.get_int64("NumRows")); | ||
auto const nulls = state.get_float64("NullProbability"); | ||
|
||
data_profile profile = data_profile_builder().cardinality(0).null_probability(nulls).distribution( | ||
cudf::type_to_id<Type>(), distribution_id::UNIFORM, 0, num_rows / 100); | ||
|
||
auto source_column = create_random_column(cudf::type_to_id<Type>(), row_count{num_rows}, profile); | ||
auto sorted_table = cudf::sort(cudf::table_view({source_column->view()})); | ||
|
||
auto input = sorted_table->view(); | ||
|
||
state.set_cuda_stream(nvbench::make_cuda_stream_view(cudf::get_default_stream().value())); | ||
state.exec(nvbench::exec_tag::sync, [&](nvbench::launch& launch) { | ||
cudf::unique_count(input, cudf::null_equality::EQUAL); | ||
}); | ||
} | ||
|
||
using data_type = nvbench::type_list<bool, int8_t, int32_t, int64_t, float, cudf::timestamp_ms>; | ||
|
||
NVBENCH_BENCH_TYPES(nvbench_unique_count, NVBENCH_TYPE_AXES(data_type)) | ||
.set_name("unique_count") | ||
.set_type_axes_names({"Type"}) | ||
.add_int64_axis("NumRows", {10'000, 100'000, 1'000'000, 10'000'000}) | ||
.add_float64_axis("NullProbability", {0.0, 0.1}); |
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
Oops, something went wrong.