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

cuda.parallel: Should stream be a required parameter? #3406

Open
shwina opened this issue Jan 15, 2025 · 0 comments
Open

cuda.parallel: Should stream be a required parameter? #3406

shwina opened this issue Jan 15, 2025 · 0 comments

Comments

@shwina
Copy link
Contributor

shwina commented Jan 15, 2025

In #3348 (comment), it came up that we may want to consider making stream a required argument wherever a CUDA stream can be passed.

At the moment, stream is not a required parameter and defaults to None (translating to nullptr or "default stream" at the C++ layer). This aligns with underlying C++ APIs which also use stream=0 as a default (example).

However, as pointed out in the discussion above, users can forget to pass a stream in situations like the following:

with stream as s:
    arr = cp.random.random(...)

reduce_into(..., d_in=arr, ...)  # forgot to pass s here for whatever reason

This is seemingly a broader problem in the ecosystem (any API from any library accepting a CUDA stream has the same problem). So it would be good to hear perspectives from e.g., @vyasr as I know cuDF is also considering exposing streams in their APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant