dotnet / TorchSharp

A .NET library that provides access to the library that powers PyTorch.
MIT License
1.4k stars 181 forks source link

Can't find Cuda 11.* linux runtime for torch 2.1.* #1207

Open LittleLittleCloud opened 9 months ago

LittleLittleCloud commented 9 months ago

I believe it's more of a personal case, for most customers they can simply upgrade their GPU driver to >525 and use cuda 12 runtime. However, updating GPU driver is not an option to me so I'm stuck with Cuda 11.*

Anyway, I'm trying to use Torchsharp.PyBridge to load .pt weights directly from python. Torchsharp.PyBridge requries Torchsharp with version later than 0.101.3 and libtorch version later than 2.1.. However it seems that the latest libtorch version supported by all libtorch-cuda-11. runtimes on nuget is 2.0.. Which means that there's no cuda 11. runtime available on nuget if I want to use Torchsharp later than 0.101.*

So is there any plan to release a cuda 11 runtime package for Torchsharp 0.101 and libtorch 2.1.*? According to pytorch, it seems that Cuda 11.8 will be the earliest cuda version supported by libtorch 2.1.*, would really be appreciated if that runtime package is supported by Torchsharp

shaltielshmid commented 9 months ago

I have a possible solution - version 1.0.0 of TorchSharp.PyBridge doesn't require the changes that were added in TorchSharp 0.101.5, but I believe the published version still requires 0.101.1. It would be possible to publish a minor addition to version 1.0 of PyBridge which targets a lower version of TorchSharp. It would limit you to only loading in the model state dict and not the optimizers, and would also require testing and reviewing to make sure that everything works as expected. I'll look into it over the next few days.

NiklasGustafsson commented 9 months ago

Unfortunately, TorchSharp is currently not allocated enough staffing that we can afford to maintain support for two CUDA versions.

LittleLittleCloud commented 9 months ago

@NiklasGustafsson Understood, maybe I can try build libtorch 2.1.* for CUDA 11.8, is there any document on how torchsharp does that?

NiklasGustafsson commented 9 months ago

https://github.com/dotnet/TorchSharp/blob/main/DEVGUIDE.md