Skip to content

Conversation

trylek
Copy link
Member

@trylek trylek commented Mar 14, 2023

Based on offline feedback I have modified build of the ASP.NET composite image to explicitly specify the following instruction set extensions per Tanner's suggestion:

avx2 bmi bmi2 lzcnt movbe fma

With this change, the composite image is about 500 KB longer - before the change its length was 33_392_640 B, after the change it's 33_832_960. As we're now working with the partial composite that reduced the previous publishing size by about 30~40 MB, hopefully this shouldn't be much of a concern.

Thanks

Tomas

/cc @dotnet/crossgen-contrib

Based on offline feedback I have modified build of the ASP.NET
composite image to explicitly specify the following instruction
set extensions per Tanner's suggestion:

avx2 bmi bmi2 lzcnt movbe fma

With this change, the composite image is about 500 KB longer -
before the change its length was 33_392_640 B, after the change
it's 33_832_960. As we're now working with the partial composite
that reduced the previous publishing size by about 30~40 MB, hopefully
this shouldn't be much of a concern.

Thanks

Tomas
@trylek trylek added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 14, 2023
@ghost
Copy link

ghost commented Mar 14, 2023

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@ivdiazsa
Copy link
Contributor

LGTM!

@trylek
Copy link
Member Author

trylek commented Mar 15, 2023

Hmm, apparently I'll need to conditionally filter the CPU set extensions per architecture, I'll fix this in the next commit.

@@ -489,6 +489,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<ManagedAssetsFullPath>$(RuntimePackageRoot)$(ManagedAssetsPackagePath)</ManagedAssetsFullPath>
<NativeAssetsFullPath>$(RuntimePackageRoot)$(NativeAssetsPackagePath)</NativeAssetsFullPath>
<PartialCompositeAssemblyListPath>$(MSBuildThisFileDirectory)\PartialCompositeAssemblyList.txt</PartialCompositeAssemblyListPath>
<InstructionSetSupport Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86'">+avx2,+bmi,+bmi2,+lzcnt,+movbe,+fma</InstructionSetSupport>
Copy link
Member

@tannergooding tannergooding Mar 15, 2023

Choose a reason for hiding this comment

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

Why these instead of the simpler +x86-x64-v3 that is supported and means the same thing: https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs#L990

If you're going to specify them explicitly, then you're missing +popcnt.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Tanner for pointing that out, I have updated the specification in the 4th commit based on your suggestion.

@trylek trylek merged commit 5db028a into dotnet:main Mar 15, 2023
@trylek trylek deleted the Avx2Composite branch March 15, 2023 02:02
@ghost ghost added this to the 8.0-preview3 milestone Mar 15, 2023
@@ -489,6 +489,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<ManagedAssetsFullPath>$(RuntimePackageRoot)$(ManagedAssetsPackagePath)</ManagedAssetsFullPath>
<NativeAssetsFullPath>$(RuntimePackageRoot)$(NativeAssetsPackagePath)</NativeAssetsFullPath>
<PartialCompositeAssemblyListPath>$(MSBuildThisFileDirectory)\PartialCompositeAssemblyList.txt</PartialCompositeAssemblyListPath>
<InstructionSetSupport Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86'">+x86-x64-v3</InstructionSetSupport>
Copy link
Member

Choose a reason for hiding this comment

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

anything required for arm64?

@mangod9
Copy link
Member

mangod9 commented Mar 15, 2023

would be good to know the size differences with this change.

@ghost
Copy link

ghost commented Mar 15, 2023

Hi @mangod9. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@trylek
Copy link
Member Author

trylek commented Mar 15, 2023

@mangod9 - I believe I have documented the size diff in the PR description, please let me know if more data is needed. For arm64, I have no idea, the instruction set extensions you pointed out on the Teams thread based on Tanner's suggestions all seem to be Intel-specific.

@ghost
Copy link

ghost commented Mar 15, 2023

Hi @trylek. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@mangod9
Copy link
Member

mangod9 commented Mar 15, 2023

Ah sorry missed that section in the description. Looks reasonable. Thanks

@ghost
Copy link

ghost commented Mar 15, 2023

Hi @mangod9. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants