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

[FEA] Add Cython / Python wrappers for rmm::cuda_stream_pool #664

Closed
harrism opened this issue Dec 16, 2020 · 15 comments
Closed

[FEA] Add Cython / Python wrappers for rmm::cuda_stream_pool #664

harrism opened this issue Dec 16, 2020 · 15 comments
Assignees
Labels
feature request New feature or request inactive-30d Python Related to RMM Python API

Comments

@harrism
Copy link
Member

harrism commented Dec 16, 2020

I refrained from doing the Python for the CUDA stream pool added in #659 myself because I'm not sure what the right approach is for Python. But I think we should add a Python interface, so I'm opening this issue for discussion.

CC the usual suspects: @shwina @kkraus14 @pentschev @jakirkham

@harrism harrism added feature request New feature or request Python Related to RMM Python API labels Dec 16, 2020
@harrism
Copy link
Member Author

harrism commented Dec 16, 2020

Also CC @teju85 @afender @cjnolet as potential users.

@jakirkham
Copy link
Member

Thanks! Yeah checking with Peter when he's back from holiday sounds like the right approach 🙂

cc @quasiben (for vis)

@pentschev
Copy link
Member

I think this is a very useful feature for Python too. I think a good initial approach is to treat it as we do for the memory pool, at rmm.reinitialize the user decides whether to use a stream pool or not, then asking for a new non-default Stream object will return a stream from the pool. I think I may be oversimplifying things in my head and overlooking potential pitfalls, but nevertheless I think we may want to try to simplify usability in Python.

@shwina shwina self-assigned this Feb 9, 2021
@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@kkraus14
Copy link
Contributor

@shwina is this done with the new Cython classes for owning / non-owning streams?

@shwina
Copy link
Contributor

shwina commented Mar 11, 2021

@isVoid and I are still investigating stream use in Python, and working on a stream pool abstraction.

In our initial work, we found it more convenient to just use a Python list of Stream objects to hold a stream pool. This is because a Stream object in Python can be backed by more than just an rmm::cuda_stream, including Numba or CuPy owned streams. Whereas rmm::cuda_stream_pool is strictly a wrapper around a vector of rmm::cuda_stream objects.

We can keep this issue open until we have an implementation finalized, but I think we can close it safely.

@kkraus14
Copy link
Contributor

In our initial work, we found it more convenient to just use a Python list of Stream objects to hold a stream pool. This is because a Stream object in Python can be backed by more than just an rmm::cuda_stream, including Numba or CuPy owned streams. Whereas rmm::cuda_stream_pool is strictly a wrapper around a vector of rmm::cuda_stream objects.

Yes, but if everyone is creating their own pool of streams, that's quite a bit of streams to create which is non-free. Ideally we could all share a reasonably sized pool of streams in the future 😄

@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@jakirkham
Copy link
Member

PR ( #818 ) appears relevant

cc @divyegala (for awareness)

@divyegala
Copy link
Member

@jakirkham my use-case only needs the cython extensions for rmm::cuda_stream_pool. Should I also write the python extended class for it?

@jakirkham
Copy link
Member

Starting with Cython seems fine. Can always be extended for Python later as needed

@harrism
Copy link
Member Author

harrism commented Jul 20, 2021

Should we close this with #818, or do we need more Python?

@shwina
Copy link
Contributor

shwina commented Jul 20, 2021

There's no (immediate) need for a Python abstraction around a cuda_stream_pool in cuDF, but perhaps other libraries need it? @divyegala?

@divyegala
Copy link
Member

@shwina there's no immediate need in RAFT/cuML/cuGraph either

@shwina
Copy link
Contributor

shwina commented Jul 20, 2021

Thanks! Closing this out then.

@shwina shwina closed this as completed Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request inactive-30d Python Related to RMM Python API
Projects
None yet
Development

No branches or pull requests

6 participants