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

Support CUDA streams #1431

Open
medovina opened this issue Jan 1, 2025 · 2 comments
Open

Support CUDA streams #1431

medovina opened this issue Jan 1, 2025 · 2 comments
Assignees
Labels
Missing Feature question Further information is requested

Comments

@medovina
Copy link

medovina commented Jan 1, 2025

PyTorch includes CUDA streams, which let multiple GPU requests run in parallel.

However it appears that TorchSharp does not support CUDA streams. I searched the codebase and can't find anything like PyTorch's torch.cuda.Stream class, or C# wrappers for e.g. the wait_stream(), default_stream() and record_stream() methods.

@ozanMSFT ozanMSFT added question Further information is requested Missing Feature labels Jan 27, 2025
@ozanMSFT
Copy link
Contributor

hey @medovina , thanks for the heads up.

It seems currently we're missing this implementation, so I'm adding missing feature tag here for the implementation.

I've checked PyTorch wrapper for the libtorch, it is mostly depending on CUDA's API calls.
stream.py
Stream.cpp

We'll consider this in the future versions.

@ozanMSFT ozanMSFT self-assigned this Jan 29, 2025
@medovina
Copy link
Author

Great, thanks for considering this. Streams can be pretty important for good performance when performing inference on multiple threads, so I'd be very happy to see them supported in TorchSharp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing Feature question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants