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

Make device_buffer streams explicit and enforce move construction #8280

Merged

Conversation

harrism
Copy link
Member

@harrism harrism commented May 19, 2021

In preparation for rapidsai/rmm#775, this PR has many changes to ensure streams on which device_buffers are allocated and copied are explicit. As a consequence, this PR also finds and fixes many places where buffers were copied that should have been moved. In addition, it adds copy constructors that take an optional stream to all cudf::scalar classes.

This can and should be merged before rapidsai/rmm#775 to ensure no breakage of the build by that PR.

@harrism harrism requested a review from a team as a code owner May 19, 2021 03:42
@harrism harrism requested review from devavret and rgsl888prabhu May 19, 2021 03:42
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label May 19, 2021
@harrism harrism added improvement Improvement / enhancement to an existing function 3 - Ready for Review Ready for review by team non-breaking Non-breaking change labels May 19, 2021
@harrism harrism self-assigned this May 19, 2021
@github-actions github-actions bot added the Python Affects Python cuDF API. label May 19, 2021
@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

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

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.06    #8280   +/-   ##
===============================================
  Coverage                ?   82.89%           
===============================================
  Files                   ?      105           
  Lines                   ?    17875           
  Branches                ?        0           
===============================================
  Hits                    ?    14817           
  Misses                  ?     3058           
  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 8834ed6...a36349c. Read the comment docs.

Copy link
Contributor

@rgsl888prabhu rgsl888prabhu 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 comments needs to be addressed.

@harrism harrism requested a review from a team as a code owner May 19, 2021 23:24
@harrism harrism requested a review from kkraus14 May 19, 2021 23:24
@harrism harrism requested a review from jrhemstad May 20, 2021 01:14
@github-actions github-actions bot added the Java Affects Java cuDF API. label May 20, 2021
@harrism harrism requested a review from a team as a code owner May 20, 2021 01:57
Copy link
Member

@jlowe jlowe left a comment

Choose a reason for hiding this comment

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

Java approval

cpp/include/cudf/scalar/scalar.hpp Show resolved Hide resolved
cpp/src/dictionary/dictionary_factories.cu Outdated Show resolved Hide resolved
cpp/src/copying/scatter.cu Outdated Show resolved Hide resolved
cpp/include/cudf/strings/detail/copy_if_else.cuh Outdated Show resolved Hide resolved
cpp/src/lists/lists_column_factories.cu Outdated Show resolved Hide resolved
cpp/src/replace/clamp.cu Outdated Show resolved Hide resolved
cpp/src/replace/replace.cu Outdated Show resolved Hide resolved
cpp/src/strings/strings_column_factories.cu Outdated Show resolved Hide resolved
cpp/src/structs/structs_column_factories.cu Outdated Show resolved Hide resolved
harrism and others added 2 commits May 21, 2021 10:19
@harrism harrism added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels May 24, 2021
@harrism
Copy link
Member Author

harrism commented May 24, 2021

@gpucibot merge

@ttnghia
Copy link
Contributor

ttnghia commented May 25, 2021

Rerun tests.

1 similar comment
@ttnghia
Copy link
Contributor

ttnghia commented May 26, 2021

Rerun tests.

@rapids-bot rapids-bot bot merged commit fa6e7e0 into rapidsai:branch-21.06 May 26, 2021
rapids-bot bot pushed a commit to rapidsai/rmm that referenced this pull request Jun 2, 2021
Removes default stream arguments from `rmm::device_buffer`. Now copy construction requires a stream argument (default copy ctor deleted), and copy assignment is disallowed (operator deleted). Move construction and assignment are still supported, and move assignment still use the most recently used stream for deallocating any previous data.

Also improves device_buffer tests (implements TODOs in code).

I don't think this should be merged until RAPIDS dependent libraries are ready for it. I have a libcudf PR in progress for this.

Fixes #418

- [x] cuDF PR: rapidsai/cudf#8280
- [x] cuGraph PR: rapidsai/cugraph#1609
- [x] cuSpatial PR: rapidsai/cuspatial#403
- [x] cuML does not yet use device_buffer

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Rong Ou (https://github.com/rongou)
  - Keith Kraus (https://github.com/kkraus14)
  - Conor Hoekstra (https://github.com/codereport)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #775
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants