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

Fix memory write error in get_list_child_to_list_row_mapping utility #8994

Merged

Conversation

davidwendt
Copy link
Contributor

Reference issue #8883 and depends on fixes in PR #8884

The get_list_child_to_list_row_mapping builds a map for rolling operation on a lists column. In the thrust::scatter call a map value includes the last offset which will always be out-of-bounds to given output vector. This output vector is used to build the resultant output map by calling thrust::inclusive_scan but the out-of-bounds offset value is not used -- which is why the utility does not fail. The fix in this PR simply allocates an extra row in the intermediate vector so the thrust::scatter will not write to out-of-bounds memory. Since the value is eventually ignored, it does not effect the result.

The code in this function was creating many temporary columns incorrectly using the passed in device_resource_manager variable mr. The code was corrected by changing these to be just device_uvector's instead making it more clear that these are internal temporary memory buffers. Further the code calling get_list_child_to_list_row_mapping utility is using the output as a temporary column and so this PR fixes the logic to correct the memory resource usage.

@davidwendt davidwendt added bug Something isn't working 2 - In Progress Currently a work in progress libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Aug 9, 2021
@davidwendt davidwendt self-assigned this Aug 9, 2021
@codecov
Copy link

codecov bot commented Aug 9, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.10@3ea4b42). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 861572d differs from pull request most recent head 1ffaac9. Consider uploading reports for the commit 1ffaac9 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.10    #8994   +/-   ##
===============================================
  Coverage                ?   10.71%           
===============================================
  Files                   ?      114           
  Lines                   ?    19090           
  Branches                ?        0           
===============================================
  Hits                    ?     2046           
  Misses                  ?    17044           
  Partials                ?        0           

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 3ea4b42...1ffaac9. Read the comment docs.

@github-actions github-actions bot added the CMake CMake build issue label Aug 9, 2021
@davidwendt davidwendt added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Aug 10, 2021
@davidwendt davidwendt marked this pull request as ready for review August 10, 2021 13:11
@davidwendt davidwendt requested review from a team as code owners August 10, 2021 13:11
Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

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

CMake changes LGTM

Copy link
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

Kudos for moving the non-template functions into the .cu. +1.

Copy link
Contributor

@karthikeyann karthikeyann left a comment

Choose a reason for hiding this comment

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

Look good.

cpp/src/rolling/rolling_collect_list.cu Outdated Show resolved Hide resolved
@davidwendt
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit d4c3f32 into rapidsai:branch-21.10 Aug 23, 2021
@davidwendt davidwendt deleted the bug-memcheck-rolling-collect-list branch August 23, 2021 14:09
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 bug Something isn't working CMake CMake build issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants