Skip to content

Commit e8ab89d

Browse files
NiklasGustafssonNiklas Gustafsson
and
Niklas Gustafsson
authored
Upgrade to libtorch 2.5.1 (#1423)
* Upgrade to libtorch 2.5.1 --------- Co-authored-by: Niklas Gustafsson <[email protected]>
1 parent 8cdfdbd commit e8ab89d

18 files changed

+91
-107
lines changed

Directory.Build.props

+2-2
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.4.0.0</LibTorchPackageVersion>
23+
<LibTorchPackageVersion>2.5.1.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.4.0.0</LibTorchPackageVersion>
89+
<LibTorchPackageVersion>2.5.1.0</LibTorchPackageVersion>
9090
<LibTorchPackageVersion Condition="'$(TargetOS)' == 'mac' and '$(TargetArchitecture)' == 'x64'">2.2.2.0</LibTorchPackageVersion>
9191
<EnablePackageValidation>false</EnablePackageValidation>
9292
<VersionPrefix>$(LibTorchPackageVersion)</VersionPrefix>

Directory.Build.targets

+2-23
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@
1212
<NativeAssemblyReference Include="asmjit" />
1313
<NativeAssemblyReference Include="c10" />
1414
<NativeAssemblyReference Include="fbgemm" />
15-
<NativeAssemblyReference Include="fbjni" />
1615
<NativeAssemblyReference Include="libiomp5md" />
1716
<NativeAssemblyReference Include="libiompstubs5md" />
18-
<NativeAssemblyReference Include="pytorch_jni" />
1917
<NativeAssemblyReference Include="torch" />
2018
<NativeAssemblyReference Include="torch_cpu" />
2119
<NativeAssemblyReference Include="torch_global_deps" />
2220
<NativeAssemblyReference Include="uv" />
2321
</ItemGroup>
2422

25-
<!-- Windows CUDA 11.3 libtorch binary list used for examples and testing -->
23+
<!-- Windows CUDA 12.1 libtorch binary list used for examples and testing -->
2624
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and '$(OS)' == 'Windows_NT' and '$(TestUsesLibTorch)' == 'true' and ('$(TestCuda)' == 'true' and '$(SkipCuda)' != 'true') and '$(SkipNative)' != 'true' ">
2725
<NativeAssemblyReference Include="asmjit" Variant="cuda\" />
2826
<NativeAssemblyReference Include="c10" Variant="cuda\" />
@@ -47,14 +45,12 @@
4745
<NativeAssemblyReference Include="cusolverMg64_11" Variant="cuda\" />
4846
<NativeAssemblyReference Include="cusparse64_12" Variant="cuda\" />
4947
<NativeAssemblyReference Include="fbgemm" Variant="cuda\" />
50-
<NativeAssemblyReference Include="fbjni" Variant="cuda\" />
5148
<NativeAssemblyReference Include="libiomp5md" Variant="cuda\" />
5249
<NativeAssemblyReference Include="libiompstubs5md" Variant="cuda\" />
5350
<NativeAssemblyReference Include="nvJitLink_120_0" Variant="cuda\" />
5451
<NativeAssemblyReference Include="nvToolsExt64_1" Variant="cuda\" />
5552
<NativeAssemblyReference Include="nvrtc-builtins64_121" Variant="cuda\" />
5653
<NativeAssemblyReference Include="nvrtc64_120_0" Variant="cuda\" />
57-
<NativeAssemblyReference Include="pytorch_jni" Variant="cuda\" />
5854
<NativeAssemblyReference Include="torch" Variant="cuda\" />
5955
<NativeAssemblyReference Include="torch_cpu" Variant="cuda\" />
6056
<NativeAssemblyReference Include="torch_cuda" Variant="cuda\" />
@@ -63,28 +59,10 @@
6359
<NativeAssemblyReference Include="zlibwapi" Variant="cuda\" />
6460
</ItemGroup>
6561

66-
<!-- Mac x64 libtorch binary list used for examples and testing -->
67-
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and $([MSBuild]::IsOSPlatform('osx')) and '$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
68-
<NativeAssemblyReference Include="backend_with_compiler" />
69-
<NativeAssemblyReference Include="c10" />
70-
<NativeAssemblyReference Include="fbjni" />
71-
<NativeAssemblyReference Include="iomp5" />
72-
<NativeAssemblyReference Include="jitbackend_test" />
73-
<NativeAssemblyReference Include="pytorch_jni" />
74-
<NativeAssemblyReference Include="shm" />
75-
<NativeAssemblyReference Include="torch" />
76-
<NativeAssemblyReference Include="torch_cpu" />
77-
<NativeAssemblyReference Include="torch_global_deps" />
78-
<NativeAssemblyReference Include="torch_python" />
79-
<NativeAssemblyReference Include="torchbind_test" />
80-
</ItemGroup>
81-
8262
<!-- Mac arm64 libtorch binary list used for examples and testing -->
8363
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'arm64'and $([MSBuild]::IsOSPlatform('osx')) and '$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
8464
<NativeAssemblyReference Include="c10" />
85-
<NativeAssemblyReference Include="fbjni" />
8665
<NativeAssemblyReference Include="omp" />
87-
<NativeAssemblyReference Include="pytorch_jni" />
8866
<NativeAssemblyReference Include="shm" />
8967
<NativeAssemblyReference Include="torch" />
9068
<NativeAssemblyReference Include="torch_cpu" />
@@ -94,6 +72,7 @@
9472

9573
<!-- Linux CPU libtorch binary list used for examples and testing -->
9674
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'x64' and $([MSBuild]::IsOSPlatform('linux')) and '$(TestUsesLibTorch)' == 'true' and '$(SkipNative)' != 'true' ">
75+
<NativeAssemblyReference Include="aoti_custom_ops" />
9776
<NativeAssemblyReference Include="backend_with_compiler" />
9877
<NativeAssemblyReference Include="c10" />
9978
<NativeAssemblyReference Include="jitbackend_test" />

RELEASENOTES.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Releases, starting with 9/2/2021, are listed with the most recent release at the top.
44

5+
# NuGet Version 0.105.0
6+
7+
Move to libtorch 2.5.1. As with the 2.4.0 release, MacOS / Intel is no longer supported by libtorch, so TorchSharp doesn, either.
8+
59
# NuGet Version 0.104.0
610

711
This is a big change in implementation, but not as big in API surface area. Many of the builtin modules, but not all, were re-implemented in managed code calling into native code via the functional APIs. This has several advantages:

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ parameters:
99
# push them to the artifacts feed of the Azure CI project
1010
- name: BuildLibTorchPackages
1111
type: boolean
12-
default: false
12+
default: true
1313
- name: PushPackagesToFeed
1414
type: boolean
1515
default: false

build/BranchInfo.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22
<PropertyGroup>
33
<MajorVersion>0</MajorVersion>
4-
<MinorVersion>104</MinorVersion>
4+
<MinorVersion>105</MinorVersion>
55
<PatchVersion>0</PatchVersion>
6-
<PreviousPackageVersion>0.103.1</PreviousPackageVersion>
6+
<PreviousPackageVersion>0.104.0</PreviousPackageVersion>
77
</PropertyGroup>
88
</Project>

build/Dependencies.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

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

linux_cuda.txt

+31-30
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
293064 libbackend_with_compiler.so
2-
1126504 libc10.so
3-
1444824 libc10_cuda.so
4-
843617 libc10d_cuda_test.so
5-
22505 libcaffe2_nvrtc.so
6-
107496985 libcublas-37d11411.so.12
7-
515090264 libcublasLt-f97bfc2c.so.12
8-
695585 libcudart-9335f6a2.so.12
9-
104664 libcudnn.so.9
10-
240675313 libcudnn_adv.so.9
11-
4700665 libcudnn_cnn.so.9
12-
569612689 libcudnn_engines_precompiled.so.9
13-
9562545 libcudnn_engines_runtime_compiled.so.9
14-
3141321 libcudnn_graph.so.9
15-
86313377 libcudnn_heuristic.so.9
16-
108399185 libcudnn_ops.so.9
17-
283265 libgomp-98b21ff3.so.1
18-
253880 libjitbackend_test.so
19-
398408 libnnapi_backend.so
20-
43681 libnvToolsExt-847d78f2.so.1
21-
56875329 libnvrtc-b51b459d.so.12
22-
6846017 libnvrtc-builtins.so
23-
53625 libshm.so
24-
15704 libtorch.so
25-
503454193 libtorch_cpu.so
26-
1487160249 libtorch_cuda.so
27-
401400273 libtorch_cuda_linalg.so
28-
20817 libtorch_global_deps.so
29-
29034321 libtorch_python.so
30-
967256 libtorchbind_test.so
1+
331,816 libaoti_custom_ops.so
2+
288,672 libbackend_with_compiler.so
3+
1,215,456 libc10.so
4+
833,576 libc10d_cuda_test.so
5+
1,482,296 libc10_cuda.so
6+
22,545 libcaffe2_nvrtc.so
7+
107,496,985 libcublas-37d11411.so.12
8+
515,090,264 libcublasLt-f97bfc2c.so.12
9+
695,585 libcudart-9335f6a2.so.12
10+
104,664 libcudnn.so.9
11+
240,675,313 libcudnn_adv.so.9
12+
4,700,665 libcudnn_cnn.so.9
13+
569,612,689 libcudnn_engines_precompiled.so.9
14+
9,562,545 libcudnn_engines_runtime_compiled.so.9
15+
3,141,321 libcudnn_graph.so.9
16+
86,313,377 libcudnn_heuristic.so.9
17+
108,399,185 libcudnn_ops.so.9
18+
283,265 libgomp-98b21ff3.so.1
19+
244,496 libjitbackend_test.so
20+
390,312 libnnapi_backend.so
21+
56,875,329 libnvrtc-b51b459d.so.12
22+
6,846,017 libnvrtc-builtins.so
23+
43,681 libnvToolsExt-847d78f2.so.1
24+
53,625 libshm.so
25+
15,704 libtorch.so
26+
1,025,232 libtorchbind_test.so
27+
447,891,009 libtorch_cpu.so
28+
1,490,739,561 libtorch_cuda.so
29+
389,644,088 libtorch_cuda_linalg.so
30+
16,881 libtorch_global_deps.so
31+
28,364,592 libtorch_python.so

src/Redist/libtorch-cpu/libtorch-cpu.proj

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@
3434
<File Include="libtorch\lib\asmjit.dll" />
3535
<File Include="libtorch\lib\c10.dll" />
3636
<File Include="libtorch\lib\fbgemm.dll" />
37-
<File Include="libtorch\lib\fbjni.dll" />
3837
<File Include="libtorch\lib\libiomp5md.dll" />
3938
<File Include="libtorch\lib\libiompstubs5md.dll" />
40-
<File Include="libtorch\lib\pytorch_jni.dll" />
4139
<File Include="libtorch\lib\torch.dll" />
4240
<File Include="libtorch\lib\torch_cpu.dll" />
4341
<File Include="libtorch\lib\torch_global_deps.dll" />
@@ -46,8 +44,6 @@
4644
<ItemGroup Condition="'$(NativeTargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'mac'">
4745
<File Include="libtorch\lib\libc10.dylib" />
4846
<File Include="libtorch\lib\libshm.dylib" />
49-
<File Include="libtorch\lib\libfbjni.dylib" />
50-
<File Include="libtorch\lib\libpytorch_jni.dylib" />
5147
<!-- libomp.dylib is required for libtorch, but it is only bundled with libtorch 2.4.0 and above. -->
5248
<File Include="libtorch\lib\libomp.dylib"/>
5349
<File Include="libtorch\lib\libtorch.dylib" />
@@ -56,6 +52,7 @@
5652
<File Include="libtorch\lib\libtorch_python.dylib" />
5753
</ItemGroup>
5854
<ItemGroup Condition="'$(TargetOS)' == 'linux'">
55+
<File Include= "libtorch\lib\libaoti_custom_ops.so" />
5956
<File Include="libtorch\lib\libbackend_with_compiler.so"/>
6057
<File Include="libtorch\lib\libc10.so"/>
6158
<File Include="libtorch\lib\libgomp-98b21ff3.so.1"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
618CA54EEF82A1DCA46FF1993D5807D9C0DEB0BAE147DA4974166A147CB562FA
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0822824C1DF267159A649AD4701518217C60B8F75DE056A26AB43958D8AB1622
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
176F3C501E50694CEC2F23CA512CA36C0C268F523E90D91C8FCA57BED56A6A65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4C1E40EA4D78F97207CC9188F39C8B57F4BB2A45A2E8787EF96B9C14F226410F

src/Redist/libtorch-cuda-12.1/libtorch-cuda-12.1.proj

+3-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
<File Include= "libtorch\lib\cudnn64_9.dll" PackageSuffix="part1" />
3939
<File Include= "libtorch\lib\cudnn_graph64_9.dll" PackageSuffix="part1" />
4040
<File Include= "libtorch\lib\cudnn_heuristic64_9.dll" PackageSuffix="part1" />
41-
<File Include= "libtorch\lib\nvToolsExt64_1.dll" PackageSuffix="part6" />
4241
<File Include= "libtorch\lib\cudnn_engines_runtime_compiled64_9.dll" PackageSuffix="part1" />
4342
<File Include= "libtorch\lib\nvrtc64_120_0.dll" PackageSuffix="part1" />
4443

@@ -61,11 +60,10 @@
6160
<File Include= "libtorch\lib\cusolverMg64_11.dll" PackageSuffix="part6" />
6261
<File Include= "libtorch\lib\curand64_10.dll" PackageSuffix="part6" />
6362
<File Include= "libtorch\lib\fbgemm.dll" PackageSuffix="part6" />
64-
<File Include= "libtorch\lib\fbjni.dll" PackageSuffix="part6" />
6563
<File Include= "libtorch\lib\libiomp5md.dll" PackageSuffix="part6" />
6664
<File Include= "libtorch\lib\libiompstubs5md.dll" PackageSuffix="part6" />
67-
68-
<File Include= "libtorch\lib\pytorch_jni.dll" PackageSuffix="part7" />
65+
<File Include= "libtorch\lib\nvToolsExt64_1.dll" PackageSuffix="part6" />
66+
6967
<File Include= "libtorch\lib\cudnn_cnn64_9.dll" PackageSuffix="part7" />
7068
<File Include= "libtorch\lib\cusparse64_12.dll" PackageSuffix="part7" />
7169

@@ -82,6 +80,7 @@
8280
</ItemGroup>
8381

8482
<ItemGroup Condition="'$(TargetOS)' == 'linux'">
83+
<File Include= "libtorch\lib\libaoti_custom_ops.so" PackageSuffix="part1" />
8584
<File Include= "libtorch\lib\libbackend_with_compiler.so" PackageSuffix="part1" />
8685
<File Include= "libtorch\lib\libc10.so" PackageSuffix="part1" />
8786
<File Include= "libtorch\lib\libc10_cuda.so" PackageSuffix="part1" />
@@ -123,7 +122,6 @@
123122
<File Include= "libtorch\lib\libcudnn_heuristic.so.9" PackageSuffix="part6" />
124123
<File Include= "libtorch\lib\libnvrtc-b51b459d.so.12" PackageSuffix="part6" />
125124
<File Include= "libtorch\lib\libtorch_python.so" PackageSuffix="part6" />
126-
<File Include= "libtorch\lib\libnvrtc-b51b459d.so.12" PackageSuffix="part6" />
127125

128126
<File Include= "libtorch\lib\libtorch_cuda_linalg.so" PackageSuffix="part7-primary" FileUnstitchIndex="0" FileUnstitchStart="0" FileUnstitchSize="200000000" />
129127
<File Include= "libtorch\lib\libtorch_cuda_linalg.so" PackageSuffix="part7-fragment1" FileUnstitchIndex="1" FileUnstitchStart="200000000" FileUnstitchSize="-1" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4097D7D4869AFF57B6F2611907C8F46320FBEB5463D0561EA6BDE5AC6BEB8D35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4AF1F5C45F62AAE1C5F371DEE51918CDA310AD2F33DF39C8B2D3843C36164917
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9AFF48C4CCD8A00957F49F9C0A9B9DDD47F0AC0C4AADBFF7C9DCA49D7C331491

src/TorchSharp/Torch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ public static partial class torch
2020
{
2121
#if LIBTORCH_2_2_2_0
2222
const string libtorchPackageVersion = "2.2.2.0";
23-
#elif LIBTORCH_2_4_0_0
24-
const string libtorchPackageVersion = "2.4.0.0";
23+
#elif LIBTORCH_2_5_1_0
24+
const string libtorchPackageVersion = "2.5.1.0";
2525
#else
2626
#error "Please update libtorchPackageVersion to match LibTorchPackageVersion"
2727
#endif

windows_cuda.txt

+35-37
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
1-
358912 asmjit.dll
2-
828416 c10.dll
3-
358400 c10_cuda.dll
4-
16384 caffe2_nvrtc.dll
5-
98058240 cublas64_12.dll
6-
538818048 cublasLt64_12.dll
7-
527872 cudart64_12.dll
8-
438840 cudnn64_9.dll
9-
241576488 cudnn_adv64_9.dll
10-
4019752 cudnn_cnn64_9.dll
11-
588910632 cudnn_engines_precompiled64_9.dll
12-
8235560 cudnn_engines_runtime_compiled64_9.dll
13-
2160680 cudnn_graph64_9.dll
14-
85741608 cudnn_heuristic64_9.dll
15-
107721256 cudnn_ops64_9.dll
16-
190346752 cufft64_11.dll
17-
295936 cufftw64_11.dll
18-
4327424 cupti64_2023.1.1.dll
19-
63505408 curand64_10.dll
20-
110190080 cusolver64_11.dll
21-
77008384 cusolverMg64_11.dll
22-
262348288 cusparse64_12.dll
23-
4961280 fbgemm.dll
24-
344576 fbjni.dll
25-
2047000 libiomp5md.dll
26-
41496 libiompstubs5md.dll
27-
34385920 nvJitLink_120_0.dll
28-
48128 nvToolsExt64_1.dll
29-
7001600 nvrtc-builtins64_121.dll
30-
42161152 nvrtc64_120_0.dll
31-
192000 pytorch_jni.dll
32-
9728 torch.dll
33-
238000640 torch_cpu.dll
34-
923134464 torch_cuda.dll
35-
9728 torch_global_deps.dll
36-
195072 uv.dll
37-
89088 zlibwapi.dll
1+
358,912 asmjit.dll
2+
877,568 c10.dll
3+
379,392 c10_cuda.dll
4+
16,384 caffe2_nvrtc.dll
5+
98,058,240 cublas64_12.dll
6+
538,818,048 cublasLt64_12.dll
7+
527,872 cudart64_12.dll
8+
438,840 cudnn64_9.dll
9+
241,576,488 cudnn_adv64_9.dll
10+
4,019,752 cudnn_cnn64_9.dll
11+
588,910,632 cudnn_engines_precompiled64_9.dll
12+
8,235,560 cudnn_engines_runtime_compiled64_9.dll
13+
2,160,680 cudnn_graph64_9.dll
14+
85,741,608 cudnn_heuristic64_9.dll
15+
107,721,256 cudnn_ops64_9.dll
16+
190,346,752 cufft64_11.dll
17+
295,936 cufftw64_11.dll
18+
4,327,424 cupti64_2023.1.1.dll
19+
63,505,408 curand64_10.dll
20+
110,190,080 cusolver64_11.dll
21+
77,008,384 cusolverMg64_11.dll
22+
262,348,288 cusparse64_12.dll
23+
4,961,280 fbgemm.dll
24+
1,250,312 libiomp5md.dll
25+
41,992 libiompstubs5md.dll
26+
34,385,920 nvJitLink_120_0.dll
27+
7,001,600 nvrtc-builtins64_121.dll
28+
42,161,152 nvrtc64_120_0.dll
29+
48,128 nvToolsExt64_1.dll
30+
9,728 torch.dll
31+
249,325,056 torch_cpu.dll
32+
927,949,824 torch_cuda.dll
33+
9,728 torch_global_deps.dll
34+
195,072 uv.dll
35+
89,088 zlibwapi.dll
3836

0 commit comments

Comments
 (0)