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
CUDA: Provide stream in async_done result #7453
Conversation
It's awkward to await on a `Stream.async_done()` for the purpose of enqueuing something new onto the stream, because there is no way to tell which stream finished from the completed future - this forces the user to maintain a mapping between futures and streams. This commit makes the result of the future be the stream on which operations completed, so that the user can obtain the stream from the completed future.
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.
Thanks for the patch, couple of minor things to look at else looks good. This new capability will be useful for e.g. data streams with non-uniform workloads.
Update numba/cuda/tests/cudadrv/test_streams.py Co-authored-by: stuartarchibald <stuartarchibald@users.noreply.github.com>
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.
Thanks for the patch!
Buildfarm ID: |
Passed. |
This is great, thank you @gmarkall, really useful for streams with non-uniform workloads, as @stuartarchibald said, such as the satellite data feeds I work with. |
It's awkward to await on a
Stream.async_done()
for the purpose of enqueuing something new onto the stream, because there is no way to tell which stream finished from the completed future - this forces the user to maintain a mapping between futures and streams.This PR makes the result of the future be the stream on which operations completed, so that the user can obtain the stream from the completed future.