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

Add optional-iterator support to indexalator #9306

Merged

Conversation

davidwendt
Copy link
Contributor

This PR adds support for the optional-iterator interface to the cudf::detail::indexalator. This will allow replacing usages of pair-iterator in future PR(s). This also includes gtests that were missing for the indexalator.

@davidwendt davidwendt added 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 24, 2021
@davidwendt davidwendt self-assigned this Sep 24, 2021
@github-actions github-actions bot added the CMake CMake build issue label Sep 24, 2021
@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #9306 (1df2a7d) into branch-21.12 (ab4bfaa) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-21.12    #9306      +/-   ##
================================================
- Coverage         10.79%   10.77%   -0.02%     
================================================
  Files               116      116              
  Lines             18869    19390     +521     
================================================
+ Hits               2036     2090      +54     
- Misses            16833    17300     +467     
Impacted Files Coverage Δ
python/cudf/cudf/core/_base_index.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/dataframe.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/index.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/join/_join_helpers.py 0.00% <ø> (ø)
python/cudf/cudf/core/multiindex.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/series.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/udf/api.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/udf/lowering.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/udf/pipeline.py 0.00% <0.00%> (ø)
... and 59 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e63f455...1df2a7d. Read the comment docs.

@davidwendt davidwendt added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Sep 27, 2021
@davidwendt davidwendt marked this pull request as ready for review September 27, 2021 18:48
@davidwendt davidwendt requested a review from a team as a code owner September 27, 2021 18:48
@davidwendt davidwendt requested review from harrism and vuule September 27, 2021 18:48
Copy link
Contributor

@vuule vuule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few nitpicks.

cpp/tests/iterator/indexalator_test.cu Outdated Show resolved Hide resolved
cpp/tests/iterator/indexalator_test.cu Outdated Show resolved Hide resolved
Copy link
Contributor

@ttnghia ttnghia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more thing I'm a bit concerned but may not be able to address for now: The tests calls this->iterator_test_thrust(expected_values, it_dev, host_values.size());, instead of using the macro EXPECT_COLUMNS_EQUAL etc. If a test fails, we may have difficulty locating which line it is failing.

@davidwendt
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 91f1dea into rapidsai:branch-21.12 Oct 1, 2021
@davidwendt davidwendt deleted the fea-optional-iter-indexalator branch October 1, 2021 12:31
rapids-bot bot pushed a commit that referenced this pull request Oct 13, 2021
This PR changes the `cudf::detail::copy_if_else` utility functions to accept an optional-iterator instead of a pair-iterator. This improves the compile time of source files by generating 4x less kernels since the two input data arrays can each have nulls requiring 4 different pair-iterators to be created to call it. The optional-iterator allows the nulls check to occur at runtime instead of compile time.

The changes in this PR are for the callers of `detail::copy_if_else` to provide optional-iterators instead of pair-iterators. This PR is dependent on the changes in #9306 

The benchmarks for the effected calling functions showed no significant change in runtime performance using the single optional-iterator over 4 unique pair-iterators. Two additional benchmarks are included cover non-null measurement which this PR impacts the most.

Also, the `copy_tests.cu` was renamed `copy_tests.cpp` and the test that launched to the internal  `cudf::detail::copy_if_else_kernel` was replaced with one with a data-set large enough to require multiple blocks.

Related changes for the strings specific `cudf::strings::detail::copy_if_else` are in #9266

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Robert Maynard (https://github.com/robertmaynard)
  - Jake Hemstad (https://github.com/jrhemstad)

URL: #9324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team CMake CMake build issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants