Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Projects to .NET 8 in MLNET 4.0 Branch #6749

Open
wants to merge 13 commits into
base: feature/4.0
Choose a base branch
from

Conversation

JakeRadMSFT
Copy link
Contributor

@JakeRadMSFT JakeRadMSFT commented Jun 29, 2023

  • This PR drops netfx and .netstandard support.
  • ML.NET 4.0 will target .NET 8
  • Fixes various issues hit targeting .NET 8
  • Cleans up build/project files to remove multi-targeting related things (probably still more work to do here)

TODO:

  • Open bug for looking at our code analysis things
  • Open bug enabling the nullable things for entire repo
  • Open bug to consolidate to a shared ApiCompatSuppressionFile
    • Reference: https://github.com/search?q=repo%3Adotnet%2Fruntime%20ApiCompatSuppressionFile&type=code
  • Open bug for removing TargetFramework/NET8 from Build Definition

@ghost ghost assigned JakeRadMSFT Jun 29, 2023
@@ -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;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on name? It didn't like all lowercase.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer lowercase - because this is standard for .net

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait. .net have nuint native type. why nuint = uint64??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right - I'm not sure why this is here. I think the alias should be removed since it's not actually behaving like a native integer.

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: onnx-ml.proto3
// </auto-generated>
#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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be moved up to the other disables

@JakeRadMSFT JakeRadMSFT changed the title Update Projects to .NET 8 in MLNET 4.0 Branch WUP - Update Projects to .NET 8 in MLNET 4.0 Branch Jun 30, 2023
@JakeRadMSFT JakeRadMSFT changed the title WUP - Update Projects to .NET 8 in MLNET 4.0 Branch WIP - Update Projects to .NET 8 in MLNET 4.0 Branch Jun 30, 2023
buildScript: ./build.sh
container: UbuntuCrossArmContainer
customMatrixes:
Debug_Build:
_configuration: Debug
_config_short: DI
_includeBenchmarkData: false
_targetFramework: net6.0
_targetFramework: net8.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Try to remove _targetFramework stuff

@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #6749 (1c49d1e) into feature/4.0 (b48e9b7) will increase coverage by 0.23%.
The diff coverage is 76.19%.

@@               Coverage Diff               @@
##           feature/4.0    #6749      +/-   ##
===============================================
+ Coverage        69.64%   69.87%   +0.23%     
===============================================
  Files             1237     1367     +130     
  Lines           247617   256527    +8910     
  Branches         25436    26325     +889     
===============================================
+ Hits            172446   179247    +6801     
- Misses           68561    70376    +1815     
- Partials          6610     6904     +294     
Flag Coverage Δ
Debug 69.87% <76.19%> (+0.23%) ⬆️
production 64.72% <73.68%> (+0.53%) ⬆️
test 88.89% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/Microsoft.ML.Core/CommandLine/CmdParser.cs 56.81% <100.00%> (+0.11%) ⬆️
...oft.ML.Core/Utilities/FuncInstanceMethodInfo1`2.cs 90.32% <ø> (ø)
...oft.ML.Core/Utilities/FuncInstanceMethodInfo1`3.cs 80.64% <ø> (ø)
...oft.ML.Core/Utilities/FuncInstanceMethodInfo1`4.cs 80.64% <ø> (ø)
...oft.ML.Core/Utilities/FuncInstanceMethodInfo2`4.cs 80.64% <ø> (ø)
...oft.ML.Core/Utilities/FuncInstanceMethodInfo3`3.cs 0.00% <ø> (ø)
...oft.ML.Core/Utilities/FuncInstanceMethodInfo3`4.cs 0.00% <ø> (ø)
src/Microsoft.ML.Core/Utilities/Random.cs 80.12% <ø> (-5.13%) ⬇️
src/Microsoft.ML.CpuMath/AvxIntrinsics.cs 96.68% <100.00%> (ø)
src/Microsoft.ML.CpuMath/SseIntrinsics.cs 95.24% <100.00%> (-1.11%) ⬇️
... and 10 more

... and 142 files with indirect coverage changes

@JakeRadMSFT JakeRadMSFT changed the title WIP - Update Projects to .NET 8 in MLNET 4.0 Branch Update Projects to .NET 8 in MLNET 4.0 Branch Jul 11, 2023
@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just as soon remove this type alias to avoid confusion. Doesn't seem all that useful since it's not ifdef'ed.

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right - I'm not sure why this is here. I think the alias should be removed since it's not actually behaving like a native integer.

}

if (Directory.Exists(folder))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason you duplicated this check?

@@ -248,9 +248,17 @@ public override string[] Save(string path, string? prefix = null)
internal static (Dictionary<string, int>?, Vec<(string, string)>) ReadFile(string? vocab, string? merges)
{
Dictionary<string, int>? dic;
using (Stream stream = File.OpenRead(vocab))

if (vocab != null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we intend to support null here? Before I bet File.OpenRead would throw. Should we throw ANE instead?

@@ -2,7 +2,7 @@
<Import Project="$(RepoRoot)eng/pkg/Pack.props" />

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this project we probably want to keep netstandard2.0. We could consider cross-targeting if we want to benefit from net6.0+/net8.0+ APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants