dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.05k stars 1.88k forks source link

Bump versions of maintenance-packages dependencies consumed in machin… #7274

Closed carlossanlop closed 1 week ago

carlossanlop commented 1 month ago

dotnet/runtime depends on these packages that we are now publishing from dotnet/maintenance-packages:

Bumping their versions to consume the new preview versions, available in the dotnet-libraries feed: https://dnceng.visualstudio.com/public/_artifacts/feed/dotnet-libraries

Related PRs:

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.90%. Comparing base (f385b06) to head (908acb5). Report is 7 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #7274 +/- ## ========================================== + Coverage 68.80% 68.90% +0.09% ========================================== Files 1461 1467 +6 Lines 272400 274380 +1980 Branches 28176 28642 +466 ========================================== + Hits 187436 189066 +1630 - Misses 77729 77983 +254 - Partials 7235 7331 +96 ``` | [Flag](https://app.codecov.io/gh/dotnet/machinelearning/pull/7274/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | Coverage Δ | | |---|---|---| | [Debug](https://app.codecov.io/gh/dotnet/machinelearning/pull/7274/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `68.90% <ø> (+0.09%)` | :arrow_up: | | [production](https://app.codecov.io/gh/dotnet/machinelearning/pull/7274/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `63.38% <ø> (+0.07%)` | :arrow_up: | | [test](https://app.codecov.io/gh/dotnet/machinelearning/pull/7274/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `89.18% <ø> (+0.10%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#carryforward-flags-in-the-pull-request-comment) to find out more. [see 22 files with indirect coverage changes](https://app.codecov.io/gh/dotnet/machinelearning/pull/7274/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet)
carlossanlop commented 3 weeks ago

@michaelgsharp there are several dead-lettering failures. Can you take a look? Maybe the VM queues need updating?

michaelgsharp commented 2 weeks ago

/azp run

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 2 pipeline(s).
ericstj commented 2 weeks ago

System.IO.FileLoadException: Could not load file or assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x8013104

The new version of System.Memory is 4.0.2.0. I would expect the test to auto-generate a bindingRedirect for this.

carlossanlop commented 2 weeks ago

I found these two lines hardcoding the package version, which should now be 4.6.0: https://github.com/dotnet/machinelearning/blob/5c503195e8fb64ea5f73c6a46c76d87f4aa0503b/test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/AdditionalMetadataReferences.cs#L17-L23

ericstj commented 2 weeks ago

Those are just for testing the analyzer.

Here the problem is due to RemoteExecutor.

The .dll.config has the correct redirect. If you download the helix payload and examine workitems\Microsoft.ML.CpuMath.UnitTests\Microsoft.ML.CpuMath.UnitTests.dll.config you can see

      <dependentAssembly>
        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
      </dependentAssembly>

But that .dll.config isn't being reused with RemoteExecutor.

ericstj commented 2 weeks ago

This same issue was hit here: https://github.com/dotnet/runtime/issues/104647 @ViktorHofer mentions that it should be handled with https://github.com/dotnet/arcade/blob/fc2f7ce8372a55725aab7b48c25bad7327a9769d/src/Microsoft.DotNet.RemoteExecutor/src/build/Microsoft.DotNet.RemoteExecutor.targets#L8-L33 -- it looks like ML.NET doesn't use that remote executor, but still uses it's own which may not have the fix. So that's the "right fix" here -- make the ML.NET remoteexecutor honor the tests redirects.

If I look at the assembly refs here, most are coming from the netstandard2.0 library which was pinned to 4.0.1.2. In the 4.5.5 version of System.Memory both the netstandard2.0 and net461 libraries had the same version. In the new package we kept netstandard2.0 pinned at 4.0.1.2 but bumped net4* to 4.0.2.0. I wonder if we should avoid doing this in servicing since it'll be introducing the need for a redirect in this scenario? I checked and the version that's inbox in netcoreapp2.1 is actually 4.1.0.0 so we don't need to pin the netstandard2.0 version -- so long as it remains lower than 4.1.0.0.

michaelgsharp commented 2 weeks ago

We don't use the RemoteExecutor in arcade because it doens't support NetFX, so we still have our custom one. Let me take a look at @ViktorHofer's fix and see what it would take to adopt it as well.

ViktorHofer commented 2 weeks ago

@michaelgsharp RemoteExecutor in Arcade supports .NET Framework. A lot of the tests in runtime target framework and depend on RemoteExecutor.

michaelgsharp commented 1 week ago

Closing as #7295 takes care of it and the remote executor update.