-
Notifications
You must be signed in to change notification settings - Fork 915
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
Feature/remove default streams #11967
Feature/remove default streams #11967
Conversation
Note to reviewers: I have added a |
Codecov ReportBase: 87.40% // Head: 88.15% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## branch-22.12 #11967 +/- ##
================================================
+ Coverage 87.40% 88.15% +0.74%
================================================
Files 133 133
Lines 21833 21995 +162
================================================
+ Hits 19084 19389 +305
+ Misses 2749 2606 -143
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless of how we proceed with API conventions, we should merge almost all the changes in .cu
and .cpp
files from this PR that add an explicit stream to detail API calls (the changes in headers where API defaults were removed are worth more consideration/debate). There are a lot of places internally and in tests/benchmarks where detail APIs are being called without providing a stream, but we should provide that argument even if it has a default in the detail API.
I posed an idea to @vyasr offline, about whether we should remove all default parameters from detail APIs in libcudf. It might sound daunting / undesirable at first - but consider this argument. We want to remove default streams from the detail APIs. However, many functions have If we were to remove default parameter values from all detail APIs, we would see the following consequences:
Alternatives:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a sensible change to me, LGTM
@bdice What an explanation! 🔥 I started reviewing this PR yesterday and first thought it was a good idea to put After seeing a lot of code with default values before the To restrict the scope of this PR, we could focus on the simple cases only where there are no other default values before |
I just know this (from @vyasr from Slack). This gives me a new idea for another approach. Look at the
They have an execution policy object as the first parameter. In cudf, most cudf APIs require two execution-related parameters:
and then the cudf APIs can always require that execution policy object as their first parameter. By doing so, we will have a very
Note that the |
@ttnghia yes you've got the gist of how the "handle" or "execution policy" object would work, and you're right that it would make for a more thrust-like API. Thanks everyone for a great discussion here! In the interest of not letting this work go stale, there seems to be consensus that we should try and get the uncontroversial changes in this PR merged. I have updated the PR accordingly. Once a Java codeowner like @ttnghia approves, I will merge this PR and then start putting together examples of the different approaches we have discussed taking for the cases where removing a default stream parameter would require changes to other default parameters in a signature. We can continue the discussion there. |
Java changes LGTM (github didn't show Java approval?). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@gpucibot merge |
) Removes default parameters from the `cudf::dictionary::detail` functions. Most of these were allowing for the default memory-resource which is unnecessary. One non-stream, non-mr parameter was defaulted but the default was never used. Reference #11967 Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Tobias Ribizel (https://github.com/upsj) - Yunsong Wang (https://github.com/PointKernel) - Nghia Truong (https://github.com/ttnghia) URL: #12006
Removes default parameters from the `nvtext::detail` functions. Most of these were internal default parameters which were unnecessary. The nvtext detail functions are only used within nvtext APIs. Reference #11967 Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Bradley Dice (https://github.com/bdice) - Nghia Truong (https://github.com/ttnghia) URL: #12007
Removes default parameters from the `cudf::strings::detail` functions. Most of these were unintentional the rest were for allowing for the default memory-resource which was easily fixed. Most of the detail functions are not used outside of strings and the default parameters were not actually necessary there. Hopefully this will help with #11967 Authors: - David Wendt (https://github.com/davidwendt) - Bradley Dice (https://github.com/bdice) Approvers: - Bradley Dice (https://github.com/bdice) - Yunsong Wang (https://github.com/PointKernel) URL: #12003
Description
Default stream parameters can lead to subtle bugs that are hard to track down if public APIs start exposing streams. Removing the defaults ensures that streams are properly forwarded through everywhere that they should be.
This PR partially addresses #9854. It does not change the cases where removing the default value from a stream parameter would necessitate changing the order of parameters in the function signature due to the presence of other default parameters. That work will be done in a follow-up PR.
Checklist