diff --git a/.vsts-dotnet-ci.yml b/.vsts-dotnet-ci.yml index 846f15f004..4d0a34fcaa 100644 --- a/.vsts-dotnet-ci.yml +++ b/.vsts-dotnet-ci.yml @@ -34,7 +34,7 @@ jobs: - template: /build/ci/job-template.yml parameters: architecture: arm - name: Ubuntu_x64_cross_arm_Net60 + name: Ubuntu_x64_cross_arm_Net80 buildScript: ./build.sh container: UbuntuCrossArmContainer customMatrixes: @@ -42,12 +42,12 @@ jobs: _configuration: Debug _config_short: DI _includeBenchmarkData: false - _targetFramework: net6.0 + _targetFramework: net8.0 Release_Build: _configuration: Release _config_short: RI _includeBenchmarkData: true - _targetFramework: net6.0 + _targetFramework: net8.0 innerLoop: true pool: name: NetCore-Public @@ -57,7 +57,7 @@ jobs: - template: /build/ci/job-template.yml parameters: architecture: arm64 - name: Ubuntu_x64_cross_arm64_Net60 + name: Ubuntu_x64_cross_arm64_Net80 buildScript: ./build.sh container: UbuntuCrossArm64Container customMatrixes: @@ -65,12 +65,12 @@ jobs: _configuration: Debug _config_short: DI _includeBenchmarkData: false - _targetFramework: net6.0 + _targetFramework: net8.0 Release_Build: _configuration: Release _config_short: RI _includeBenchmarkData: true - _targetFramework: net6.0 + _targetFramework: net8.0 innerLoop: true pool: name: NetCore-Public @@ -79,7 +79,7 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: Centos_x64_Net60 + name: Centos_x64_Net80 buildScript: ./build.sh container: CentosContainer innerLoop: true @@ -90,7 +90,7 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: Ubuntu_x64_Net60 + name: Ubuntu_x64_Net80 buildScript: ./build.sh container: UbuntuContainer innerLoop: true @@ -101,7 +101,7 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: MacOS_x64_Net60 + name: MacOS_x64_Net80 buildScript: ./build.sh innerLoop: true pool: @@ -111,19 +111,19 @@ jobs: - template: /build/ci/job-template.yml parameters: architecture: arm64 - name: MacOS_cross_arm64_Net6 + name: MacOS_cross_arm64_Net80 buildScript: ./build.sh customMatrixes: Debug_Build: _configuration: Debug _config_short: DI _includeBenchmarkData: false - _targetFramework: net6.0 + _targetFramework: net8.0 Release_Build: _configuration: Release _config_short: RI _includeBenchmarkData: true - _targetFramework: net6.0 + _targetFramework: net8.0 innerLoop: true pool: vmImage: macOS-12 @@ -131,10 +131,10 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: Windows_x64_Net60 + name: Windows_x64_Net80 buildScript: build.cmd innerLoop: true - vsTestConfiguration: "/Framework:.NETCoreApp,Version=v3.1" + vsTestConfiguration: "/Framework:.NETCoreApp,Version=v8.0" pool: name: NetCore-Public demands: ImageOverride -equals 1es-windows-2019-open @@ -142,33 +142,11 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: Windows_x64_NetFx461 - buildScript: build.cmd - customMatrixes: - Debug_Build: - _configuration: Debug - _config_short: DFX - _includeBenchmarkData: false - _targetFramework: net461 - Release_Build: - _configuration: Release - _config_short: RFX - _includeBenchmarkData: false - _targetFramework: net461 - innerLoop: true - vsTestConfiguration: "/Framework:.NETCoreApp,Version=v4.0" - pool: - name: NetCore-Public - demands: ImageOverride -equals 1es-windows-2019-open - helixQueue: Windows.10.Amd64.Open - -- template: /build/ci/job-template.yml - parameters: - name: Windows_x86_Net60 + name: Windows_x86_Net80 architecture: x86 buildScript: build.cmd innerLoop: true - vsTestConfiguration: "/Framework:.NETCoreApp,Version=v3.1" + vsTestConfiguration: "/Framework:.NETCoreApp,Version=v8.0" pool: name: NetCore-Public demands: ImageOverride -equals 1es-windows-2019-open diff --git a/README.ko-KR.md b/README.ko-KR.md index f1d0507893..b674e183c5 100644 --- a/README.ko-KR.md +++ b/README.ko-KR.md @@ -70,13 +70,12 @@ Install-Package Microsoft.ML | | Debug | Release | |:---|----------------:|------------------:| -|**CentOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net60&configuration=Centos_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net60&configuration=Centos_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Ubuntu**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net60&configuration=Ubuntu_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net60&configuration=Ubuntu_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**macOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net60&configuration=MacOS_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net60&configuration=MacOS_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows x64**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows FullFramework**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_NetFx461&configuration=Windows_x64_NetFx461%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_NetFx461&configuration=Windows_x64_NetFx461%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows x86**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net60&configuration=Windows_x86_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net60&configuration=Windows_x86_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows NetCore3.1**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**CentOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net80&configuration=Centos_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net80&configuration=Centos_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Ubuntu**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net80&configuration=Ubuntu_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net80&configuration=Ubuntu_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**macOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net80&configuration=MacOS_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net80&configuration=MacOS_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Windows x64**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Windows x86**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net80&configuration=Windows_x86_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net80&configuration=Windows_x86_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Windows NetCore3.1**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| ## 릴리즈 프로세스 및 버전 관리 diff --git a/README.md b/README.md index b2dd1b7a1c..590b31345b 100644 --- a/README.md +++ b/README.md @@ -66,13 +66,12 @@ To build ML.NET from source please visit our [developer guide](docs/project-docs | | Debug | Release | |:---|----------------:|------------------:| -|**CentOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net60&configuration=Centos_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net60&configuration=Centos_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Ubuntu**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net60&configuration=Ubuntu_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net60&configuration=Ubuntu_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**macOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net60&configuration=MacOS_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net60&configuration=MacOS_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows x64**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows FullFramework**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_NetFx461&configuration=Windows_x64_NetFx461%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_NetFx461&configuration=Windows_x64_NetFx461%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows x86**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net60&configuration=Windows_x86_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net60&configuration=Windows_x86_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| -|**Windows NetCore3.1**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net60&configuration=Windows_x64_Net60%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**CentOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net80&configuration=Centos_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Centos_x64_Net80&configuration=Centos_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Ubuntu**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net80&configuration=Ubuntu_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Ubuntu_x64_Net80&configuration=Ubuntu_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**macOS**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net80&configuration=MacOS_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=MacOS_x64_Net80&configuration=MacOS_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Windows x64**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Windows x86**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net80&configuration=Windows_x86_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x86_Net80&configuration=Windows_x86_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| +|**Windows NetCore3.1**|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Debug_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/machinelearning/MachineLearning-CI?branchName=main&jobName=Windows_x64_Net80&configuration=Windows_x64_Net80%20Release_Build)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=104&branchName=main)| ## Release process and versioning diff --git a/build/.night-build.yml b/build/.night-build.yml index 5ab9ebe9a6..5de5862267 100644 --- a/build/.night-build.yml +++ b/build/.night-build.yml @@ -30,19 +30,19 @@ resources: jobs: - template: /build/ci/job-template.yml parameters: - name: Centos_x64_Net60 + name: Centos_x64_Net80 buildScript: ./build.sh container: CentosContainer customMatrixes: Debug_Build: _configuration: Debug _config_short: DI - _targetFramework: net6.0 + _targetFramework: net8.0 _includeBenchmarkData: false Release_Build: _configuration: Release _config_short: RI - _targetFramework: net6.0 + _targetFramework: net8.0 _includeBenchmarkData: true nightlyBuild: true pool: @@ -67,7 +67,7 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: Windows_x64_Net60 + name: Windows_x64_Net80 buildScript: build.cmd customMatrixes: Debug_Build: diff --git a/build/.outer-loop-build.yml b/build/.outer-loop-build.yml index c159d4d0b6..590601c63b 100644 --- a/build/.outer-loop-build.yml +++ b/build/.outer-loop-build.yml @@ -31,7 +31,7 @@ resources: jobs: - template: /build/ci/job-template.yml parameters: - name: Centos_x64_Net60 + name: Centos_x64_Net80 buildScript: ./build.sh container: CentosContainer customMatrixes: @@ -48,7 +48,7 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: Ubuntu_x64_Net60 + name: Ubuntu_x64_Net80 buildScript: ./build.sh container: UbuntuContainer pool: @@ -56,14 +56,14 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: MacOS_x64_Net60 + name: MacOS_x64_Net80 buildScript: ./build.sh pool: vmImage: macOS-10.15 - template: /build/ci/job-template.yml parameters: - name: Windows_x64_Net60 + name: Windows_x64_Net80 buildScript: build.cmd customMatrixes: Debug_Build: @@ -79,32 +79,14 @@ jobs: - template: /build/ci/job-template.yml parameters: - name: Windows_x64_Net60 + name: Windows_x64_Net80 buildScript: build.cmd pool: vmImage: windows-2019 - template: /build/ci/job-template.yml parameters: - name: Windows_x64_NetFx461 - buildScript: build.cmd - customMatrixes: - Debug_Build: - _configuration: Debug - _config_short: DFX - _includeBenchmarkData: false - _targetFramework: net461 - Release_Build: - _configuration: Release - _config_short: RFX - _includeBenchmarkData: false - _targetFramework: net461 - pool: - vmImage: windows-2019 - -- template: /build/ci/job-template.yml - parameters: - name: Windows_x86_Net60 + name: Windows_x86_Net80 architecture: x86 buildScript: build.cmd pool: diff --git a/build/Codecoverage.proj b/build/Codecoverage.proj index 495323f85e..1ca3a078f2 100644 --- a/build/Codecoverage.proj +++ b/build/Codecoverage.proj @@ -2,7 +2,7 @@ - net6.0 + net8.0 diff --git a/build/ci/job-template.yml b/build/ci/job-template.yml index 3305f34655..a52d1e93c6 100644 --- a/build/ci/job-template.yml +++ b/build/ci/job-template.yml @@ -51,12 +51,12 @@ jobs: _configuration: Debug _config_short: D _includeBenchmarkData: false - _targetFramework: net6.0 + _targetFramework: net8.0 Release_Build: _configuration: Release _config_short: R _includeBenchmarkData: true - _targetFramework: net6.0 + _targetFramework: net8.0 ${{ if ne(parameters.customMatrixes, '') }}: ${{ insert }}: ${{ parameters.customMatrixes }} diff --git a/build/codecoverage-ci.yml b/build/codecoverage-ci.yml index 04422e73c8..c2f7124533 100644 --- a/build/codecoverage-ci.yml +++ b/build/codecoverage-ci.yml @@ -26,7 +26,7 @@ jobs: _configuration: Debug _config_short: D _includeBenchmarkData: false - _targetFramework: net6.0 + _targetFramework: net8.0 codeCoverage: true pool: name: NetCore-Public diff --git a/docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj b/docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj index e753ee59f6..b52edb3485 100644 --- a/docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj +++ b/docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 false $(NoWarn) diff --git a/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj b/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj index 8b40f06dae..d1aff979db 100644 --- a/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj +++ b/docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe false diff --git a/docs/samples/Microsoft.ML.Samples.OneDal/Microsoft.ML.Samples.OneDal.csproj b/docs/samples/Microsoft.ML.Samples.OneDal/Microsoft.ML.Samples.OneDal.csproj index 527354dab4..9259c586e4 100755 --- a/docs/samples/Microsoft.ML.Samples.OneDal/Microsoft.ML.Samples.OneDal.csproj +++ b/docs/samples/Microsoft.ML.Samples.OneDal/Microsoft.ML.Samples.OneDal.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 false diff --git a/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj b/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj index 3fba560fd5..59261c2061 100644 --- a/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj +++ b/docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe false diff --git a/eng/Versions.props b/eng/Versions.props index 13cf14b91d..a0a6e275f9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -66,8 +66,8 @@ 1.13.0.1 1.12.4 - 3.1.2 - 3.1.2 + 6.0.0 + 6.0.0 3.3.1 4.5.0 1.1.0-beta-20206-02 diff --git a/eng/helix.proj b/eng/helix.proj index dc532eb38d..74fd97808e 100644 --- a/eng/helix.proj +++ b/eng/helix.proj @@ -149,7 +149,7 @@ $(BUILD_SOURCESDIRECTORY)\artifacts\bin\%(ProjectsWithTargetFramework.Filename)\$(BuildConfig)\%(ProjectsWithTargetFramework.TargetFrameworks)\ $(BUILD_SOURCESDIRECTORY)\artifacts\bin\%(ProjectsWithTargetFramework.Filename)\$(BuildConfig)\%(ProjectsWithTargetFramework.TargetFrameworks)\win-x64 dotnet exec --roll-forward Major --runtimeconfig %(ProjectsWithTargetFramework.Filename).runtimeconfig.json --depsfile %(ProjectsWithTargetFramework.Filename).deps.json $(HelixCorrelationPayloadPath)/xunit-runner/tools/netcoreapp2.0/xunit.console.dll %(ProjectsWithTargetFramework.Filename).dll -notrait Category=SkipInCI -xml testResults.xml - $(HelixCorrelationPayloadPath)/xunit-runner/tools/net461/xunit.console.exe %(ProjectsWithTargetFramework.Filename).dll -notrait Category=SkipInCI -xml testResults.xml + $(HelixCorrelationPayloadPath)/xunit-runner/tools/net461/xunit.console.exe %(ProjectsWithTargetFramework.Filename).dll -notrait Category=SkipInCI -xml testResults.xml 01:00:00 00:30:00 $(WorkItemTimeout) diff --git a/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj b/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj index e95ca64713..83e32b606a 100644 --- a/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj +++ b/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 false diff --git a/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj b/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj index ed9f74ce97..f32cf4e25e 100644 --- a/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj +++ b/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 true false This package contains easy-to-use and high-performance libraries for data analysis and transformation. @@ -18,7 +18,7 @@ - + diff --git a/src/Microsoft.Extensions.ML/CompatibilitySuppressions.xml b/src/Microsoft.Extensions.ML/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.Extensions.ML/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.Extensions.ML/Microsoft.Extensions.ML.csproj b/src/Microsoft.Extensions.ML/Microsoft.Extensions.ML.csproj index 2970566af3..399d78b844 100644 --- a/src/Microsoft.Extensions.ML/Microsoft.Extensions.ML.csproj +++ b/src/Microsoft.Extensions.ML/Microsoft.Extensions.ML.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.Extensions.ML An integration package for ML.NET models on scalable web apps and services. diff --git a/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj b/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj index 7bd0f912b1..c77d8de227 100644 --- a/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj +++ b/src/Microsoft.ML.AutoML.Interactive/Microsoft.ML.AutoML.Interactive.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 false $(NoWarn) diff --git a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj index 6ecc501c11..4d5327a60d 100644 --- a/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj +++ b/src/Microsoft.ML.AutoML/Microsoft.ML.AutoML.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.AutoML ML.NET AutoML: Optimizes an ML pipeline for your dataset, by automatically locating the best feature engineering, model, and hyperparameters $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage @@ -20,8 +20,8 @@ - - + + diff --git a/src/Microsoft.ML.CodeGenerator/Microsoft.ML.CodeGenerator.csproj b/src/Microsoft.ML.CodeGenerator/Microsoft.ML.CodeGenerator.csproj index 58b6f74f1b..450ec8e2d0 100644 --- a/src/Microsoft.ML.CodeGenerator/Microsoft.ML.CodeGenerator.csproj +++ b/src/Microsoft.ML.CodeGenerator/Microsoft.ML.CodeGenerator.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.CodeGenerator ML.NET Code Generator $(NoWarn) diff --git a/src/Microsoft.ML.Console/Microsoft.ML.Console.csproj b/src/Microsoft.ML.Console/Microsoft.ML.Console.csproj index 78a1e768af..959ea8e395 100644 --- a/src/Microsoft.ML.Console/Microsoft.ML.Console.csproj +++ b/src/Microsoft.ML.Console/Microsoft.ML.Console.csproj @@ -1,7 +1,7 @@  - net6.0 + net8.0 Exe MML Microsoft.ML.Tools.Console.Console diff --git a/src/Microsoft.ML.Core/CommandLine/CmdParser.cs b/src/Microsoft.ML.Core/CommandLine/CmdParser.cs index fc97810663..d698877600 100644 --- a/src/Microsoft.ML.Core/CommandLine/CmdParser.cs +++ b/src/Microsoft.ML.Core/CommandLine/CmdParser.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Reflection; using System.Text; +using Microsoft.ML.Data; using Microsoft.ML.Internal.Utilities; using Microsoft.ML.Runtime; @@ -2015,6 +2016,10 @@ private void AppendSettingCore(IHostEnvironment env, StringBuilder sb, object va var buffer = new StringBuilder(); sb.Append(GetString(env, value, buffer)); } + else if (value is InternalDataKind) + { + sb.Append(((InternalDataKind)value).GetString()); + } else sb.Append(value.ToString()); } diff --git a/src/Microsoft.ML.Core/Microsoft.ML.Core.csproj b/src/Microsoft.ML.Core/Microsoft.ML.Core.csproj index cc342e96e1..316d2d7132 100644 --- a/src/Microsoft.ML.Core/Microsoft.ML.Core.csproj +++ b/src/Microsoft.ML.Core/Microsoft.ML.Core.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 Microsoft.ML true CORECLR diff --git a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`2.cs b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`2.cs index 162130dd91..8627f6f792 100644 --- a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`2.cs +++ b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`2.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable - using System; using System.Linq.Expressions; using System.Reflection; diff --git a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`3.cs b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`3.cs index 9117a1b488..5237513cbf 100644 --- a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`3.cs +++ b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`3.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable - using System; using System.Linq.Expressions; using System.Reflection; diff --git a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`4.cs b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`4.cs index cb0ae6451b..aba23de8de 100644 --- a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`4.cs +++ b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo1`4.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable - using System; using System.Linq.Expressions; using System.Reflection; diff --git a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo2`4.cs b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo2`4.cs index 1a4f9c72ff..3e4e76dd4d 100644 --- a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo2`4.cs +++ b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo2`4.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable - using System; using System.Linq.Expressions; using System.Reflection; diff --git a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`3.cs b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`3.cs index 91c1c0d747..4f63f11332 100644 --- a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`3.cs +++ b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`3.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable - using System; using System.Linq.Expressions; using System.Reflection; diff --git a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`4.cs b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`4.cs index 51b8dbbe34..3c6c5c9c4f 100644 --- a/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`4.cs +++ b/src/Microsoft.ML.Core/Utilities/FuncInstanceMethodInfo3`4.cs @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#nullable enable - using System; using System.Linq.Expressions; using System.Reflection; diff --git a/src/Microsoft.ML.Core/Utilities/Random.cs b/src/Microsoft.ML.Core/Utilities/Random.cs index 137ce5d45d..2d0ea4a4ed 100644 --- a/src/Microsoft.ML.Core/Utilities/Random.cs +++ b/src/Microsoft.ML.Core/Utilities/Random.cs @@ -162,7 +162,7 @@ private static uint GetSeed(Random rng) } } - public float NextSingle() + public override float NextSingle() { NextState(); return GetSingle(); diff --git a/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs b/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs index f50ecc9174..db8de176bf 100644 --- a/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs +++ b/src/Microsoft.ML.Core/Utilities/ResourceManagerUtils.cs @@ -272,7 +272,7 @@ private async Task DownloadResource(IHostEnvironment env, IChannel ch response.EnsureSuccessStatusCode(); IEnumerable headers; var hasHeader = response.Headers.TryGetValues("content-length", out headers); - if (uri.Host == "aka.ms" && IsRedirectToDefaultPage(uri.AbsoluteUri)) + if (uri.Host == "aka.ms" && await IsRedirectToDefaultPage(uri.AbsoluteUri)) throw new NotSupportedException($"The provided url ({uri}) redirects to the default url ({DefaultUrl})"); if (!hasHeader || !long.TryParse(headers.First(), out var size)) size = 10000000; @@ -306,31 +306,19 @@ private async Task DownloadResource(IHostEnvironment env, IChannel ch /// This method checks whether or not the provided aka.ms url redirects to /// Microsoft's homepage, as the default faulty aka.ms URLs redirect to https://www.microsoft.com/?ref=aka . /// The provided url to check - public bool IsRedirectToDefaultPage(string url) + public async Task IsRedirectToDefaultPage(string url) { - try + var httpClient = new HttpClient(new HttpClientHandler { AllowAutoRedirect = false }); + var response = await httpClient.GetAsync(url); + + if (response.StatusCode == HttpStatusCode.Redirect && response.Headers.Location.AbsolutePath == "https://www.microsoft.com/?ref=aka") { - var request = WebRequest.Create(url); - // FileWebRequests cannot be redirected to default aka.ms webpage - if (request.GetType() == typeof(FileWebRequest)) - return false; - HttpWebRequest httpWebRequest = (HttpWebRequest)request; - httpWebRequest.AllowAutoRedirect = false; - HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); + return true; } - catch (WebException e) + else { - HttpWebResponse webResponse = (HttpWebResponse)e.Response; - // Redirects to default url - if (webResponse.StatusCode == HttpStatusCode.Redirect && webResponse.Headers["Location"] == "https://www.microsoft.com/?ref=aka") - return true; - // Redirects to another url - else if (webResponse.StatusCode == HttpStatusCode.MovedPermanently) - return false; - else - return false; + return false; } - return false; } public static ResourceDownloadResults GetErrorMessage(out string errorMessage, params ResourceDownloadResults[] result) diff --git a/src/Microsoft.ML.CpuMath/AvxIntrinsics.cs b/src/Microsoft.ML.CpuMath/AvxIntrinsics.cs index 4367957066..c429adf4fa 100644 --- a/src/Microsoft.ML.CpuMath/AvxIntrinsics.cs +++ b/src/Microsoft.ML.CpuMath/AvxIntrinsics.cs @@ -15,7 +15,7 @@ using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; using Microsoft.ML.Internal.CpuMath.Core; -using nuint = System.UInt64; +using nUInt = System.UInt64; namespace Microsoft.ML.Internal.CpuMath { @@ -202,8 +202,8 @@ public static unsafe void MatMul(AlignedArray mat, AlignedArray src, AlignedArra while (pSrcCurrent < pSrcEnd) { float* pMatTemp = pMatCurrent; - Contracts.Assert(((nuint)(pMatTemp) % 32) == 0); - Contracts.Assert(((nuint)(pSrcCurrent) % 32) == 0); + Contracts.Assert(((nUInt)(pMatTemp) % 32) == 0); + Contracts.Assert(((nUInt)(pSrcCurrent) % 32) == 0); // The JIT will only fold away unaligned loads due to the semantics behind // the VEX-encoding of the memory operand for `ins xmm, xmm, [mem]`. Since @@ -333,7 +333,7 @@ public static unsafe void MatMulTran(AlignedArray mat, AlignedArray src, Aligned while (pDstCurrent < pDstEnd) { float* pMatTemp = pMatCurrent; - Contracts.Assert(((nuint)(pMatTemp) % 32) == 0); + Contracts.Assert(((nUInt)(pMatTemp) % 32) == 0); // The JIT will only fold away unaligned loads due to the semantics behind // the VEX-encoding of the memory operand for `ins xmm, xmm, [mem]`. Since @@ -380,8 +380,8 @@ public static unsafe void MatMulTran(AlignedArray mat, AlignedArray src, Aligned { float* pMatTemp = pMatCurrent; - Contracts.Assert(((nuint)(pMatTemp) % 32) == 0); - Contracts.Assert(((nuint)(pDstCurrent) % 32) == 0); + Contracts.Assert(((nUInt)(pMatTemp) % 32) == 0); + Contracts.Assert(((nUInt)(pDstCurrent) % 32) == 0); // The JIT will only fold away unaligned loads due to the semantics behind // the VEX-encoding of the memory operand for `ins xmm, xmm, [mem]`. Since @@ -466,7 +466,7 @@ public static unsafe void Scale(float scale, Span dst) int length = dst.Length; Vector256 scaleVector256 = Vector256.Create(scale); - nuint address = (nuint)(pd); + nUInt address = (nUInt)(pd); int misalignment = (int)(address % 32); int remainder = 0; @@ -524,7 +524,7 @@ public static unsafe void Scale(float scale, Span dst) // when it doesn't cross a cache-line/page boundary, we will just assert // that the alignment is correct and allow for the more-efficient codegen. - Contracts.Assert(((nuint)(pDstCurrent) % 32) == 0); + Contracts.Assert(((nUInt)(pDstCurrent) % 32) == 0); Vector256 temp = Avx.LoadVector256(pDstCurrent); temp = Avx.Multiply(scaleVector256, temp); Avx.Store(pDstCurrent, temp); @@ -979,7 +979,7 @@ public static unsafe float Sum(ReadOnlySpan src) int length = src.Length; Vector256 result = Vector256.Zero; - nuint address = (nuint)(pValues); + nUInt address = (nUInt)(pValues); int misalignment = (int)(address % 32); int remainder = 0; @@ -1026,7 +1026,7 @@ public static unsafe float Sum(ReadOnlySpan src) // when it doesn't cross a cache-line/page boundary, we will just assert // that the alignment is correct and allow for the more-efficient codegen. - Contracts.Assert(((nuint)(pValues) % 32) == 0); + Contracts.Assert(((nUInt)(pValues) % 32) == 0); result = Avx.Add(result, Avx.LoadVector256(pValues)); } } diff --git a/src/Microsoft.ML.CpuMath/CompatibilitySuppressions.xml b/src/Microsoft.ML.CpuMath/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..fba022d539 --- /dev/null +++ b/src/Microsoft.ML.CpuMath/CompatibilitySuppressions.xml @@ -0,0 +1,12 @@ + + + + + PKV006 + .NETCoreApp,Version=v3.1 + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.CpuMath/CpuMathUtils.netstandard.cs b/src/Microsoft.ML.CpuMath/CpuMathUtils.netstandard.cs deleted file mode 100644 index 2c8fcf15c9..0000000000 --- a/src/Microsoft.ML.CpuMath/CpuMathUtils.netstandard.cs +++ /dev/null @@ -1,450 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using Microsoft.ML.Internal.CpuMath.Core; - -namespace Microsoft.ML.Internal.CpuMath -{ - [BestFriend] - internal static partial class CpuMathUtils - { - // The count of bytes in Vector128, corresponding to _cbAlign in AlignedArray - private const int Vector128Alignment = 16; - - [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static int GetVectorAlignment() - => Vector128Alignment; - - /// - /// - /// - /// if 's alignment is suitable to SSE instructions. Returns - /// if 's alignment is ok and otherwise. - /// - /// The vector being checked. - /// Whether is aligned well. - private static bool Compat(AlignedArray a) - { - Contracts.AssertValue(a); - Contracts.Assert(a.Size > 0); - return a.CbAlign % Vector128Alignment == 0; - } - - private static unsafe float* Ptr(AlignedArray a, float* p) - { - Contracts.AssertValue(a); - float* q = p + a.GetBase((long)p); - Contracts.Assert(((long)q & (Vector128Alignment - 1)) == 0); - return q; - } - - /// - /// Compute the product of matrix (the matrix is flattened because its type is instead of a matrix) - /// and a vector . - /// - /// Whether to transpose before doing any computation. - /// If is , is a m-by-n matrix, and the value at the i-th row and the j-th column is indexed by i * n + j in . - /// If is , would be viewed a n-by-m matrix, and the value at the i-th row and the j-th column in the transposed matrix is indexed by j * m + i in the - /// original . - /// A n-by-1 matrix, which is also a vector. - /// A m-by-1 matrix, which is also a vector. - /// The truncation level of . For example, if is 2, - /// will be considered as a 2-by-1 matrix and therefore elements after its 2nd element will be ignored. If no truncation should happen, - /// set to the length of . - public static void MatrixTimesSource(bool tran, AlignedArray mat, AlignedArray src, AlignedArray dst, int crun) - { - Contracts.Assert(Compat(mat)); - Contracts.Assert(Compat(src)); - Contracts.Assert(Compat(dst)); - Contracts.Assert(mat.Size == dst.Size * src.Size); - - unsafe - { - fixed (float* pmat = &mat.Items[0]) - fixed (float* psrc = &src.Items[0]) - fixed (float* pdst = &dst.Items[0]) - { - if (!tran) - { - Contracts.Assert(0 <= crun && crun <= dst.Size); - Thunk.MatMul(Ptr(mat, pmat), Ptr(src, psrc), Ptr(dst, pdst), crun, src.Size); - } - else - { - Contracts.Assert(0 <= crun && crun <= src.Size); - Thunk.MatMulTran(Ptr(mat, pmat), Ptr(src, psrc), Ptr(dst, pdst), dst.Size, crun); - } - } - } - } - - public static void MatrixTimesSource(AlignedArray mat, ReadOnlySpan rgposSrc, AlignedArray srcValues, - int posMin, int iposMin, int iposLim, AlignedArray dst, int crun) - { - Contracts.Assert(Compat(mat)); - Contracts.Assert(Compat(srcValues)); - Contracts.Assert(Compat(dst)); - Contracts.Assert(0 <= iposMin && iposMin <= iposLim && iposLim <= rgposSrc.Length); - Contracts.Assert(mat.Size == dst.Size * srcValues.Size); - - if (iposMin >= iposLim) - { - dst.ZeroItems(); - return; - } - Contracts.AssertNonEmpty(rgposSrc); - unsafe - { - fixed (float* pdst = &dst.Items[0]) - fixed (float* pmat = &mat.Items[0]) - fixed (float* psrc = &srcValues.Items[0]) - fixed (int* ppossrc = &rgposSrc[0]) - { - Contracts.Assert(0 <= crun && crun <= dst.Size); - Thunk.MatMulP(Ptr(mat, pmat), ppossrc, Ptr(srcValues, psrc), posMin, iposMin, iposLim, Ptr(dst, pdst), crun, srcValues.Size); - } - } - } - - // dst += a - public static void Add(float a, Span dst) - { - Contracts.AssertNonEmpty(dst); - - unsafe - { - fixed (float* pdst = &MemoryMarshal.GetReference(dst)) - Thunk.AddScalarU(a, pdst, dst.Length); - } - } - - public static void Scale(float a, Span dst) - { - Contracts.AssertNonEmpty(dst); - - unsafe - { - fixed (float* pd = &MemoryMarshal.GetReference(dst)) - Thunk.Scale(a, pd, dst.Length); - } - } - - // dst = a * src - public static void Scale(float a, ReadOnlySpan src, Span dst, int count) - { - Contracts.AssertNonEmpty(src); - Contracts.Assert(0 < count && count <= src.Length); - Contracts.AssertNonEmpty(dst); - Contracts.Assert(count <= dst.Length); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - fixed (float* pdst = &MemoryMarshal.GetReference(dst)) - { - Thunk.ScaleSrcU(a, psrc, pdst, count); - } - } - } - - // dst[i] = a * (dst[i] + b) - public static void ScaleAdd(float a, float b, Span dst) - { - Contracts.AssertNonEmpty(dst); - - unsafe - { - fixed (float* pdst = &MemoryMarshal.GetReference(dst)) - Thunk.ScaleAddU(a, b, pdst, dst.Length); - } - } - - public static void AddScale(float a, ReadOnlySpan src, Span dst, int count) - { - Contracts.AssertNonEmpty(src); - Contracts.Assert(0 < count && count <= src.Length); - Contracts.AssertNonEmpty(dst); - Contracts.Assert(count <= dst.Length); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - fixed (float* pdst = &MemoryMarshal.GetReference(dst)) - Thunk.AddScaleU(a, psrc, pdst, count); - } - } - - public static void AddScale(float a, ReadOnlySpan src, ReadOnlySpan indices, Span dst, int count) - { - Contracts.AssertNonEmpty(src); - Contracts.Assert(0 < count && count <= src.Length); - Contracts.AssertNonEmpty(indices); - Contracts.Assert(count <= indices.Length); - Contracts.AssertNonEmpty(dst); - Contracts.Assert(count < dst.Length); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - fixed (int* pi = &MemoryMarshal.GetReference(indices)) - fixed (float* pdst = &MemoryMarshal.GetReference(dst)) - Thunk.AddScaleSU(a, psrc, pi, pdst, count); - } - } - - public static void AddScaleCopy(float a, ReadOnlySpan src, ReadOnlySpan dst, Span res, int count) - { - Contracts.AssertNonEmpty(dst); - Contracts.Assert(0 < count && count <= dst.Length); - Contracts.AssertNonEmpty(src); - Contracts.Assert(count <= src.Length); - Contracts.AssertNonEmpty(res); - Contracts.Assert(count <= res.Length); - - unsafe - { - fixed (float* pdst = &MemoryMarshal.GetReference(dst)) - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - fixed (float* pres = &MemoryMarshal.GetReference(res)) - Thunk.AddScaleCopyU(a, psrc, pdst, pres, count); - } - } - - public static void Add(ReadOnlySpan src, Span dst, int count) - { - Contracts.AssertNonEmpty(src); - Contracts.Assert(0 < count && count <= src.Length); - Contracts.AssertNonEmpty(dst); - Contracts.Assert(count <= dst.Length); - - unsafe - { - fixed (float* ps = &MemoryMarshal.GetReference(src)) - fixed (float* pd = &MemoryMarshal.GetReference(dst)) - Thunk.AddU(ps, pd, count); - } - } - - public static void Add(ReadOnlySpan src, ReadOnlySpan indices, Span dst, int count) - { - Contracts.AssertNonEmpty(src); - Contracts.Assert(0 < count && count <= src.Length); - Contracts.AssertNonEmpty(indices); - Contracts.Assert(count <= indices.Length); - Contracts.AssertNonEmpty(dst); - Contracts.Assert(count < dst.Length); - - unsafe - { - fixed (float* ps = &MemoryMarshal.GetReference(src)) - fixed (int* pi = &MemoryMarshal.GetReference(indices)) - fixed (float* pd = &MemoryMarshal.GetReference(dst)) - Thunk.AddSU(ps, pi, pd, count); - } - } - - public static void MulElementWise(ReadOnlySpan src1, ReadOnlySpan src2, Span dst, int count) - { - Contracts.AssertNonEmpty(src1); - Contracts.Assert(0 < count && count <= src1.Length); - Contracts.AssertNonEmpty(src2); - Contracts.Assert(0 < count && count <= src2.Length); - Contracts.AssertNonEmpty(dst); - unsafe - { - fixed (float* ps1 = &MemoryMarshal.GetReference(src1)) - fixed (float* ps2 = &MemoryMarshal.GetReference(src2)) - fixed (float* pd = &MemoryMarshal.GetReference(dst)) - Thunk.MulElementWiseU(ps1, ps2, pd, count); - } - } - - public static float Sum(ReadOnlySpan src) - { - Contracts.AssertNonEmpty(src); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - return Thunk.Sum(psrc, src.Length); - } - } - - public static float SumSq(ReadOnlySpan src) - { - Contracts.AssertNonEmpty(src); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - return Thunk.SumSqU(psrc, src.Length); - } - } - - public static float SumSq(float mean, ReadOnlySpan src) - { - Contracts.AssertNonEmpty(src); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - return (mean == 0 ? Thunk.SumSqU(psrc, src.Length) : Thunk.SumSqDiffU(mean, psrc, src.Length)); - } - } - - public static float SumAbs(ReadOnlySpan src) - { - Contracts.AssertNonEmpty(src); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - return Thunk.SumAbsU(psrc, src.Length); - } - } - - public static float SumAbs(float mean, ReadOnlySpan src) - { - Contracts.AssertNonEmpty(src); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - return (mean == 0 ? Thunk.SumAbsU(psrc, src.Length) : Thunk.SumAbsDiffU(mean, psrc, src.Length)); - } - } - - public static float MaxAbs(ReadOnlySpan src) - { - Contracts.AssertNonEmpty(src); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - return Thunk.MaxAbsU(psrc, src.Length); - } - } - - public static float MaxAbsDiff(float mean, ReadOnlySpan src) - { - Contracts.AssertNonEmpty(src); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - return Thunk.MaxAbsDiffU(mean, psrc, src.Length); - } - } - - public static float DotProductDense(ReadOnlySpan a, ReadOnlySpan b, int count) - { - Contracts.AssertNonEmpty(a); - Contracts.AssertNonEmpty(b); - Contracts.Assert(0 < count); - Contracts.Assert(a.Length >= count); - Contracts.Assert(b.Length >= count); - - unsafe - { - fixed (float* pa = &MemoryMarshal.GetReference(a)) - fixed (float* pb = &MemoryMarshal.GetReference(b)) - return Thunk.DotU(pa, pb, count); - } - } - - public static float DotProductSparse(ReadOnlySpan a, ReadOnlySpan b, ReadOnlySpan indices, int count) - { - Contracts.AssertNonEmpty(a); - Contracts.AssertNonEmpty(b); - Contracts.Assert(0 < count); - Contracts.Assert(count < a.Length); - Contracts.Assert(count <= b.Length); - Contracts.Assert(count <= indices.Length); - - unsafe - { - fixed (float* pa = &MemoryMarshal.GetReference(a)) - fixed (float* pb = &MemoryMarshal.GetReference(b)) - fixed (int* pi = &MemoryMarshal.GetReference(indices)) - return Thunk.DotSU(pa, pb, pi, count); - } - } - - public static float L2DistSquared(ReadOnlySpan a, ReadOnlySpan b, int count) - { - Contracts.AssertNonEmpty(a); - Contracts.AssertNonEmpty(b); - Contracts.Assert(0 < count && count <= a.Length); - Contracts.Assert(count <= b.Length); - - unsafe - { - fixed (float* pa = &MemoryMarshal.GetReference(a)) - fixed (float* pb = &MemoryMarshal.GetReference(b)) - return Thunk.Dist2(pa, pb, count); - } - } - - public static void ZeroMatrixItems(AlignedArray dst, int ccol, int cfltRow, int[] indices) - { - Contracts.Assert(0 < ccol && ccol <= cfltRow); - - unsafe - { - fixed (float* pdst = &dst.Items[0]) - fixed (int* pi = &indices[0]) - { - if (ccol == cfltRow) - Thunk.ZeroItemsU(Ptr(dst, pdst), dst.Size, pi, indices.Length); - else - Thunk.ZeroMatrixItemsCore(Ptr(dst, pdst), dst.Size, ccol, cfltRow, pi, indices.Length); - } - } - } - - public static void SdcaL1UpdateDense(float primalUpdate, int count, ReadOnlySpan src, float threshold, Span v, Span w) - { - Contracts.AssertNonEmpty(src); - Contracts.Assert(count <= src.Length); - Contracts.AssertNonEmpty(v); - Contracts.Assert(count <= v.Length); - Contracts.AssertNonEmpty(w); - Contracts.Assert(count <= w.Length); - Contracts.Assert(count > 0); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(src)) - fixed (float* pd1 = &MemoryMarshal.GetReference(v)) - fixed (float* pd2 = &MemoryMarshal.GetReference(w)) - Thunk.SdcaL1UpdateU(primalUpdate, psrc, threshold, pd1, pd2, count); - } - } - - public static void SdcaL1UpdateSparse(float primalUpdate, int count, ReadOnlySpan source, ReadOnlySpan indices, float threshold, Span v, Span w) - { - Contracts.AssertNonEmpty(source); - Contracts.Assert(count <= source.Length); - Contracts.AssertNonEmpty(indices); - Contracts.Assert(count <= indices.Length); - Contracts.AssertNonEmpty(v); - Contracts.Assert(count <= v.Length); - Contracts.AssertNonEmpty(w); - Contracts.Assert(count <= w.Length); - Contracts.Assert(count > 0); - - unsafe - { - fixed (float* psrc = &MemoryMarshal.GetReference(source)) - fixed (int* pi = &MemoryMarshal.GetReference(indices)) - fixed (float* pd1 = &MemoryMarshal.GetReference(v)) - fixed (float* pd2 = &MemoryMarshal.GetReference(w)) - Thunk.SdcaL1UpdateSU(primalUpdate, psrc, pi, threshold, pd1, pd2, count); - } - } - } -} diff --git a/src/Microsoft.ML.CpuMath/FactorizationMachine/FactorizationMachineInterface.netstandard.cs b/src/Microsoft.ML.CpuMath/FactorizationMachine/FactorizationMachineInterface.netstandard.cs deleted file mode 100644 index 6581bdfac5..0000000000 --- a/src/Microsoft.ML.CpuMath/FactorizationMachine/FactorizationMachineInterface.netstandard.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.ML.Internal.CpuMath.Core; - -namespace Microsoft.ML.Internal.CpuMath.FactorizationMachine -{ - [BestFriend] - internal static unsafe partial class FieldAwareFactorizationMachineInterface - { - public static void CalculateIntermediateVariables(int fieldCount, int latentDim, int count, int[] fieldIndices, int[] featureIndices, float[] featureValues, - float[] linearWeights, AlignedArray latentWeights, AlignedArray latentSum, ref float response) - { - Contracts.AssertNonEmpty(fieldIndices); - Contracts.AssertNonEmpty(featureValues); - Contracts.AssertNonEmpty(featureIndices); - Contracts.AssertNonEmpty(linearWeights); - Contracts.Assert(Compat(latentWeights)); - Contracts.Assert(Compat(latentSum)); - - unsafe - { - fixed (int* pf = &fieldIndices[0]) - fixed (int* pi = &featureIndices[0]) - fixed (float* px = &featureValues[0]) - fixed (float* pw = &linearWeights[0]) - fixed (float* pv = &latentWeights.Items[0]) - fixed (float* pq = &latentSum.Items[0]) - fixed (float* pr = &response) - CalculateIntermediateVariablesNative(fieldCount, latentDim, count, pf, pi, px, pw, Ptr(latentWeights, pv), Ptr(latentSum, pq), pr); - } - } - - public static void CalculateGradientAndUpdate(float lambdaLinear, float lambdaLatent, float learningRate, int fieldCount, int latentDim, - float weight, int count, int[] fieldIndices, int[] featureIndices, float[] featureValues, AlignedArray latentSum, float slope, - float[] linearWeights, AlignedArray latentWeights, float[] linearAccumulatedSquaredGrads, AlignedArray latentAccumulatedSquaredGrads) - { - Contracts.AssertNonEmpty(fieldIndices); - Contracts.AssertNonEmpty(featureIndices); - Contracts.AssertNonEmpty(featureValues); - Contracts.Assert(Compat(latentSum)); - Contracts.AssertNonEmpty(linearWeights); - Contracts.Assert(Compat(latentWeights)); - Contracts.AssertNonEmpty(linearAccumulatedSquaredGrads); - Contracts.Assert(Compat(latentAccumulatedSquaredGrads)); - - unsafe - { - fixed (int* pf = &fieldIndices[0]) - fixed (int* pi = &featureIndices[0]) - fixed (float* px = &featureValues[0]) - fixed (float* pq = &latentSum.Items[0]) - fixed (float* pw = &linearWeights[0]) - fixed (float* pv = &latentWeights.Items[0]) - fixed (float* phw = &linearAccumulatedSquaredGrads[0]) - fixed (float* phv = &latentAccumulatedSquaredGrads.Items[0]) - CalculateGradientAndUpdateNative(lambdaLinear, lambdaLatent, learningRate, fieldCount, latentDim, weight, count, pf, pi, px, - Ptr(latentSum, pq), slope, pw, Ptr(latentWeights, pv), phw, Ptr(latentAccumulatedSquaredGrads, phv)); - } - - } - } -} diff --git a/src/Microsoft.ML.CpuMath/Microsoft.ML.CpuMath.csproj b/src/Microsoft.ML.CpuMath/Microsoft.ML.CpuMath.csproj index 5fa62087e0..fe33589fd7 100644 --- a/src/Microsoft.ML.CpuMath/Microsoft.ML.CpuMath.csproj +++ b/src/Microsoft.ML.CpuMath/Microsoft.ML.CpuMath.csproj @@ -1,41 +1,18 @@  - netstandard2.0;net6.0 + net8.0 Microsoft.ML.CpuMath Microsoft.ML.CpuMath contains optimized math routines for ML.NET. true $(DefineConstants);CPUMATH_INFRASTRUCTURE - $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.ML.CpuMath/SseIntrinsics.cs b/src/Microsoft.ML.CpuMath/SseIntrinsics.cs index b569fba353..9137a2e225 100644 --- a/src/Microsoft.ML.CpuMath/SseIntrinsics.cs +++ b/src/Microsoft.ML.CpuMath/SseIntrinsics.cs @@ -19,7 +19,7 @@ using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; using Microsoft.ML.Internal.CpuMath.Core; -using nuint = System.UInt64; +using nUInt = System.UInt64; namespace Microsoft.ML.Internal.CpuMath { @@ -390,7 +390,7 @@ public static unsafe void Scale(float scale, Span dst) int length = dst.Length; Vector128 scaleVector128 = Vector128.Create(scale); - nuint address = (nuint)(pd); + nUInt address = (nUInt)(pd); int misalignment = (int)(address % 16); int remainder = 0; @@ -799,7 +799,7 @@ public static unsafe float Sum(ReadOnlySpan src) int length = src.Length; Vector128 result = Vector128.Zero; - nuint address = (nuint)(pValues); + nUInt address = (nUInt)(pValues); int misalignment = (int)(address % 16); int remainder = 0; diff --git a/src/Microsoft.ML.CpuMath/build/netstandard2.0/Microsoft.ML.CpuMath.props b/src/Microsoft.ML.CpuMath/build/netstandard2.0/Microsoft.ML.CpuMath.props deleted file mode 100644 index ce379e2f00..0000000000 --- a/src/Microsoft.ML.CpuMath/build/netstandard2.0/Microsoft.ML.CpuMath.props +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - PreserveNewest - false - %(Filename)%(Extension) - - - PreserveNewest - false - %(Filename)%(Extension) - - - - \ No newline at end of file diff --git a/src/Microsoft.ML.Data/Microsoft.ML.Data.csproj b/src/Microsoft.ML.Data/Microsoft.ML.Data.csproj index 0ea1f6e1f9..fe1124e47f 100644 --- a/src/Microsoft.ML.Data/Microsoft.ML.Data.csproj +++ b/src/Microsoft.ML.Data/Microsoft.ML.Data.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 Microsoft.ML true CORECLR diff --git a/src/Microsoft.ML.DataView/CompatibilitySuppressions.xml b/src/Microsoft.ML.DataView/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.DataView/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.DataView/Microsoft.ML.DataView.csproj b/src/Microsoft.ML.DataView/Microsoft.ML.DataView.csproj index a81ffdaf17..2d024a98be 100644 --- a/src/Microsoft.ML.DataView/Microsoft.ML.DataView.csproj +++ b/src/Microsoft.ML.DataView/Microsoft.ML.DataView.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.DataView Contains the IDataView system which is a set of interfaces and components that provide efficient, compositional processing of schematized data for machine learning and advanced analytics applications. diff --git a/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj b/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj index 252cce0312..456d1747ca 100644 --- a/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj +++ b/src/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer/Microsoft.ML.DnnAnalyzer.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 DnnAnalyzer diff --git a/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/Microsoft.ML.DnnImageFeaturizer.AlexNet.csproj b/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/Microsoft.ML.DnnImageFeaturizer.AlexNet.csproj index ec75b23693..7e6d4d40c5 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/Microsoft.ML.DnnImageFeaturizer.AlexNet.csproj +++ b/src/Microsoft.ML.DnnImageFeaturizer.AlexNet/Microsoft.ML.DnnImageFeaturizer.AlexNet.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.DnnImageFeaturizer.AlexNet ML.NET component for pretrained AlexNet image featurization diff --git a/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/Microsoft.ML.DnnImageFeaturizer.ResNet101.csproj b/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/Microsoft.ML.DnnImageFeaturizer.ResNet101.csproj index 70dfa08966..f0917e76c7 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/Microsoft.ML.DnnImageFeaturizer.ResNet101.csproj +++ b/src/Microsoft.ML.DnnImageFeaturizer.ResNet101/Microsoft.ML.DnnImageFeaturizer.ResNet101.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.DnnImageFeaturizer.ResNet101 ML.NET component for pretrained ResNet101 image featurization diff --git a/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/Microsoft.ML.DnnImageFeaturizer.ResNet18.csproj b/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/Microsoft.ML.DnnImageFeaturizer.ResNet18.csproj index db02568be9..93793481ec 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/Microsoft.ML.DnnImageFeaturizer.ResNet18.csproj +++ b/src/Microsoft.ML.DnnImageFeaturizer.ResNet18/Microsoft.ML.DnnImageFeaturizer.ResNet18.csproj @@ -1,8 +1,8 @@ - + - netstandard2.0 + net8.0 Microsoft.ML.DnnImageFeaturizer.ResNet18 ML.NET component for pretrained ResNet18 image featurization diff --git a/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/Microsoft.ML.DnnImageFeaturizer.ResNet50.csproj b/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/Microsoft.ML.DnnImageFeaturizer.ResNet50.csproj index 5c6e91aefd..b116d0de45 100644 --- a/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/Microsoft.ML.DnnImageFeaturizer.ResNet50.csproj +++ b/src/Microsoft.ML.DnnImageFeaturizer.ResNet50/Microsoft.ML.DnnImageFeaturizer.ResNet50.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.DnnImageFeaturizer.ResNet50 ML.NET component for pretrained ResNet50 image featurization diff --git a/src/Microsoft.ML.Ensemble/Microsoft.ML.Ensemble.csproj b/src/Microsoft.ML.Ensemble/Microsoft.ML.Ensemble.csproj index 766107cd6b..1ba3ac576f 100644 --- a/src/Microsoft.ML.Ensemble/Microsoft.ML.Ensemble.csproj +++ b/src/Microsoft.ML.Ensemble/Microsoft.ML.Ensemble.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.Ensemble ML.NET component for Ensembles CORECLR diff --git a/src/Microsoft.ML.EntryPoints/Microsoft.ML.EntryPoints.csproj b/src/Microsoft.ML.EntryPoints/Microsoft.ML.EntryPoints.csproj index a2b946550c..9bd32fca36 100644 --- a/src/Microsoft.ML.EntryPoints/Microsoft.ML.EntryPoints.csproj +++ b/src/Microsoft.ML.EntryPoints/Microsoft.ML.EntryPoints.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.EntryPoints Microsoft.ML.EntryPoints contains the ML.NET entry point API catalog. diff --git a/src/Microsoft.ML.Experimental/Microsoft.ML.Experimental.csproj b/src/Microsoft.ML.Experimental/Microsoft.ML.Experimental.csproj index 1996182a09..1a6a2639c0 100644 --- a/src/Microsoft.ML.Experimental/Microsoft.ML.Experimental.csproj +++ b/src/Microsoft.ML.Experimental/Microsoft.ML.Experimental.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.Experimental Microsoft.ML.Experimental contains experimental work such extension methods to access internal methods. diff --git a/src/Microsoft.ML.Fairlearn/Microsoft.ML.Fairlearn.csproj b/src/Microsoft.ML.Fairlearn/Microsoft.ML.Fairlearn.csproj index 72b2ad0edb..b002a968a7 100644 --- a/src/Microsoft.ML.Fairlearn/Microsoft.ML.Fairlearn.csproj +++ b/src/Microsoft.ML.Fairlearn/Microsoft.ML.Fairlearn.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.Fairlearn None diff --git a/src/Microsoft.ML.FastTree/CompatibilitySuppressions.xml b/src/Microsoft.ML.FastTree/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.FastTree/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.FastTree/Microsoft.ML.FastTree.csproj b/src/Microsoft.ML.FastTree/Microsoft.ML.FastTree.csproj index acbef6b851..be0047fd29 100644 --- a/src/Microsoft.ML.FastTree/Microsoft.ML.FastTree.csproj +++ b/src/Microsoft.ML.FastTree/Microsoft.ML.FastTree.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 Microsoft.ML.FastTree ML.NET component for FastTree $(DefineConstants);NO_STORE;CORECLR diff --git a/src/Microsoft.ML.ImageAnalytics/CompatibilitySuppressions.xml b/src/Microsoft.ML.ImageAnalytics/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.ImageAnalytics/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.ImageAnalytics/Microsoft.ML.ImageAnalytics.csproj b/src/Microsoft.ML.ImageAnalytics/Microsoft.ML.ImageAnalytics.csproj index 5edf8ebb14..801fc8b424 100644 --- a/src/Microsoft.ML.ImageAnalytics/Microsoft.ML.ImageAnalytics.csproj +++ b/src/Microsoft.ML.ImageAnalytics/Microsoft.ML.ImageAnalytics.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.ImageAnalytics ML.NET component for Image support true diff --git a/src/Microsoft.ML.KMeansClustering/Microsoft.ML.KMeansClustering.csproj b/src/Microsoft.ML.KMeansClustering/Microsoft.ML.KMeansClustering.csproj index f7e24f9457..b2a63ba246 100644 --- a/src/Microsoft.ML.KMeansClustering/Microsoft.ML.KMeansClustering.csproj +++ b/src/Microsoft.ML.KMeansClustering/Microsoft.ML.KMeansClustering.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net8.0 Microsoft.ML diff --git a/src/Microsoft.ML.LightGbm/CompatibilitySuppressions.xml b/src/Microsoft.ML.LightGbm/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.LightGbm/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.LightGbm/Microsoft.ML.LightGbm.csproj b/src/Microsoft.ML.LightGbm/Microsoft.ML.LightGbm.csproj index 4d4c405e01..685fbb8712 100644 --- a/src/Microsoft.ML.LightGbm/Microsoft.ML.LightGbm.csproj +++ b/src/Microsoft.ML.LightGbm/Microsoft.ML.LightGbm.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.LightGbm true ML.NET component for LightGBM diff --git a/src/Microsoft.ML.Maml/Microsoft.ML.Maml.csproj b/src/Microsoft.ML.Maml/Microsoft.ML.Maml.csproj index d9603a7aef..de4203c5c7 100644 --- a/src/Microsoft.ML.Maml/Microsoft.ML.Maml.csproj +++ b/src/Microsoft.ML.Maml/Microsoft.ML.Maml.csproj @@ -3,7 +3,7 @@ true CORECLR - netstandard2.0 + net8.0 diff --git a/src/Microsoft.ML.Mkl.Components/CompatibilitySuppressions.xml b/src/Microsoft.ML.Mkl.Components/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.Mkl.Components/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.Mkl.Components/Microsoft.ML.Mkl.Components.csproj b/src/Microsoft.ML.Mkl.Components/Microsoft.ML.Mkl.Components.csproj index 56566d43df..a863abc82b 100644 --- a/src/Microsoft.ML.Mkl.Components/Microsoft.ML.Mkl.Components.csproj +++ b/src/Microsoft.ML.Mkl.Components/Microsoft.ML.Mkl.Components.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 Microsoft.ML.Mkl.Components true ML.NET additional learners making use of Intel Mkl. diff --git a/src/Microsoft.ML.Mkl.Redist/CompatibilitySuppressions.xml b/src/Microsoft.ML.Mkl.Redist/CompatibilitySuppressions.xml index 90523af626..b9c4ef03fe 100644 --- a/src/Microsoft.ML.Mkl.Redist/CompatibilitySuppressions.xml +++ b/src/Microsoft.ML.Mkl.Redist/CompatibilitySuppressions.xml @@ -1,6 +1,6 @@  + - PKV006 .NETStandard,Version=v2.0 diff --git a/src/Microsoft.ML.Mkl.Redist/Microsoft.ML.Mkl.Redist.csproj b/src/Microsoft.ML.Mkl.Redist/Microsoft.ML.Mkl.Redist.csproj index 1aedb518d8..fef6950ef4 100644 --- a/src/Microsoft.ML.Mkl.Redist/Microsoft.ML.Mkl.Redist.csproj +++ b/src/Microsoft.ML.Mkl.Redist/Microsoft.ML.Mkl.Redist.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net8.0 false LICENSE.txt @@ -27,10 +27,10 @@ - - - - + + + + \ No newline at end of file diff --git a/src/Microsoft.ML.OneDal/Microsoft.ML.OneDal.csproj b/src/Microsoft.ML.OneDal/Microsoft.ML.OneDal.csproj index ab1cc7a4cb..a40b612b34 100644 --- a/src/Microsoft.ML.OneDal/Microsoft.ML.OneDal.csproj +++ b/src/Microsoft.ML.OneDal/Microsoft.ML.OneDal.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.OneDal true ML.NET additional learners making use of Intel® oneAPI Data Analytics Library (oneDAL). diff --git a/src/Microsoft.ML.OnnxConverter/Microsoft.ML.OnnxConverter.csproj b/src/Microsoft.ML.OnnxConverter/Microsoft.ML.OnnxConverter.csproj index 56fefc841f..2a2e5ba8bb 100644 --- a/src/Microsoft.ML.OnnxConverter/Microsoft.ML.OnnxConverter.csproj +++ b/src/Microsoft.ML.OnnxConverter/Microsoft.ML.OnnxConverter.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.OnnxConverter Microsoft.ML.Model.Onnx ML.NET component for exporting ONNX Models diff --git a/src/Microsoft.ML.OnnxConverter/OnnxMl.cs b/src/Microsoft.ML.OnnxConverter/OnnxMl.cs index 98df15cfcf..5c8adc9387 100644 --- a/src/Microsoft.ML.OnnxConverter/OnnxMl.cs +++ b/src/Microsoft.ML.OnnxConverter/OnnxMl.cs @@ -1,14 +1,17 @@ -// +// // Generated by the protocol buffer compiler. DO NOT EDIT! // source: onnx-ml.proto3 // #pragma warning disable 1591, 0612, 3021 #region Designer generated code +#pragma warning disable CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; +#pragma warning restore CS8981 // The type name only contains lower-cased ascii characters. Such names may become reserved for the language. + namespace Microsoft.ML.Model.OnnxConverter { internal class OnnxCSharpToProtoWrapper diff --git a/src/Microsoft.ML.OnnxTransformer/CompatibilitySuppressions.xml b/src/Microsoft.ML.OnnxTransformer/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.OnnxTransformer/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.OnnxTransformer/Microsoft.ML.OnnxTransformer.csproj b/src/Microsoft.ML.OnnxTransformer/Microsoft.ML.OnnxTransformer.csproj index 54517aebaa..5f7b1713ff 100644 --- a/src/Microsoft.ML.OnnxTransformer/Microsoft.ML.OnnxTransformer.csproj +++ b/src/Microsoft.ML.OnnxTransformer/Microsoft.ML.OnnxTransformer.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.OnnxTransformer true ML.NET component for Microsoft.ML.OnnxRuntime.Managed library diff --git a/src/Microsoft.ML.PCA/Microsoft.ML.PCA.csproj b/src/Microsoft.ML.PCA/Microsoft.ML.PCA.csproj index f7e24f9457..b2a63ba246 100644 --- a/src/Microsoft.ML.PCA/Microsoft.ML.PCA.csproj +++ b/src/Microsoft.ML.PCA/Microsoft.ML.PCA.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net8.0 Microsoft.ML diff --git a/src/Microsoft.ML.Parquet/Microsoft.ML.Parquet.csproj b/src/Microsoft.ML.Parquet/Microsoft.ML.Parquet.csproj index f41344c124..6a9bdef5da 100644 --- a/src/Microsoft.ML.Parquet/Microsoft.ML.Parquet.csproj +++ b/src/Microsoft.ML.Parquet/Microsoft.ML.Parquet.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.Parquet ML.NET components for Apache Parquet support. diff --git a/src/Microsoft.ML.Recommender/Microsoft.ML.Recommender.csproj b/src/Microsoft.ML.Recommender/Microsoft.ML.Recommender.csproj index 92955776e8..407c352c2e 100644 --- a/src/Microsoft.ML.Recommender/Microsoft.ML.Recommender.csproj +++ b/src/Microsoft.ML.Recommender/Microsoft.ML.Recommender.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.Recommender true LIBMF, the core computation library for matrix factorization in ML.NET diff --git a/src/Microsoft.ML.ResultProcessor/Microsoft.ML.ResultProcessor.csproj b/src/Microsoft.ML.ResultProcessor/Microsoft.ML.ResultProcessor.csproj index 158d6424c7..895a46dd9d 100644 --- a/src/Microsoft.ML.ResultProcessor/Microsoft.ML.ResultProcessor.csproj +++ b/src/Microsoft.ML.ResultProcessor/Microsoft.ML.ResultProcessor.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 CORECLR true diff --git a/src/Microsoft.ML.SamplesUtils/Microsoft.ML.SamplesUtils.csproj b/src/Microsoft.ML.SamplesUtils/Microsoft.ML.SamplesUtils.csproj index db62720cdd..cabebfef7a 100644 --- a/src/Microsoft.ML.SamplesUtils/Microsoft.ML.SamplesUtils.csproj +++ b/src/Microsoft.ML.SamplesUtils/Microsoft.ML.SamplesUtils.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.SampleUtils Sample utils for Microsoft.ML.Samples diff --git a/src/Microsoft.ML.SearchSpace/Microsoft.ML.SearchSpace.csproj b/src/Microsoft.ML.SearchSpace/Microsoft.ML.SearchSpace.csproj index 155feb6f84..5579e39d4b 100644 --- a/src/Microsoft.ML.SearchSpace/Microsoft.ML.SearchSpace.csproj +++ b/src/Microsoft.ML.SearchSpace/Microsoft.ML.SearchSpace.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 Microsoft.ML.Core true MSML_ContractsCheckMessageNotLiteralOrIdentifier diff --git a/src/Microsoft.ML.StandardTrainers/Microsoft.ML.StandardTrainers.csproj b/src/Microsoft.ML.StandardTrainers/Microsoft.ML.StandardTrainers.csproj index d3a7a06c3c..5bec273e63 100644 --- a/src/Microsoft.ML.StandardTrainers/Microsoft.ML.StandardTrainers.csproj +++ b/src/Microsoft.ML.StandardTrainers/Microsoft.ML.StandardTrainers.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 Microsoft.ML true diff --git a/src/Microsoft.ML.Sweeper/Microsoft.ML.Sweeper.csproj b/src/Microsoft.ML.Sweeper/Microsoft.ML.Sweeper.csproj index 9c08ba85af..6886695d09 100644 --- a/src/Microsoft.ML.Sweeper/Microsoft.ML.Sweeper.csproj +++ b/src/Microsoft.ML.Sweeper/Microsoft.ML.Sweeper.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 CORECLR true diff --git a/src/Microsoft.ML.TensorFlow/CompatibilitySuppressions.xml b/src/Microsoft.ML.TensorFlow/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.TensorFlow/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.TensorFlow/Microsoft.ML.TensorFlow.csproj b/src/Microsoft.ML.TensorFlow/Microsoft.ML.TensorFlow.csproj index 112045bc80..a11bd8f760 100644 --- a/src/Microsoft.ML.TensorFlow/Microsoft.ML.TensorFlow.csproj +++ b/src/Microsoft.ML.TensorFlow/Microsoft.ML.TensorFlow.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.TensorFlow CORECLR true diff --git a/src/Microsoft.ML.TensorFlow/TensorflowUtils.cs b/src/Microsoft.ML.TensorFlow/TensorflowUtils.cs index faec243057..f142b3f92e 100644 --- a/src/Microsoft.ML.TensorFlow/TensorflowUtils.cs +++ b/src/Microsoft.ML.TensorFlow/TensorflowUtils.cs @@ -5,6 +5,8 @@ using System; using System.IO; using System.Linq; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security.AccessControl; using System.Security.Principal; using Microsoft.ML.Data; @@ -290,20 +292,20 @@ internal static void CreateFolderWithAclIfNotExists(IHostEnvironment env, string if (Directory.Exists(folder)) return; - WindowsIdentity currentIdentity = null; - try + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - currentIdentity = WindowsIdentity.GetCurrent(); - } - catch (PlatformNotSupportedException) - { } + WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent(); - if (currentIdentity != null && new WindowsPrincipal(currentIdentity).IsInRole(WindowsBuiltInRole.Administrator)) - { - // Create high integrity dir and set no delete policy for all files under the directory. - // In case of failure, throw exception. - CreateTempDirectoryWithAcl(folder, currentIdentity.User.ToString()); + if (currentIdentity != null && new WindowsPrincipal(currentIdentity).IsInRole(WindowsBuiltInRole.Administrator)) + { + // Create high integrity dir and set no delete policy for all files under the directory. + // In case of failure, throw exception. + CreateTempDirectoryWithAcl(folder, currentIdentity.User.ToString()); + } } + + if (Directory.Exists(folder)) + return; else { try @@ -342,6 +344,7 @@ internal static void DeleteFolderWithRetries(IHostEnvironment env, string folder } } + [SupportedOSPlatform("windows")] private static void CreateTempDirectoryWithAcl(string folder, string identity) { // Dacl Sddl string: diff --git a/src/Microsoft.ML.TimeSeries/CompatibilitySuppressions.xml b/src/Microsoft.ML.TimeSeries/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.TimeSeries/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.TimeSeries/FftUtils.cs b/src/Microsoft.ML.TimeSeries/FftUtils.cs index 2b00009547..8ec8bb2cfe 100644 --- a/src/Microsoft.ML.TimeSeries/FftUtils.cs +++ b/src/Microsoft.ML.TimeSeries/FftUtils.cs @@ -248,8 +248,7 @@ public static void ComputeForwardFft(float[] inputRe, float[] inputIm, float[] o } finally { - if (descriptor != null) - FreeDescriptor(ref descriptor); + FreeDescriptor(ref descriptor); } } @@ -294,8 +293,7 @@ public static void ComputeBackwardFft(float[] inputRe, float[] inputIm, float[] } finally { - if (descriptor != null) - FreeDescriptor(ref descriptor); + FreeDescriptor(ref descriptor); } // REVIEW: for some reason the native backward scaling for DFTI in MKL does not work. @@ -350,8 +348,7 @@ public static void ComputeForwardFft(double[] inputRe, double[] inputIm, double[ } finally { - if (descriptor != null) - FreeDescriptor(ref descriptor); + FreeDescriptor(ref descriptor); } } @@ -396,8 +393,7 @@ public static void ComputeBackwardFft(double[] inputRe, double[] inputIm, double } finally { - if (descriptor != null) - FreeDescriptor(ref descriptor); + FreeDescriptor(ref descriptor); } // REVIEW: for some reason the native backward scaling for DFTI in MKL does not work. diff --git a/src/Microsoft.ML.TimeSeries/Microsoft.ML.TimeSeries.csproj b/src/Microsoft.ML.TimeSeries/Microsoft.ML.TimeSeries.csproj index b5aa12d56a..e3146b99ae 100644 --- a/src/Microsoft.ML.TimeSeries/Microsoft.ML.TimeSeries.csproj +++ b/src/Microsoft.ML.TimeSeries/Microsoft.ML.TimeSeries.csproj @@ -1,23 +1,24 @@  - + - netstandard2.0 + net8.0 Microsoft.ML.TimeSeries Microsoft.ML.TimeSeries contains ML.NET Time Series prediction algorithms. Uses Intel Mkl. + - + all - + all - + all diff --git a/src/Microsoft.ML.Tokenizers/Microsoft.ML.Tokenizers.csproj b/src/Microsoft.ML.Tokenizers/Microsoft.ML.Tokenizers.csproj index 78b6d7f49b..dacc29bc11 100644 --- a/src/Microsoft.ML.Tokenizers/Microsoft.ML.Tokenizers.csproj +++ b/src/Microsoft.ML.Tokenizers/Microsoft.ML.Tokenizers.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 enable Microsoft.ML.Tokenizers contains the implmentation of the tokenization used in the NLP transforms. diff --git a/src/Microsoft.ML.Tokenizers/Model/BPE.cs b/src/Microsoft.ML.Tokenizers/Model/BPE.cs index 1537adec29..e1bcbe805f 100644 --- a/src/Microsoft.ML.Tokenizers/Model/BPE.cs +++ b/src/Microsoft.ML.Tokenizers/Model/BPE.cs @@ -36,7 +36,7 @@ public sealed class Bpe : Model if (value is null) { - if (VocabReverse.TryGetValue(0, out string v)) + if (VocabReverse.TryGetValue(0, out string? v)) { VocabReverse.Remove(0); if (Vocab.TryGetValue(v, out int id)) @@ -103,7 +103,7 @@ public Bpe(string vocabFile, string? mergesFile, string? unknownToken = null, st VocabReverse.Add(kvp.Value, kvp.Key); } - if (unknownToken is null && VocabReverse.TryGetValue(0, out string unkToken)) + if (unknownToken is null && VocabReverse.TryGetValue(0, out string? unkToken)) { unknownToken = unkToken; } @@ -187,7 +187,7 @@ public override IReadOnlyList Tokenize(string sequence) /// The mapped token of the Id. public override string? IdToToken(int id, bool skipSpecialTokens = false) { - if (VocabReverse.TryGetValue(id, out string value)) + if (VocabReverse.TryGetValue(id, out string? value)) { return value; } @@ -256,9 +256,17 @@ public override string[] Save(string path, string? prefix = null) internal static (Dictionary?, Vec<(string, string)>) ReadFile(string? vocab, string? merges) { Dictionary? dic; - using (Stream stream = File.OpenRead(vocab)) + + if (vocab != null) + { + using (Stream stream = File.OpenRead(vocab)) + { + dic = JsonSerializer.Deserialize>(stream) as Dictionary; + } + } + else { - dic = JsonSerializer.Deserialize>(stream) as Dictionary; + dic = new Dictionary(); } return (dic, ConvertMergesToHashmap(merges)); @@ -320,7 +328,7 @@ internal static Vec<(string, string)> ConvertMergesToHashmap(string? mergesFile) [MethodImpl(MethodImplOptions.AggressiveInlining)] internal string CharToString(char c) { - if (_charToString.TryGetValue(c, out string v)) + if (_charToString.TryGetValue(c, out string? v)) { return v; } diff --git a/src/Microsoft.ML.Tokenizers/Model/BpeTrainer.cs b/src/Microsoft.ML.Tokenizers/Model/BpeTrainer.cs index 31942e17fb..cc7e95268f 100644 --- a/src/Microsoft.ML.Tokenizers/Model/BpeTrainer.cs +++ b/src/Microsoft.ML.Tokenizers/Model/BpeTrainer.cs @@ -83,7 +83,7 @@ public BpeTrainer() : this(null) MinFrequency = minFrequency; VocabSize = vocabSize; Progress = progress; - SpecialTokens = new List(specialTokens); + SpecialTokens = specialTokens != null ? new List(specialTokens) : new List(); LimitAlphabet = limitAlphabet; InitialAlphabet = initialAlphabet; ContinuingSubwordPrefix = continuingSubwordPrefix; @@ -172,7 +172,7 @@ private void ComputeAlphabet(Dictionary wc, Dictionary [MethodImpl(MethodImplOptions.AggressiveInlining)] internal string CharToString(char c) { - if (_charToString.TryGetValue(c, out string v)) + if (_charToString.TryGetValue(c, out string? v)) { return v; } @@ -259,7 +259,7 @@ internal string CharToString(char c) // Then update counts int count = counts[i]; - if (!whereToUpdate.TryGetValue(curPair, out HashSet h)) + if (!whereToUpdate.TryGetValue(curPair, out HashSet? h)) { h = new HashSet(); whereToUpdate[curPair] = h; @@ -398,7 +398,7 @@ internal string CharToString(char c) if (change > 0) { - if (!whereToUpdate.TryGetValue(p, out HashSet h)) + if (!whereToUpdate.TryGetValue(p, out HashSet? h)) { h = new(); whereToUpdate[p] = h; diff --git a/src/Microsoft.ML.Tokenizers/Model/Cache.cs b/src/Microsoft.ML.Tokenizers/Model/Cache.cs index 2665bacfcf..36b6fa6038 100644 --- a/src/Microsoft.ML.Tokenizers/Model/Cache.cs +++ b/src/Microsoft.ML.Tokenizers/Model/Cache.cs @@ -10,6 +10,7 @@ namespace Microsoft.ML.Tokenizers { internal sealed class Cache + where TKey : notnull { internal Cache() : this(Bpe.DefaultCacheCapacity) { } @@ -45,7 +46,7 @@ internal List GetValues(IEnumerable keys) { foreach (TKey key in keys) { - if (Map.TryGetValue(key, out TValue value)) + if (Map.TryGetValue(key, out TValue? value)) { values.Add(value); } @@ -61,7 +62,7 @@ internal List GetValues(IEnumerable keys) _cacheLock.EnterReadLock(); try { - if (Map.TryGetValue(key, out TValue value)) + if (Map.TryGetValue(key, out TValue? value)) { return value; } diff --git a/src/Microsoft.ML.Tokenizers/Model/EnglishRoberta.cs b/src/Microsoft.ML.Tokenizers/Model/EnglishRoberta.cs index edf0da3fcc..65c2e518dd 100644 --- a/src/Microsoft.ML.Tokenizers/Model/EnglishRoberta.cs +++ b/src/Microsoft.ML.Tokenizers/Model/EnglishRoberta.cs @@ -422,7 +422,7 @@ private IReadOnlyList ModifyTokenListOffsets(IReadOnlyList tokens, private Dictionary<(string, string), int> GetMergeRanks(Stream mergeStream) { - List splitContents = new(); + List splitContents = new(); try { @@ -442,8 +442,8 @@ private Dictionary<(string, string), int> GetMergeRanks(Stream mergeStream) // We ignore the first and last line in the file for (int i = 1; i < splitContents.Count - 1; i++) { - var split = splitContents[i].Split(' '); - if (split.Length != 2 || string.IsNullOrEmpty(split[0]) || string.IsNullOrEmpty(split[1])) + var split = splitContents[i]?.Split(' '); + if (split?.Length != 2 || string.IsNullOrEmpty(split[0]) || string.IsNullOrEmpty(split[1])) { throw new Exception($"Invalid format of merge file: \"{splitContents[i]}\""); } @@ -761,10 +761,10 @@ public void AddFromStream(Stream stream) while (reader.Peek() >= 0) { - string line = reader.ReadLine(); + string? line = reader.ReadLine(); - var splitLine = line.Trim().Split(' '); - if (splitLine.Length != 2) + var splitLine = line?.Trim().Split(' '); + if (splitLine?.Length != 2) { throw new ArgumentException("Incorrect vocabulary format, expected \" \""); } diff --git a/src/Microsoft.ML.Tokenizers/Utils/TokenizerExtensions.cs b/src/Microsoft.ML.Tokenizers/Utils/TokenizerExtensions.cs index 9c398cb7b1..ec503062bf 100644 --- a/src/Microsoft.ML.Tokenizers/Utils/TokenizerExtensions.cs +++ b/src/Microsoft.ML.Tokenizers/Utils/TokenizerExtensions.cs @@ -22,6 +22,8 @@ internal static class TokenizerExtensions } public static TValue GetOrAdd(this Dictionary dic, TKey key, TValue setValue) + where TKey : notnull + where TValue : notnull { if (dic.TryGetValue(key, out var value)) { @@ -33,6 +35,7 @@ internal static class TokenizerExtensions } public static IReadOnlyDictionary Reverse(this IReadOnlyDictionary source) + where TValue : notnull { Dictionary dictionary = new Dictionary(); if (source != null) @@ -47,6 +50,7 @@ internal static class TokenizerExtensions } public static SortedDictionary ReverseSorted(this IReadOnlyDictionary source) + where TValue : notnull { SortedDictionary dictionary = new SortedDictionary(); if (source != null) diff --git a/src/Microsoft.ML.TorchSharp/Microsoft.ML.TorchSharp.csproj b/src/Microsoft.ML.TorchSharp/Microsoft.ML.TorchSharp.csproj index d55779e964..b628ba95e4 100644 --- a/src/Microsoft.ML.TorchSharp/Microsoft.ML.TorchSharp.csproj +++ b/src/Microsoft.ML.TorchSharp/Microsoft.ML.TorchSharp.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 $(NoWarn);CS8002 true Microsoft.ML.TorchSharp contains ML.NET integration of TorchSharp. diff --git a/src/Microsoft.ML.TorchSharp/Utils/Index.cs b/src/Microsoft.ML.TorchSharp/Utils/Index.cs deleted file mode 100644 index 20f59a2e50..0000000000 --- a/src/Microsoft.ML.TorchSharp/Utils/Index.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.CompilerServices; - -namespace System -{ - /// Represent a type can be used to index a collection either from the start or the end. - /// - /// Index is used by the C# compiler to support the new index syntax - /// - /// int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ; - /// int lastElement = someArray[^1]; // lastElement = 5 - /// - /// - internal readonly struct Index : IEquatable - { - private readonly int _value; - - /// Construct an Index using a value and indicating if the index is from the start or from the end. - /// The index value. it has to be zero or positive number. - /// Indicating if the index is from the start or from the end. - /// - /// If the Index constructed from the end, index value 1 means pointing at the last element and index value 0 means pointing at beyond last element. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Index(int value, bool fromEnd = false) - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), "Non-negative number required."); - } - - if (fromEnd) - _value = ~value; - else - _value = value; - } - - // The following private constructors mainly created for perf reason to avoid the checks - private Index(int value) - { - _value = value; - } - - /// Create an Index pointing at first element. - public static Index Start => new Index(0); - - /// Create an Index pointing at beyond last element. - public static Index End => new Index(~0); - - /// Create an Index from the start at the position indicated by the value. - /// The index value from the start. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Index FromStart(int value) - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), "Non-negative number required."); - } - - return new Index(value); - } - - /// Create an Index from the end at the position indicated by the value. - /// The index value from the end. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Index FromEnd(int value) - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), "Non-negative number required."); - } - - return new Index(~value); - } - - /// Returns the index value. - public int Value - { - get - { - if (_value < 0) - return ~_value; - else - return _value; - } - } - - /// Indicates whether the index is from the start or the end. - public bool IsFromEnd => _value < 0; - - /// Calculate the offset from the start using the giving collection length. - /// The length of the collection that the Index will be used with. length has to be a positive value - /// - /// For performance reason, we don't validate the input length parameter and the returned offset value against negative values. - /// we don't validate either the returned offset is greater than the input length. - /// It is expected Index will be used with collections which always have non negative length/count. If the returned offset is negative and - /// then used to index a collection will get out of range exception which will be same affect as the validation. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int GetOffset(int length) - { - var offset = _value; - if (IsFromEnd) - { - // offset = length - (~value) - // offset = length + (~(~value) + 1) - // offset = length + value + 1 - - offset += length + 1; - } - return offset; - } - - /// Indicates whether the current Index object is equal to another object of the same type. - /// An object to compare with this object - public override bool Equals(object value) => value is Index && _value == ((Index)value)._value; - - /// Indicates whether the current Index object is equal to another Index object. - /// An object to compare with this object - public bool Equals(Index other) => _value == other._value; - - /// Returns the hash code for this instance. - public override int GetHashCode() => _value; - - /// Converts integer number to an Index. - public static implicit operator Index(int value) => FromStart(value); - - /// Converts the value of the current Index object to its equivalent string representation. - public override string ToString() - { - if (IsFromEnd) - return ToStringFromEnd(); - - return ((uint)Value).ToString(); - } - - private string ToStringFromEnd() - { - return '^' + Value.ToString(); - } - } -} diff --git a/src/Microsoft.ML.TorchSharp/Utils/Range.cs b/src/Microsoft.ML.TorchSharp/Utils/Range.cs deleted file mode 100644 index b372aed591..0000000000 --- a/src/Microsoft.ML.TorchSharp/Utils/Range.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using Microsoft.ML.TorchSharp.Utils; -using static TorchSharp.torch; - -namespace System -{ - /// Represent a range has start and end indexes. - /// - /// Range is used by the C# compiler to support the range syntax. - /// - /// int[] someArray = new int[5] { 1, 2, 3, 4, 5 }; - /// int[] subArray1 = someArray[0..2]; // { 1, 2 } - /// int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 } - /// - /// - internal readonly struct Range : IEquatable - { - /// Represent the inclusive start index of the Range. - public Index Start { get; } - - /// Represent the exclusive end index of the Range. - public Index End { get; } - - /// Construct a Range object using the start and end indexes. - /// Represent the inclusive start index of the range. - /// Represent the exclusive end index of the range. - public Range(Index start, Index end) - { - Start = start; - End = end; - } - - /// Indicates whether the current Range object is equal to another object of the same type. - /// An object to compare with this object - public override bool Equals(object value) => - value is Range r && - r.Start.Equals(Start) && - r.End.Equals(End); - - /// Indicates whether the current Range object is equal to another Range object. - /// An object to compare with this object - public bool Equals(Range other) => other.Start.Equals(Start) && other.End.Equals(End); - - /// Returns the hash code for this instance. - public override int GetHashCode() - { -#if (!NETSTANDARD2_0 && !NETFRAMEWORK) - return HashCode.Combine(Start.GetHashCode(), End.GetHashCode()); -#else - return HashHelpers.Combine(Start.GetHashCode(), End.GetHashCode()); -#endif - } - - /// Converts the value of the current Range object to its equivalent string representation. - public override string ToString() - { -#if (!NETSTANDARD2_0 && !NETFRAMEWORK) - Span span = stackalloc char[2 + (2 * 11)]; // 2 for "..", then for each index 1 for '^' and 10 for longest possible uint - int pos = 0; - - if (Start.IsFromEnd) - { - span[0] = '^'; - pos = 1; - } - bool formatted = ((uint)Start.Value).TryFormat(span.Slice(pos), out int charsWritten); - Debug.Assert(formatted); - pos += charsWritten; - - span[pos++] = '.'; - span[pos++] = '.'; - - if (End.IsFromEnd) - { - span[pos++] = '^'; - } - formatted = ((uint)End.Value).TryFormat(span.Slice(pos), out charsWritten); - Debug.Assert(formatted); - pos += charsWritten; - - return new string(span.Slice(0, pos)); -#else - return Start.ToString() + ".." + End.ToString(); -#endif - } - - /// Create a Range object starting from start index to the end of the collection. - public static Range StartAt(Index start) => new Range(start, Index.End); - - /// Create a Range object starting from first element in the collection to the end Index. - public static Range EndAt(Index end) => new Range(Index.Start, end); - - /// Create a Range object starting from first element to the end. - public static Range All => new Range(Index.Start, Index.End); - - /// Calculate the start offset and length of range object using a collection length. - /// The length of the collection that the range will be used with. length has to be a positive value. - /// - /// For performance reason, we don't validate the input length parameter against negative values. - /// It is expected Range will be used with collections which always have non negative length/count. - /// We validate the range is inside the length scope though. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public (int Offset, int Length) GetOffsetAndLength(int length) - { - int start; - var startIndex = Start; - if (startIndex.IsFromEnd) - start = length - startIndex.Value; - else - start = startIndex.Value; - - int end; - var endIndex = End; - if (endIndex.IsFromEnd) - end = length - endIndex.Value; - else - end = endIndex.Value; - - if ((uint)end > (uint)length || (uint)start > (uint)end) - { - throw new ArgumentOutOfRangeException(nameof(length)); - } - - return (start, end - start); - } - - public static implicit operator TensorIndex(Range range) - { - long? start = !range.Start.IsFromEnd ? range.Start.Value : -1 * range.Start.Value; - var stop = !range.End.IsFromEnd ? new long?(range.End.Value) : range.End.Value == 0 ? null : new long?(-1 * range.End.Value); - return TensorIndex.Slice(start, stop); - } - } -} diff --git a/src/Microsoft.ML.Transforms/Microsoft.ML.Transforms.csproj b/src/Microsoft.ML.Transforms/Microsoft.ML.Transforms.csproj index 8f6378ad93..2b7fc4e735 100644 --- a/src/Microsoft.ML.Transforms/Microsoft.ML.Transforms.csproj +++ b/src/Microsoft.ML.Transforms/Microsoft.ML.Transforms.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + net8.0 Microsoft.ML CORECLR true diff --git a/src/Microsoft.ML.Vision/CompatibilitySuppressions.xml b/src/Microsoft.ML.Vision/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML.Vision/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML.Vision/Microsoft.ML.Vision.csproj b/src/Microsoft.ML.Vision/Microsoft.ML.Vision.csproj index 08a74bc8d1..0e8156a0ea 100644 --- a/src/Microsoft.ML.Vision/Microsoft.ML.Vision.csproj +++ b/src/Microsoft.ML.Vision/Microsoft.ML.Vision.csproj @@ -2,7 +2,7 @@ - netstandard2.0 + net8.0 Microsoft.ML.Vision CORECLR true diff --git a/src/Microsoft.ML/CompatibilitySuppressions.xml b/src/Microsoft.ML/CompatibilitySuppressions.xml new file mode 100644 index 0000000000..b9c4ef03fe --- /dev/null +++ b/src/Microsoft.ML/CompatibilitySuppressions.xml @@ -0,0 +1,8 @@ + + + + + PKV006 + .NETStandard,Version=v2.0 + + \ No newline at end of file diff --git a/src/Microsoft.ML/Microsoft.ML.csproj b/src/Microsoft.ML/Microsoft.ML.csproj index 780c6048a1..fe008e7ac9 100644 --- a/src/Microsoft.ML/Microsoft.ML.csproj +++ b/src/Microsoft.ML/Microsoft.ML.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net8.0