Skip to content

Commit bdc2bcb

Browse files
Upgrade Libtorch backend to 2.10 (#1522)
* initial attempt to upgrade libtorch to 2.10 * remove globaljson file * change cmake version on linux * resize linux nuggets * split part 8 dlls for linux * correctly split libtorch cuda part 8 for linux * remove not needed windows fragment * restitch files * update releasenotes
1 parent 377db7b commit bdc2bcb

26 files changed

+104
-64
lines changed

Directory.Build.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<SourceDir>$(RepoRoot)src/</SourceDir>
2121
<PkgDir>$(RepoRoot)pkg/</PkgDir>
2222

23-
<LibTorchPackageVersion>2.7.1.0</LibTorchPackageVersion>
23+
<LibTorchPackageVersion>2.10.0.0</LibTorchPackageVersion>
2424
<LibTorchPackageVersion Condition="'$(TargetOS)' == 'mac' and '$(TargetArchitecture)' == 'x64'">2.2.2.0</LibTorchPackageVersion>
2525

2626
<!-- when building on local machines the massive downloads get placed up one directory -->
@@ -86,7 +86,7 @@
8686
<!-- use stable versions for libtorch packages based on LibTorch version number scheme-->
8787
<!-- we manually update these -->
8888
<PropertyGroup Condition="'$(MSBuildProjectName.IndexOf(`libtorch-`))' != '-1'">
89-
<LibTorchPackageVersion>2.7.1.0</LibTorchPackageVersion>
89+
<LibTorchPackageVersion>2.10.0.0</LibTorchPackageVersion>
9090
<LibTorchPackageVersion Condition="'$(TargetOS)' == 'mac' and '$(TargetArchitecture)' == 'x64'">2.2.2.0</LibTorchPackageVersion>
9191
<EnablePackageValidation>false</EnablePackageValidation>
9292
<VersionPrefix>$(LibTorchPackageVersion)</VersionPrefix>
@@ -141,7 +141,7 @@
141141
<LibTorchCpuLocalNameSuffix>cpu</LibTorchCpuLocalNameSuffix>
142142
<LibTorchCudaLocalNameSuffix>cu$(CudaVersionNoDot)</LibTorchCudaLocalNameSuffix>
143143
<LibTorchArchiveCoreName Condition="'$(TargetOS)' == 'windows'">libtorch-win-shared-with-deps$(LibTorchDebug)</LibTorchArchiveCoreName>
144-
<LibTorchArchiveCoreName Condition="'$(TargetOS)' == 'linux'">libtorch-cxx11-abi-shared-with-deps</LibTorchArchiveCoreName>
144+
<LibTorchArchiveCoreName Condition="'$(TargetOS)' == 'linux'">libtorch-shared-with-deps</LibTorchArchiveCoreName>
145145
<LibTorchArchiveCoreName Condition="'$(TargetOS)' == 'mac'">libtorch-macos-x86_64</LibTorchArchiveCoreName>
146146
<LibTorchArchiveCoreName Condition="'$(TargetPlatform)' == 'mac-arm64'">libtorch-macos-arm64</LibTorchArchiveCoreName>
147147
<LibTorchCpuArchiveBase>$(LibTorchArchiveCoreName)-$(LibTorchVersion)$(LibTorchCpuArchiveNameSuffix)</LibTorchCpuArchiveBase>

Directory.Build.targets

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
<!-- Windows CPU libtorch binary list used for examples and testing -->
1111
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and '$(OS)' == 'Windows_NT' and '$(TestUsesLibTorch)' == 'true' and ('$(TestCuda)' != 'true' or '$(SkipCuda)' == 'true') and '$(SkipNative)' != 'true' ">
12-
<NativeAssemblyReference Include="asmjit" />
1312
<NativeAssemblyReference Include="c10" />
14-
<NativeAssemblyReference Include="fbgemm" />
1513
<NativeAssemblyReference Include="libiomp5md" />
1614
<NativeAssemblyReference Include="libiompstubs5md" />
1715
<NativeAssemblyReference Include="torch" />
@@ -22,7 +20,6 @@
2220

2321
<!-- Windows CUDA 12.1 libtorch binary list used for examples and testing -->
2422
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and '$(OS)' == 'Windows_NT' and '$(TestUsesLibTorch)' == 'true' and ('$(TestCuda)' == 'true' and '$(SkipCuda)' != 'true') and '$(SkipNative)' != 'true' ">
25-
<NativeAssemblyReference Include="asmjit" Variant="cuda\" />
2623
<NativeAssemblyReference Include="c10" Variant="cuda\" />
2724
<NativeAssemblyReference Include="c10_cuda" Variant="cuda\" />
2825
<NativeAssemblyReference Include="caffe2_nvrtc" Variant="cuda\" />
@@ -39,12 +36,12 @@
3936
<NativeAssemblyReference Include="cudnn_ops64_9" Variant="cuda\" />
4037
<NativeAssemblyReference Include="cufft64_11" Variant="cuda\" />
4138
<NativeAssemblyReference Include="cufftw64_11" Variant="cuda\" />
42-
<NativeAssemblyReference Include="cupti64_2025.1.0" Variant="cuda\" />
39+
<NativeAssemblyReference Include="cupti64_2025.1.1" Variant="cuda\" />
4340
<NativeAssemblyReference Include="curand64_10" Variant="cuda\" />
4441
<NativeAssemblyReference Include="cusolver64_11" Variant="cuda\" />
4542
<NativeAssemblyReference Include="cusolverMg64_11" Variant="cuda\" />
4643
<NativeAssemblyReference Include="cusparse64_12" Variant="cuda\" />
47-
<NativeAssemblyReference Include="fbgemm" Variant="cuda\" />
44+
<NativeAssemblyReference Include="nvperf_host" Variant="cuda\" />
4845
<NativeAssemblyReference Include="libiomp5md" Variant="cuda\" />
4946
<NativeAssemblyReference Include="libiompstubs5md" Variant="cuda\" />
5047
<NativeAssemblyReference Include="nvJitLink_120_0" Variant="cuda\" />

RELEASENOTES.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
## TorchSharp Release Notes
22

33
Releases, starting with 9/2/2021, are listed with the most recent release at the top.
4-
# NuGet Version 0.105.3
4+
5+
# NuGet Version 0.106.0
6+
7+
This release upgrades the libtorch backend to v2.10.0, using CUDA 12.8.
8+
9+
__Bug Fixes__:
10+
11+
#1511 Fix `THSNN_interpolate`.<br/>
12+
#1512 Fix `THSJIT_TensorType_sizes` signature.<br/>
13+
#1504 Fix ABI for `THSTorch_int64_to_scalar`.<br/>
14+
#1508 Remove invalid P/Invoke methods.<br/>
15+
#1518 Remove duplicate declarations in `THSTensor.h`.<br/>
516

617
__API Changes__:
718

8-
Fix `torch.jit.ScriptModule.zero_grad`.<br/>
9-
Add ReadOnlySpan overloads to many methods.<br/>
19+
#1503 Add ReadOnlySpan overloads to many methods.<br/>
20+
#1478 Fix `torch.jit.ScriptModule.zero_grad`.<br/>
21+
#1495 Make `torchvision.io.read_image` and `torchvision.io.read_image_async` allow subsequent opening of the file for reading.<br/>
22+
#1505 Add `THSTorch_scalar_to_bfloat16`.<br/>
23+
#1507 Improve Scalar to Complex performance.<br/>
24+
25+
__Build/Infrastructure__:
26+
27+
#1510 Support VS 2026 in `build.cmd`.<br/>
1028

1129
# NuGet Version 0.105.2
1230

azure-pipelines.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ variables:
2727
ldd --version && (/sbin/ldconfig -p | grep stdc++) && (strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep LIBCXX)
2828
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DE19EB17684BA42D
2929
sudo apt-get -y update
30-
sudo apt-get -y install cmake clang git libunwind8 curl libomp-dev libomp5 wget
30+
sudo apt-get -y install clang git libunwind8 curl libomp-dev libomp5 wget gpg
31+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
32+
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list
33+
sudo apt-get -y update
34+
sudo apt-get -y install cmake
35+
cmake --version
3136
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
3237
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
3338
sudo apt-get update; sudo apt-get install -y apt-transport-https && sudo apt-get update

build/BranchInfo.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22
<PropertyGroup>
33
<MajorVersion>0</MajorVersion>
4-
<MinorVersion>105</MinorVersion>
5-
<PatchVersion>2</PatchVersion>
6-
<PreviousPackageVersion>0.105.1</PreviousPackageVersion>
4+
<MinorVersion>106</MinorVersion>
5+
<PatchVersion>0</PatchVersion>
6+
<PreviousPackageVersion>0.105.2</PreviousPackageVersion>
77
</PropertyGroup>
88
</Project>

build/Dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- Other/Non-Core Product Dependencies -->
99
<PropertyGroup>
10-
<LibTorchVersion>2.7.1</LibTorchVersion>
10+
<LibTorchVersion>2.10.0</LibTorchVersion>
1111
<LibTorchVersion Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'mac'">2.2.2</LibTorchVersion>
1212
<CudaVersionDot>12.8</CudaVersionDot>
1313
<CudaVersionNoDot>128</CudaVersionNoDot>

global.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

pkg/libtorch-cuda-12.8-linux-x64-part8/libtorch-cuda-12.8-linux-x64-part8.nupkgproj renamed to pkg/libtorch-cuda-12.8-linux-x64-part8-fragment1/libtorch-cuda-12.8-linux-x64-part8-fragment1.nupkgproj

File renamed without changes.

pkg/libtorch-cuda-12.8-win-x64-part9-fragment3/libtorch-cuda-12.8-win-x64-part9-fragment3.nupkgproj renamed to pkg/libtorch-cuda-12.8-linux-x64-part8-primary/libtorch-cuda-12.8-linux-x64-part8-primary.nupkgproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
2-
32
<PropertyGroup>
43
<TargetFramework>netstandard2.0</TargetFramework>
54
</PropertyGroup>
5+
66
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
77
</ItemGroup>
88

99
<ItemGroup>
10-
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
11-
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
10+
<Content Include="..\common\RestitchPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
11+
<Content Include="..\common\RestitchPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
1212
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />
1313
<Content Include="$(RepoRoot)\THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="LICENSE-LIBTORCH.txt" />
1414
</ItemGroup>

pkg/libtorch-cuda-12.8-linux-x64-part9/libtorch-cuda-12.8-linux-x64-part9.nupkgproj renamed to pkg/libtorch-cuda-12.8-linux-x64-part9-fragment1/libtorch-cuda-12.8-linux-x64-part9-fragment1.nupkgproj

File renamed without changes.

0 commit comments

Comments
 (0)