-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support segmented reductions and null mask reductions #9621
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
bbfaf7f
add wrapper for cub::device_segmented_reduce
isVoid 1368645
Merge branch 'branch-21.12' of https://github.com/rapidsai/cudf into …
isVoid 2153108
passes compiles and actually produces correct result for non-null num…
isVoid 329eb39
add todo
isVoid a8a6d90
Revert "add todo"
isVoid a9a7b2c
Revert "passes compiles and actually produces correct result for non-…
isVoid 7ccdeb8
Initial pass for reduce sums
isVoid 5072c67
prod, max, min, any, all scaffolding
isVoid 5c4ddb7
Merge branch 'branch-22.02' of github.com:rapidsai/cudf into 9135
isVoid 39db304
Added null_policy handling to segmented reductions
isVoid 51538aa
extend test coverage to NULL_POLICY::INCLUDE and all ops
isVoid a017223
Moved null mask compute logic to null_mask.cuh with a new helper.
isVoid ea652c9
Initial pass for benchmark segment reduce
isVoid 5dae89e
Minor doc fixes.
isVoid 7db8c23
Cast return value from std::distance to size_type
isVoid 189c156
Merge branch 'branch-22.04' of github.com:rapidsai/cudf into 9135
isVoid edd8838
rev: order by alphebets for new entries in CMakeList.txt
isVoid c02a5b9
Update cpp/benchmarks/reduction/segment_reduce_benchmark.cpp
isVoid 95a5873
Merge branch '9135' of github.com:isVoid/cudf into 9135
isVoid a1d3be0
rev: reorder benchmark headers
isVoid 7b76179
rev: computes output null count
isVoid b3767f8
rev: reduction.cuh docstring
isVoid a951d60
rev: use negate of SFINAE
isVoid d019de9
rev: Add null_handling param docstring
isVoid 544ee36
rev: fix bad wording in docstring
isVoid 109e3db
Update cpp/include/cudf/reduction.hpp
isVoid f3d7ae9
Merge branch '9135' of github.com:isVoid/cudf into 9135
isVoid 183098b
rev: docstring fix
isVoid ee32feb
Docstring updates
isVoid 329120b
Merge branch '9135' of github.com:isVoid/cudf into 9135
isVoid 007c093
rev: docstrings, license fix
isVoid 93c92a9
Update cpp/src/reductions/simple_segmented.cuh
isVoid 8da60f8
Update cpp/src/reductions/simple_segmented.cuh
isVoid d85ed1a
rev: cleanup includes, docstring fixes
isVoid c981323
Merge branch '9135' of github.com:isVoid/cudf into 9135
isVoid 61d7942
.
isVoid 61fbdc8
rev: add compute precision todo
isVoid fc36453
rev: fix includes
isVoid 38221d3
Merge branch 'branch-22.04' of github.com:rapidsai/cudf into 9135
isVoid 71b7211
Rename benchmark file
isVoid 5552c12
fix broken trait usage.
isVoid 0fc27a0
doc fixes
isVoid 75cab7a
Change to lists_column_view interface
isVoid af08473
add todo
isVoid 26e97e1
Partially Revert "Change to lists_column_view interface", but use `de…
isVoid 11d5b19
Reverting list_column_view interface, expose device_span at public le…
isVoid 6e42663
Merge branch '9135' of github.com:isVoid/cudf into 9135
isVoid 7f2f796
Use aggregation reference
isVoid 1a787a3
Check offset size
isVoid 53e203d
rewrites benchmark with nvbench
isVoid 69cf3a1
Add todo; merge SFINAE checks into `is_supported`.
isVoid 24bb406
A bit more cleanups for benchmark code.
isVoid 32efb1b
Merge branch 'branch-22.04' of github.com:rapidsai/cudf into 9135
isVoid 0846d82
Fix license years
isVoid 71e6753
Header cleanups.
isVoid f0d9eac
Fixing up wrong license dates. Minor doc improvements.
isVoid 7b49675
Fix doc bug.
isVoid 1911103
Add partial reduction test case; Improve docs
isVoid 5699047
Address clang-tidy
isVoid 70cd617
Remove 1 todo, add 1 todo.
isVoid 4147f48
out of bound index description in docstring.
isVoid a4317a9
Multiple docstring, error message, todo comment updates.
isVoid 262bb66
Introduce `segmented_reduce_aggregation`.
isVoid c99a05d
Update cpp/include/cudf/detail/null_mask.cuh
isVoid 282e5d7
Refactors `segmented_null_reduction` based on reviews.
isVoid 8408b48
Update cpp/include/cudf/detail/null_mask.cuh
isVoid 2570f4a
Merge branch 'branch-22.04' of github.com:rapidsai/cudf into 9135
isVoid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,86 @@ | ||
| #include "cudf/column/column.hpp" | ||
|
isVoid marked this conversation as resolved.
Outdated
|
||
| #include <cudf/aggregation.hpp> | ||
| #include <cudf/column/column_factories.hpp> | ||
| #include <cudf/detail/iterator.cuh> | ||
| #include <cudf/reduction.hpp> | ||
| #include <cudf/types.hpp> | ||
|
|
||
| #include <cudf_test/base_fixture.hpp> | ||
| #include <cudf_test/column_utilities.hpp> | ||
| #include <cudf_test/column_wrapper.hpp> | ||
| #include <fixture/benchmark_fixture.hpp> | ||
| #include <memory> | ||
| #include <synchronization/synchronization.hpp> | ||
| #include <unordered_map> | ||
| #include <utility> | ||
|
isVoid marked this conversation as resolved.
Outdated
|
||
|
|
||
| namespace cudf { | ||
|
|
||
| class SegmentReduction : public cudf::benchmark { | ||
| }; | ||
|
|
||
| template <typename InputType> | ||
| void BM_Segment_Reduction_Simple(::benchmark::State& state, std::unique_ptr<aggregation> const& agg) | ||
|
isVoid marked this conversation as resolved.
Outdated
|
||
| { | ||
| auto const column_size{size_type(state.range(0))}; | ||
| auto const num_segments{size_type(state.range(1))}; | ||
| auto const segment_length = column_size / num_segments; | ||
|
|
||
| test::UniformRandomGenerator<InputType> rand_gen(0, 100); | ||
| auto data_it = detail::make_counting_transform_iterator( | ||
| 0, [&rand_gen](auto i) { return rand_gen.generate(); }); | ||
|
|
||
| auto offset_it = detail::make_counting_transform_iterator( | ||
| 0, | ||
| [&column_size, &segment_length](auto i) { return std::min(column_size, i * segment_length); }); | ||
|
|
||
| test::fixed_width_column_wrapper<InputType> input(data_it, data_it + column_size); | ||
| test::fixed_width_column_wrapper<size_type> offsets(offset_it, offset_it + num_segments + 1); | ||
|
|
||
| for (auto _ : state) { | ||
| cuda_event_timer timer(state, true); | ||
| auto result = cudf::segmented_reduce(input, | ||
| offsets, | ||
| make_sum_aggregation(), | ||
| data_type{type_to_id<InputType>()}, | ||
| null_policy::EXCLUDE); | ||
| } | ||
| } | ||
|
|
||
| #define concat(a, b, c) a##b##c | ||
| #define get_agg(op) concat(cudf::make_, op, _aggregation()) | ||
|
|
||
| #define SRBM_DEFINE(name, type, op) \ | ||
| BENCHMARK_DEFINE_F(SegmentReduction, name)(::benchmark::State & state) \ | ||
| { \ | ||
| BM_Segment_Reduction_Simple<type>(state, get_agg(op)); \ | ||
| } \ | ||
| BENCHMARK_REGISTER_F(SegmentReduction, name) \ | ||
| ->UseManualTime() \ | ||
| ->ArgsProduct( \ | ||
| {{1 << 14, /*10k*/ 1 << 17, /*100k*/ 1 << 20, /*1M*/ 1 << 24, /*10M*/ 1 << 27 /*100M*/}, \ | ||
| { \ | ||
| 128, \ | ||
| 1024, \ | ||
| }}); | ||
|
|
||
| #define REDUCE_BENCHMARK_DEFINE(type, aggregation) \ | ||
| SRBM_DEFINE(concat(type, _, aggregation), type, aggregation) | ||
|
|
||
| #define REDUCE_BENCHMARK_NUMERIC(aggregation) \ | ||
| REDUCE_BENCHMARK_DEFINE(bool, aggregation); \ | ||
| REDUCE_BENCHMARK_DEFINE(int8_t, aggregation); \ | ||
| REDUCE_BENCHMARK_DEFINE(int16_t, aggregation); \ | ||
| REDUCE_BENCHMARK_DEFINE(int32_t, aggregation); \ | ||
| REDUCE_BENCHMARK_DEFINE(int64_t, aggregation); \ | ||
| REDUCE_BENCHMARK_DEFINE(float, aggregation); \ | ||
| REDUCE_BENCHMARK_DEFINE(double, aggregation); | ||
|
|
||
| REDUCE_BENCHMARK_NUMERIC(sum) | ||
| REDUCE_BENCHMARK_NUMERIC(product) | ||
| REDUCE_BENCHMARK_NUMERIC(min) | ||
| REDUCE_BENCHMARK_NUMERIC(max) | ||
| REDUCE_BENCHMARK_NUMERIC(any) | ||
| REDUCE_BENCHMARK_NUMERIC(all) | ||
|
|
||
| } // namespace cudf | ||
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.