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

System.Runtime.Intrinsics in .NET Core 2.1 #25206

Closed
eerhardt opened this issue Feb 27, 2018 · 10 comments
Closed

System.Runtime.Intrinsics in .NET Core 2.1 #25206

eerhardt opened this issue Feb 27, 2018 · 10 comments
Labels
area-System.Runtime.Intrinsics design-discussion Ongoing discussion about design without consensus
Milestone

Comments

@eerhardt
Copy link
Member

System.Runtime.Intrinsics in .NET Core 2.1

.NET Core 2.1 has been adding platform intrinsic APIs to support directly calling processor specific instructions, such as Intel’s x86 SIMD instructions. See the initial platform intrinsics design for more information.

We have decided that it makes the most sense for this intrinsics feature to ship in a “preview” status in the .NET Core 2.1 RTM timeframe. This means that the runtime support we are implementing will be included, but the assembly exposing the intrinsics will only be available to projects via explicit reference to a “preview-only” package. These APIs won’t be included in the official .NET Core 2.1 packages.

Given our limited time and resources, recent changes in the approach we take to expose the intrinsics, and API changes prompted by design feedback from the community, we don’t believe there is enough time to settle these APIs for 2.1. We plan to follow the pattern of other recent features like Span<T> and Memory<T> that first shipped in preview before formally joining the supported API surface. Not only would we expect the next version of .NET Core to support more intrinsics than could be supported in 2.1, but we expect to have real usage examples in CoreFX and higher level components as well. These real world examples, as well as feedback from customers who opt in to the preview, should give us the confidence we need to officially support the APIs going forward.

Details

In the coming days, we plan on removing System.Runtime.Intrinsics.dll from the Microsoft.NETCore.App package. This means any libraries/applications that are using these APIs will no longer compile by default, and will not run on new builds of .NET Core 2.1.

At the same time, we will start producing a new System.Runtime.Intrinsics.Experimental NuGet package. In order to continue using these APIs on .NET Core 2.1, a project will need to add a reference to this new package.

As its name implies, this package is experimental and should only be used for preview purposes. It isn’t expected to be used in production scenarios. Future version of .NET Core (after 2.1) will be allowed to break this package. This enables us respond to future feedback that requires the APIs to be modified.

In the future, when we are confident we have the intrinsic APIs right, we will stop producing the System.Runtime.Intrinsics.Experimental package. The platform intrinsics APIs will then be added back to Microsoft.NETCore.App and will be officially supported.

Call to action

Please review this plan and provide any feedback in the comments of this issue.

@tannergooding
Copy link
Member

FYI. @fiigii, @4creators, @sdmaclea, since this explicitly impacts the people currently working on implementing these intrinsics.

Any pending code still needs to be checked in before the unannounced code freeze date in order to make the 2.1 preview of this feature. Otherwise it will be pushed out to the future milestone.

Also CC. @CarolEidt, @eerhardt, @RussKeldorph

@sdmaclea
Copy link
Contributor

@eerhardt @CarolEidt For Arm64, we need to decide the review process for including an API in System.Runtime.Intrinsics.Experimental. Do these need formal reviews?

@CarolEidt
Copy link
Contributor

For Arm64, we need to decide the review process for including an API in System.Runtime.Intrinsics.Experimental. Do these need formal reviews?

The API review process isn't my purview, so I can't make this call, though given that this is experimental I would like to see us adopt an open model where we can expose the Arm64 hardware intrinsic APIs prior to formal review. However, I'll leave that call to @eerhardt and the other API experts.

@eerhardt
Copy link
Member Author

@sdmaclea - I think it makes sense to add the Arm64 intrinsic APIs that are already implemented to the new System.Runtime.Intrinsics.Experimental package, even without an explicit formal review. We will still need to complete a formal review before the APIs can be shipped/marked as 'stable', but that shouldn't block us from getting feedback on these APIs now.

/cc @terrajobst - in case he has any objections.

@sdmaclea - Can you create a PR to add the APIs that are complete and working to https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs? I plan on removing the X86 APIs that aren't complete/working in the next day or two.

@eerhardt
Copy link
Member Author

Closing as this work is complete for 2.1.

@colgreen
Copy link
Contributor

colgreen commented Jun 1, 2018

The System.Runtime.Intrinsics.Experimental nuget package is currently showing as unlisted. Has this moved elsewhere, and/or is there any info on the current situation with the hardware intrinsics support?

@airbreather
Copy link

@colgreen I found it on MyGet.

@eerhardt
Copy link
Member Author

eerhardt commented Jun 4, 2018

Has this moved elsewhere, and/or is there any info on the current situation with the hardware intrinsics support?

I found it on MyGet.

Since the package only contains experimental/pre-release APIs, it wasn't intended to be published on nuget.org. It will never be a stable package since when the APIs are considered stable they will be contained in Microsoft.NETCore.App. We accidentally pushed the package to nuget.org as part of our pre-releases of .NET Core 2.1 and didn't notice it until recently.

@airbreather is correct that the official place to get this package is on our myget feed. The 4.5.0-rtm package is the correct version to use with the RTM version of .NET Core 2.1. Don't use the 4.6.x-xxx versions with .NET Core 2.1 because they are not compatible.

@nathan-alden-sr
Copy link

FYI folks, this is currently breaking .NET Core 2.1+ unit test projects in Azure Pipelines' Microsoft-hosted VS 2019/Windows Server 2019 image:

The nuget command failed with exit code(1) and error(NU1102: Unable to find package System.Runtime.Intrinsics.Experimental with version (>= 4.6.0-preview1-26724-02)
  - Found 2 version(s) in <redacted> [ Nearest version: 4.5.0-rc1 ]
NU1102: Unable to find package System.Runtime.Intrinsics.Experimental with version (>= 4.6.0-preview1-26724-02)
  - Found 2 version(s) in <redacted> [ Nearest version: 4.5.0-rc1 ]
Errors in d:\a\1\s\test\Core.UnitTests\Core.UnitTests.csproj
    NU1102: Unable to find package System.Runtime.Intrinsics.Experimental with version (>= 4.6.0-preview1-26724-02)
      - Found 2 version(s) in <redacted> [ Nearest version: 4.5.0-rc1 ]
Errors in d:\a\1\s\test\Entities.UnitTests\Entities.UnitTests.csproj
    NU1102: Unable to find package System.Runtime.Intrinsics.Experimental with version (>= 4.6.0-preview1-26724-02)
      - Found 2 version(s) in <redacted> [ Nearest version: 4.5.0-rc1 ])
Packages failed to restore

On my local system with Visual Studio 2019 RTM everything works fine, of course.

@GrabYourPitchforks
Copy link
Member

@nathan-alden See the comment at https://github.com/dotnet/corefx/issues/27486#issuecomment-394405562. Please open a new issue if you're still blocked. It's unlikely anybody will respond to this particular issue as it's long since closed.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.Intrinsics design-discussion Ongoing discussion about design without consensus
Projects
None yet
Development

No branches or pull requests

9 participants