dotnet / TorchSharp

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

ARM64 support #945

Open ProKn1fe opened 1 year ago

ProKn1fe commented 1 year ago

Any plans to support arm64 devices? Like Radxa Rock-5B or OrangePI 5. It in any cases throw this.

Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'TorchSharp, Version=0.98.1.0, Culture=neutral, PublicKeyToken=67b0e5e1da516a1c'. The system cannot find the file specified.
NiklasGustafsson commented 1 year ago

No current plans for those devices, but contributions are always welcomed -- the Mac/ARM64 is being contributed by folks outside the Microsoft team.

ProKn1fe commented 1 year ago

So basically what need to make buildable on arm to run?

GeorgeS2019 commented 1 year ago

https://github.com/pytorch/pytorch/issues/13130

As long as the PyTorch community is considering Arm64 an open issue, it will not be VERY VERY trivial for TorchSharp

ProKn1fe commented 1 year ago

Seems they already support arm targets as nvidia jetson https://github.com/pytorch/pytorch#nvidia-jetson-platforms

GeorgeS2019 commented 1 year ago

https://pytorch.org/get-started/locally/

This is where official ARM64 support is needed before TorchSharp (I assume) will remotely consider ARM64 image

NiklasGustafsson commented 1 year ago

So basically what need to make buildable on arm to run?

ARM64 on Windows or Linux?

Theoretically, we should just need the ARM64 libtorch binaries, and then a setup to run tests in Azure Pipelines for release purposes. It should be possible to bundle the CPU support in the same NuGet as the other platforms, but I haven't thought through how it would impact the CUDA packages.

ProKn1fe commented 1 year ago

ARM64 on Windows or Linux?

Linux

GeorgeS2019 commented 1 year ago

@NiklasGustafsson Make more sense with Arm64 on Windows.

image

MovGP0 commented 2 weeks ago

Builds on ARM64 are currently not working. Getting the following error: Visual Studio 2015, 2017 or 2019 required

Visual Studio is currently not available for ARM64. Visual Studio 2022 v17.4+ is supported on ARM64.

So maybe we should consider this possibility in the build scripts.

NiklasGustafsson commented 2 weeks ago

Well, there's no official distribution of libtorch for Windows / ARM64 (unless the team working on it has failed to let me know), so I wouldn't expect you to get much farther, anyway.