Skip to content

Sequencing tasks on multiple streams w/ Events #81

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

Open
thedodd opened this issue Aug 11, 2022 · 1 comment
Open

Sequencing tasks on multiple streams w/ Events #81

thedodd opened this issue Aug 11, 2022 · 1 comment

Comments

@thedodd
Copy link
Contributor

thedodd commented Aug 11, 2022

The following doc snippets seem to indicate that this is not yet supported:

Events can also be used to sequence tasks on multiple streams within the same context by specifying dependent tasks (not supported yet by cust).
~ https://docs.rs/cust/latest/cust/event/index.html

and

Sequencing between multiple streams can be achieved using events, which are not currently supported by cust.
~ https://docs.rs/cust/latest/cust/stream/index.html

However, the following bit makes it seem as though it is indeed supported, even across different devices/contexts.

Make the stream wait on an event.

All future work submitted to the stream will wait for the event to complete. Synchronization is performed on the device, if possible. The event may originate from different context or device than the stream.
~ https://docs.rs/cust/latest/cust/stream/struct.Stream.html#method.wait_event

Just wondering what the state of cross-stream/cross-context Event-based synchronization is. I'm happy to just go ahead and test, but I figured I would ask. This seems to be something supported on the Cuda level, not necessarily something which would need to be implemented in cust, but I could be wrong.

Also, if this needs to be implemented, I'm wondering if folks might have some thoughts on current blockers and such?

@thedodd
Copy link
Contributor Author

thedodd commented Aug 11, 2022

Well, just reporting back here based on my initial experimentation.

  • Using events to synchronize work across multiple streams of the same device/context works.
  • I have not yet been able to test synchronization across multiple streams of different devices/contexts. So if others have been able to test, please advise.

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

No branches or pull requests

1 participant