Skip to content

Commit e8ab89d

Browse files
NiklasGustafssonNiklas Gustafsson
andauthored
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

Lines changed: 2 additions & 2 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.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

Lines changed: 2 additions & 23 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

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.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

Lines changed: 31 additions & 30 deletions
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

Lines changed: 1 addition & 4 deletions
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"/>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
618CA54EEF82A1DCA46FF1993D5807D9C0DEB0BAE147DA4974166A147CB562FA
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0822824C1DF267159A649AD4701518217C60B8F75DE056A26AB43958D8AB1622

0 commit comments

Comments
 (0)