Use cuda::stream_ref in remaining core libcudf APIs - #23691
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
fa33c11 to
834a687
Compare
834a687 to
ee2961a
Compare
| cudf::table_view const& table) | ||
| { | ||
| auto stream = rmm::cuda_stream_default; | ||
| auto stream = cuda::stream_ref{}; |
There was a problem hiding this comment.
I think the default constructors like this are deprecated. Please check that. I see this in a few examples.
There was a problem hiding this comment.
Thanks, fixed in the split benchmarks/examples PR: #23697. I replaced the nullary cuda::stream_ref{} uses in the examples with explicit cuda::stream_ref{cudaStreamLegacy}.
There was a problem hiding this comment.
I think you want cudaStreamDefault and not cudaStreamLegacy. We should respect compiling with PTDS enabled, which changes how cudaStreamDefault is interpreted.
| [[nodiscard]] bool may_evaluate_null(table_view const& left, | ||
| table_view const& right, | ||
| rmm::cuda_stream_view stream) const override; | ||
| cuda::stream_ref stream) const override; |
There was a problem hiding this comment.
This file appears to be missing <cuda/stream> includes. Same for cpp/src/ast/jit/expressions.cpp and others in cpp/src/ast. Can you check everything for IWYU?
There was a problem hiding this comment.
Done here. I audited the AST/JIT changes and added direct <cuda/stream> includes where cuda::stream_ref is used, including this file and the corresponding AST/JIT implementation files.
There was a problem hiding this comment.
Follow-up: I found one remaining IWYU miss while rechecking this thread: cpp/include/cudf/ast/expressions.hpp also declares cuda::stream_ref and was still relying on transitive includes. Fixed in 5ab1aa5855 by adding a direct <cuda/stream> include there as well.
| _null_handling{null_handling}, | ||
| _mr{std::move(mr)}, | ||
| _d_agg_kinds{0, rmm::cuda_stream_default, cudf::get_current_device_resource_ref()}, | ||
| _d_agg_kinds{0, cuda::stream_ref{}, cudf::get_current_device_resource_ref()}, |
There was a problem hiding this comment.
I think the nullary constructor is deprecated.
There was a problem hiding this comment.
Done here. This now uses an explicit legacy stream construction: cuda::stream_ref{cudaStreamLegacy}.
| #else | ||
| rmm::cuda_stream_view const default_stream_value{}; | ||
| cuda::stream_ref const default_stream_value{}; |
There was a problem hiding this comment.
This should be explicit and not default-constructed. But should it be set to cudaStreamLegacy or cudaStreamDefault? Probably Legacy?
| cuda::stream_ref const default_stream_value{}; | |
| cuda::stream_ref const default_stream_value{cuda::stream_ref{cudaStreamLegacy}}; |
There was a problem hiding this comment.
Done here. I used the explicit legacy/default-stream spelling for the non-PTDS case: cuda::stream_ref const default_stream_value{cudaStreamLegacy}.
| #include <rmm/device_uvector.hpp> | ||
| #include <rmm/exec_policy.hpp> | ||
|
|
||
| #include <cuda/stream_ref> |
There was a problem hiding this comment.
There are a few files like this with header changes but no changes in the code itself. I don't think the header is used. Can we audit for those files and remove the headers if they're not required?
There was a problem hiding this comment.
Done in the split tests PR: #23696. I audited the test-only header additions and removed the unused stream headers.
ee2961a to
d6cfbf8
Compare
d6cfbf8 to
dd55488
Compare
c60ef6b to
75513d2
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis change migrates cuDF stream APIs and implementations from ChangesCUDA stream API migration
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟠 High · up to The stream API migration still contains multiple potential build blockers and a stream-ordering correctness hazard, including outdated synchronization calls, a malformed CUDA error-check statement, and operations that may run on the wrong stream. These issues should be fixed or explicitly accepted before merging. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
6893200 to
c54a021
Compare
|
/ok to test |
|
/ok to test |
5fe10e0 to
03a2c15
Compare
|
Follow-up: can we document in the developer guide when to use stream.sync() vs. cudf::detail::sync_stream(stream)? |
Yup, happy to do that. |
…ef-batch-5 # Conflicts: # cpp/include/cudf/ast/expressions.hpp
This reverts commit c3f0834.
…ef-batch-5 # Conflicts: # cpp/src/interop/from_arrow_host.cu
…ef-batch-5 # Conflicts: # cpp/src/utilities/host_memory.cpp
misiugodfrey
left a comment
There was a problem hiding this comment.
Looks good to me. I see a few new includes, but I assume they were suggested by IWYU since they seem to be required.
|
/merge |
Description
This fifth batch migrates the remaining core libcudf headers and implementations from
rmm::cuda_stream_viewtocuda::stream_ref.It intentionally leaves the central stream helpers, such as
get_default_stream(), the stream pool,fork_streams, andjoin_streams, onrmm::cuda_stream_viewso this PR does not require Java, pylibcudf, or libcudf_streaming compatibility changes. Those helper updates are split into a downstream follow-up: vyasr#9Contributes to #23636
Checklist