-
Notifications
You must be signed in to change notification settings - Fork 914
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 stream parameters in pylibcudf IO APIs #17620
base: branch-25.02
Are you sure you want to change the base?
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. |
/ok to test |
/ok to test |
/ok to test |
/ok to test |
/ok to test |
/ok to test |
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.
How should we test this? We have a pretty convoluted stream testing framework in libcudf right now. I wonder if there is a cleaner way to do that kind of thing in pylibcudf, or if there is potential for reuse of the custom library.
@@ -20,4 +20,4 @@ cdef class AvroReaderOptionsBuilder: | |||
cpdef AvroReaderOptionsBuilder num_rows(self, size_type num_rows) | |||
cpdef AvroReaderOptions build(self) | |||
|
|||
cpdef TableWithMetadata read_avro(AvroReaderOptions options) | |||
cpdef TableWithMetadata read_avro(AvroReaderOptions options, Stream stream = *) |
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.
What does = *
do in Cython? I don't think I've used this syntax but I have seen it in a few places.
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.
Indicates the argument is optional: ref
if stream is None: | ||
stream = Stream() |
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.
We need to streamline this. Maybe we can use a default besides None
, or perhaps we need a cdef stream_or_default(stream)
function.
We can create streams from numba and cupy (and default streams). I think we should add tests to each of the IO test modules. And test that the stream param works from cupy, numba, and default streams. Eg. def test_read_parquet_with_numba_stream():
import numba
numba_stream = # create numba stream
plc.io.parquet.read_parquet(options, Stream(numba_stream))
... |
/ok to test |
/ok to test |
/ok to test |
We should address rapidsai/rmm#1770 before we merge this PR or anything like it in cudf. |
Description
Apart of #15163. As #13744 comes to a close, we can begin exposing the
streams
parameter to pylibcudf. This PR will focus on the IO APIs.Checklist