Skip to content

Commit 0fc0dd6

Browse files
Upgrade target framework from .NET 6 to .NET 8
- Update all projects from net6.0 to net8.0 (keeping netstandard2.0 where applicable) - Update NuGet package projects and package paths for net8.0 - Suppress CS8981 warning for intentional lowercase type names (torch, nn, optim, etc.) - Update CI pipelines to use .NET 8 SDK - Bump version to 0.106.1
1 parent bdc2bcb commit 0fc0dd6

20 files changed

Lines changed: 56 additions & 45 deletions

File tree

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@
155155
<PropertyGroup>
156156
<LangVersion>latest</LangVersion> <!-- default to allowing all language features -->
157157
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
158+
<!-- CS8981: Lowercase type names may conflict with future C# keywords. Suppressed because
159+
TorchSharp intentionally uses lowercase names (torch, nn, optim, etc.) to mirror PyTorch's Python API. -->
160+
<NoWarn>$(NoWarn);CS8981</NoWarn>
158161
</PropertyGroup>
159162

160163
<!-- Need to explicitly set these properties for the -Intrinsics or -Netfx configurations becuase they are typically based off 'Debug' or 'Release' configs -->

RELEASENOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

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

5+
# NuGet Version 0.106.1
6+
7+
__Build/Infrastructure__:
8+
9+
Upgrade target framework from .NET 6 to .NET 8.<br/>
10+
Suppress CS8981 warning for intentional lowercase type names (e.g. `torch`, `nn`, `optim`) that mirror PyTorch's Python API.<br/>
11+
Update CI pipelines to use .NET 8 SDK.<br/>
12+
513
# NuGet Version 0.106.0
614

715
This release upgrades the libtorch backend to v2.10.0, using CUDA 12.8.

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
name: Ubuntu_x64
5555
# This reports the GLIB_ and GLIBCXX_ dependencies on the system which ends up getting baked into
5656
# the generated libTorchSharp.so (and partly determines which Linux systems that binary will
57-
# be usable on), then installs clang-7.0 (LibTorch likes this for building C++ 14), then installs .NET 6.0
57+
# be usable on), then installs clang-7.0 (LibTorch likes this for building C++ 14), then installs .NET 8.0
5858
prepScript: ${{ variables.LinuxPrepScript }}
5959
buildScript: dotnet build /p:SkipCuda=true -c
6060
testScript: dotnet test /p:SkipCuda=true --blame test/TorchSharpTest/TorchSharpTest.csproj -c
@@ -121,7 +121,7 @@ jobs:
121121
displayName: 'Use .NET Core sdk'
122122
inputs:
123123
packageType: sdk
124-
version: 6.0.402
124+
version: 8.0.x
125125
installationPath: $(Agent.ToolsDirectory)/dotnet
126126

127127
- script: ${{ variables.LinuxPrepScript }}
@@ -191,7 +191,7 @@ jobs:
191191
displayName: 'Use .NET Core sdk'
192192
inputs:
193193
packageType: sdk
194-
version: 6.0.402
194+
version: 8.0.x
195195
installationPath: $(Agent.ToolsDirectory)/dotnet
196196

197197
# Build libtorch CPU and clean immediately
@@ -635,7 +635,7 @@ jobs:
635635
displayName: 'Use .NET Core sdk'
636636
inputs:
637637
packageType: sdk
638-
version: 6.x
638+
version: 8.x
639639
installationPath: $(Agent.ToolsDirectory)/dotnet
640640

641641
- script: ${{ variables.LinuxPrepScript }}

build/BranchInfo.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<MajorVersion>0</MajorVersion>
44
<MinorVersion>106</MinorVersion>
5-
<PatchVersion>0</PatchVersion>
6-
<PreviousPackageVersion>0.105.2</PreviousPackageVersion>
5+
<PatchVersion>1</PatchVersion>
6+
<PreviousPackageVersion>0.106.0</PreviousPackageVersion>
77
</PropertyGroup>
88
</Project>

build/ci/job-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
displayName: 'Use .NET Core sdk'
3131
inputs:
3232
packageType: sdk
33-
version: 6.x
33+
version: 8.x
3434
installationPath: $(Agent.ToolsDirectory)/dotnet
3535
- script: $(_prepScript)
3636
displayName: Install build dependencies

