NVIDIA / cuda-python

CUDA Python Low-level Bindings
https://nvidia.github.io/cuda-python/
Other
859 stars 68 forks source link

Compatibility with pytorch when backward propagation is required #53

Closed Ed4everU closed 2 months ago

Ed4everU commented 1 year ago

Dear Developers,

I find that, in my project, if I initialize the cuda-python package with cuInit(0), then when using the pytorch to train a neural network, the torch package will raise an error claiming that its c++ backend engine can't find the right CUDA stream. I've checked other parts thoughly and, only when seperating the usage of these two packages into two seperate functions, i.e. isolating the different streams, things can workout.

I'm wondering if there's a good solution for this issue or some abuse need to be avoided to eliminate this issue.

PS: I'm also wondering if there'll be further python wrapper support for cusolver, cublas like this user-friendly and highly productive package?

Looking forward to hearing from you! Great thanks for your attention!

Best regards, Mingran

leofang commented 3 months ago

Hi @Ed4everU sorry for lack of response and thanks for your compliments. Is this still an issue with the latest cuda-python?

leofang commented 2 months ago

Closing due to lack of response. Feel free to reach out should you hit issues with cuda-python.