pkg/FileRestitcher/FileRestitcher.Tests/FileRestitcher.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<!-- The Directory.Build.props initialize TargetFrameworks to multiple targets. We have to clear that out to set only the targets we support. -->
66
<TargetFrameworks></TargetFrameworks>
77

8-
<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net6.0</TargetFrameworks>
8+
<TargetFrameworks Condition="'$(SkipNetCoreBuild)' != 'true'">net8.0</TargetFrameworks>
99
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT' And '$(SkipNetFxBuild)' != 'true'">net472;$(TargetFrameworks)</TargetFrameworks>
10-
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net6.0</TargetFrameworks>
10+
<TargetFrameworks Condition="'$(TargetFrameworks)' == ''">net8.0</TargetFrameworks>
1111
<IsPackable>false</IsPackable>
1212
</PropertyGroup>
1313

pkg/TorchAudio/TorchAudio.nupkgproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Pack">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
55
<PackageDescription>.NET Bindings for TorchAudio. Requires reference to TorchSharp and one of libtorch-cpu, libtorch-cuda-$(CudaVersionDot), libtorch-cuda-$(CudaVersionDot)-win-x64 or libtorch-cuda-$(CudaVersionDot)-linux-x64 version $(LibTorchPackageVersion) to execute.</PackageDescription>
66
</PropertyGroup>
77

@@ -10,9 +10,9 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
14-
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
15-
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
13+
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
14+
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
15+
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
1616
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
1717
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
1818
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />

pkg/TorchSharp-cpu/TorchSharp-cpu.nupkgproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
55
<PackageDescription>TorchSharp makes PyTorch available for .NET users. This package combines the TorchSharp package with LibTorch $(LibTorchVersion) CPU support.</PackageDescription>
66
</PropertyGroup>
77

@@ -10,13 +10,13 @@
1010
<ProjectReference Include="..\libtorch-cpu\libtorch-cpu.nupkgproj" />
1111
</ItemGroup>
1212

13-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
13+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
18-
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
19-
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
17+
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
18+
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
19+
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
2020
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
2121
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
2222
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />

pkg/TorchSharp-cuda-linux/TorchSharp-cuda-linux.nupkgproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<PackageDescription>TorchSharp makes PyTorch available for .NET users. This package combines the TorchSharp package with LibTorch $(LibTorchVersion) CUDA $(CudaVersionDot) support for Linux.</PackageDescription>
66
</PropertyGroup>
77

@@ -10,13 +10,13 @@
1010
<ProjectReference Include="..\libtorch-cuda-12.8-linux-x64\libtorch-cuda-12.8-linux-x64.nupkgproj" />
1111
</ItemGroup>
1212

13-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
13+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
18-
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
19-
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
17+
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
18+
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
19+
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
2020
<Content Include="$(RepoRoot)\THIRD-PARTY-NOTICES.txt" Pack="true" PackagePath="LICENSE-LIBTORCH.txt" />
2121
<Content Include="$(RepoRoot)\LICENSE.txt" Pack="true" PackagePath="" />
2222
</ItemGroup>

pkg/TorchSharp-cuda-windows/TorchSharp-cuda-windows.nupkgproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
55
<PackageDescription>TorchSharp makes PyTorch available for .NET users. This package combines the TorchSharp package with LibTorch $(LibTorchVersion) CUDA $(CudaVersionDot) support for Windows.</PackageDescription>
66
</PropertyGroup>
77

@@ -10,13 +10,13 @@
1010
<ProjectReference Include="..\libtorch-cuda-12.8-win-x64\libtorch-cuda-12.8-win-x64.nupkgproj" />
1111
</ItemGroup>
1212

13-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
13+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).props" />
18-
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net6.0\$(MSBuildProjectName).targets" />
19-
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net6.0\_._" />
17+
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).props" />
18+
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\net8.0\$(MSBuildProjectName).targets" />
19+
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\net8.0\_._" />
2020
<Content Include="..\common\NormalPackage.props" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).props" />
2121
<Content Include="..\common\NormalPackage.targets" Pack="true" PackagePath="buildTransitive\netstandard2.0\$(MSBuildProjectName).targets" />
2222
<Content Include="..\empty.txt" Pack="true" PackagePath="lib\netstandard2.0\_._" />

0 commit comments

Comments
 (0)