Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ff5ae22
Implemented SSE support and software fallbacks for key intrinsics
briancylui Jun 29, 2018
8fc9b18
Implemented unit tests for key intrinsics with passing results
briancylui Jun 29, 2018
8e8090d
Implemented performance tests on some key intrinsics with BenchmarkDo…
briancylui Jun 29, 2018
6b3660c
Fixed array pinning issues and solved unreported latency of NativeDotSU
briancylui Jun 30, 2018
aa5ee2a
Minor syntax change for style consistency in fixed statements
briancylui Jul 1, 2018
f096eb5
Implemented performance tests for all key intrinsics
briancylui Jul 1, 2018
40def43
Simulated user performance with large inputs
briancylui Jul 3, 2018
a8f2726
Allow CpuMath to reference C# Hardware Intrinsics APIs.
eerhardt Jul 10, 2018
9355547
Added files for the hierarchical framework to prepare for multi-targe…
briancylui Jul 11, 2018
e617f05
Removed the redundant CpuMathUtils.cs file.
briancylui Jul 12, 2018
94751d1
Cleaned up the primitive build constant for featuring intrinsics
briancylui Jul 17, 2018
7a55fcc
Created a new helper class holding C# implementations of SSE intrinsi…
briancylui Jul 17, 2018
f76a028
Minor change in naming of variables
briancylui Jul 18, 2018
b84047a
Implemented more SSE intrinsics
briancylui Jul 19, 2018
bdd41dd
Changed version number of .NET Core App as target framework
briancylui Jul 19, 2018
55dffa5
Cleaned up unit test file that needs to be split into two for multi-t…
briancylui Jul 19, 2018
a636173
Fixed seed in performance tests
briancylui Jul 19, 2018
27a042a
Cleaned up unreferenced namespaces
briancylui Jul 19, 2018
27e79a2
Split unit tests into two projects for multi-targetting
briancylui Jul 19, 2018
2d8f373
Cleaned up new intrinsics that are not yet tested to prepare for PR
briancylui Jul 19, 2018
6c3a3e7
Minor style changes
briancylui Jul 20, 2018
8f1ef4c
Added the solution package that includes multi-targeting with UseIntr…
briancylui Jul 20, 2018
cf1e0d0
Included all files in the CpuMath project for display in Visual Studi…
briancylui Jul 20, 2018
f0f81a5
Removed irrelevant build line from CpuMath
briancylui Jul 20, 2018
29ef073
Response to PR review
briancylui Jul 30, 2018
584bb45
Removed deprecated src\Native\CpuMath working folder
briancylui Jul 30, 2018
7d1f6d1
Removed unnecessary references in unit tests
briancylui Jul 30, 2018
4191c6b
Minor style changes
briancylui Jul 30, 2018
aa28480
Fixed SLN file
briancylui Jul 30, 2018
4e50945
Merge with dotnet/master
briancylui Jul 30, 2018
6ef42da
Fixed build error with netcoreapp3.0 not supported
briancylui Jul 30, 2018
ff83d66
Minor style fixes
briancylui Jul 31, 2018
2537f2d
Skip netcoreapp3.0 projects when not building for intrinsics
briancylui Jul 31, 2018
fa821aa
Merge with dotnet/master
briancylui Jul 31, 2018
c6f5f85
Exclude netcoreapp3.0 tests from running by overriding VSTest target
briancylui Jul 31, 2018
0a50f46
Second response to PR feedback
briancylui Jul 31, 2018
946d425
Removed NETCoreAppMaximumVersion tags with modification
briancylui Aug 1, 2018
f3ff9b4
Moved VSTest targets to Empty.targets, and parsed -Intrinsics configs…
briancylui Aug 2, 2018
f7f5fef
Modified VectorSum to fix perf results
briancylui Aug 3, 2018
5a42d5d
Modified VectorSum to comply with latest C# language updates
briancylui Aug 3, 2018
2d8fe26
Response to PR feedback: added a comment and removed unnecessary MSBu…
briancylui Aug 3, 2018
980db82
Made private functions for SSE intrinsics inline
briancylui Aug 3, 2018
3ff5c0b
Fix merge conflicts
briancylui Aug 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,11 @@
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
</PropertyGroup>

<PropertyGroup>
<UseIntrinsics Condition="'$(UseIntrinsics)' == ''">$(Configuration.EndsWith('-Intrinsics'))</UseIntrinsics>
</PropertyGroup>

<PropertyGroup>
<CustomAfterMicrosoftCommonTargets>$(RepoRoot)build\AfterCommonTargets.targets</CustomAfterMicrosoftCommonTargets>
</PropertyGroup>
</Project>
34 changes: 34 additions & 0 deletions Microsoft.ML.sln
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CodeAnalyzer",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CodeAnalyzer.Tests", "test\Microsoft.ML.CodeAnalyzer.Tests\Microsoft.ML.CodeAnalyzer.Tests.csproj", "{3E4ABF07-7970-4BE6-B45B-A13D3C397545}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CpuMath.PerformanceTests", "test\Microsoft.ML.CpuMath.PerformanceTests\Microsoft.ML.CpuMath.PerformanceTests.csproj", "{7333EDEF-4144-405C-A5EC-6F42201857D8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CpuMath.UnitTests.netstandard", "test\Microsoft.ML.CpuMath.UnitTests.netstandard\Microsoft.ML.CpuMath.UnitTests.netstandard.csproj", "{A0E562A9-0E6D-470D-B180-6EB44BA84D60}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.CpuMath.UnitTests.netcoreapp", "test\Microsoft.ML.CpuMath.UnitTests.netcoreapp\Microsoft.ML.CpuMath.UnitTests.netcoreapp.csproj", "{5F81A2A4-73AD-494C-B387-07D605EC8826}"
EndProject

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.ImageAnalytics", "src\Microsoft.ML.ImageAnalytics\Microsoft.ML.ImageAnalytics.csproj", "{00E38F77-1E61-4CDF-8F97-1417D4E85053}"
EndProject
Global
Expand Down Expand Up @@ -331,6 +338,30 @@ Global
{3E4ABF07-7970-4BE6-B45B-A13D3C397545}.Release|Any CPU.Build.0 = Release|Any CPU
{3E4ABF07-7970-4BE6-B45B-A13D3C397545}.Release-Intrinsics|Any CPU.ActiveCfg = Release|Any CPU
{3E4ABF07-7970-4BE6-B45B-A13D3C397545}.Release-Intrinsics|Any CPU.Build.0 = Release|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Debug-Intrinsics|Any CPU.Build.0 = Debug|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Release|Any CPU.Build.0 = Release|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Release-Intrinsics|Any CPU.ActiveCfg = Release|Any CPU
{7333EDEF-4144-405C-A5EC-6F42201857D8}.Release-Intrinsics|Any CPU.Build.0 = Release|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Debug-Intrinsics|Any CPU.Build.0 = Debug|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Release|Any CPU.Build.0 = Release|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Release-Intrinsics|Any CPU.ActiveCfg = Release|Any CPU
{A0E562A9-0E6D-470D-B180-6EB44BA84D60}.Release-Intrinsics|Any CPU.Build.0 = Release|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Debug-Intrinsics|Any CPU.Build.0 = Debug|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Release|Any CPU.Build.0 = Release|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Release-Intrinsics|Any CPU.ActiveCfg = Release|Any CPU
{5F81A2A4-73AD-494C-B387-07D605EC8826}.Release-Intrinsics|Any CPU.Build.0 = Release|Any CPU
{00E38F77-1E61-4CDF-8F97-1417D4E85053}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00E38F77-1E61-4CDF-8F97-1417D4E85053}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00E38F77-1E61-4CDF-8F97-1417D4E85053}.Debug-Intrinsics|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -375,6 +406,9 @@ Global
{001F3B4E-FBE4-4001-AFD2-A6A989CD1C25} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{DCF46B79-1FDB-4DBA-A263-D3D64E3AAA27} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
{BF66A305-DF10-47E4-8D81-42049B149D2B} = {D3D38B03-B557-484D-8348-8BADEE4DF592}
{7333EDEF-4144-405C-A5EC-6F42201857D8} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
{A0E562A9-0E6D-470D-B180-6EB44BA84D60} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
{5F81A2A4-73AD-494C-B387-07D605EC8826} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
{B4E55B2D-2A92-46E7-B72F-E76D6FD83440} = {7F13E156-3EBA-4021-84A5-CD56BA72F99E}
{3E4ABF07-7970-4BE6-B45B-A13D3C397545} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
{00E38F77-1E61-4CDF-8F97-1417D4E85053} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
Expand Down
3 changes: 2 additions & 1 deletion build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
<Target Name="RestoreProjects" Condition="'$(RestoreDuringBuild)'=='true'">
<Message Importance="High" Text="Restoring all projects..." />
<MSBuild Projects="@(Project)"
Targets="Restore" />
Targets="Restore"
Properties="MSBuildWarningsAsMessages=NU1503" />
</Target>

<Target Name="BuildNative" Condition="'$(SkipNativeBuild)' != 'true'">
Expand Down
14 changes: 14 additions & 0 deletions build/AfterCommonTargets.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<VSTestTargets Condition="'$(UseIntrinsics)' != 'true' and '$(TargetFramework)' == 'netcoreapp3.0'">ignore.targets</VSTestTargets>
Copy link
Member

Choose a reason for hiding this comment

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

What does this do? I'm not familiar. Also, since you are also overriding VSTest - isn't that enough?

Copy link
Member

Choose a reason for hiding this comment

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

If we keep this property setting, we should factor out '$(UseIntrinsics)' != 'true' and '$(TargetFramework)' == 'netcoreapp3.0' into an MSBuild property so it is only declared once.


In reply to: 206735143 [](ancestors = 206735143)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out that the place where we try to blank VSTest (https://github.com/dotnet/machinelearning/pull/562/files/c6f5f8569ea31bc30e0b7ae54870b9cbf51e2bdb#diff-77ebf330684fd059d7aecec3ce7e6218R19) is processed before the program builds the actual VSTest, so without this line, even though we would have blanked VSTest, the entire VSTest would be built all over again. Because of this order of the build, one way to solve this issue is to ignore the built targets of VSTest to ignore the test projects. Not sure if it is the best way to do it so feel free to suggest any optimization.

Copy link
Member

Choose a reason for hiding this comment

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

I helped him with this yesterday and by doing a pp log I found out that Microsoft.TestPlatform.targets where imported after the actual Empty.targets file even though they are specified to be imported after the common targets, I don't know if that is the way it is designed or if it is a bug.

So I found out that there was a VSTestTargets overridable property declared in: 15.0\Microsoft.Common.targets\ImportAfter\Microsoft.TestPlatform.ImportAfter.targets:17 that points to Microsoft.TestPlatform.targets and this ImportAfter.targets file will import that project if the specified path exists. So in order to override the VSTest target I suggested to just set that property to a non-existent targets file.

Copy link
Member

Choose a reason for hiding this comment

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

So if I'm reading this correctly, that means this line in Empty.targets:

<Target Name="VSTest"/>

Isn't doing anything and can be removed, right?

Also - it would probably make sense to move setting this property into Empty.targets. That would resolve my "we should factor this condition out" comment above as well. build/AfterCommonTargets.targets is responsible for deciding whether Empty.targets should be imported. Empty.targets decides how to ensure no targets are run (which includes setting this property).

Copy link
Member

@safern safern Aug 1, 2018

Choose a reason for hiding this comment

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

So if I'm reading this correctly, that means this line in Empty.targets:

<Target Name="VSTest"/>

Isn't doing anything and can be removed, right?

It is actually needed because in run-tests.proj we're calling the VSTest target on every test project: https://github.com/dotnet/machinelearning/blob/master/test/run-tests.proj#L10

And if we don't declare it, it will complain saying that the VSTest target doesn't exist in both test projects targeting netcoreapp3.0.

Also - it would probably make sense to move setting this property into Empty.targets. That would resolve my "we should factor this condition out" comment above as well. build/AfterCommonTargets.targets is responsible for deciding whether Empty.targets should be imported. Empty.targets decides how to ensure no targets are run (which includes setting this property).

That is right, no sense having the same condition twice, just declare it when Empty.targets is imported, which is conditioned already.

I also thought of just simply excluding both projects from: https://github.com/dotnet/machinelearning/blob/master/test/run-tests.proj#L5

But it makes more sense to me to do everything inside Empty.targets since whenever the repo is ready to build and target netcoreapp3.0 we can just remove this files and we're good to go.

</PropertyGroup>

<!--
We use netcoreapp3.0 for C# intrinsics, but 3.0 isn't supported in CI or in normal development
environments yet. So when we are targeting netcoreapp3.0, but aren't building for intrinsics,
we need to skip the project.
-->
<Import Condition="'$(UseIntrinsics)' != 'true' and '$(TargetFramework)' == 'netcoreapp3.0'"
Project="$(RepoRoot)build\Empty.targets" />
</Project>
21 changes: 21 additions & 0 deletions build/Empty.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>

<!--
Copied from https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.Arcade.Sdk/tools/Empty.targets

Import this file to suppress all targets while allowing the project to participate in the build.
Workaround for https://github.com/dotnet/sdk/issues/2071.

The targets defined here are not sufficient for the project to be open in Visual Studio without issues though.
-->

<Target Name="_IsProjectRestoreSupported"/>
<Target Name="Restore"/>
<Target Name="Build"/>
<Target Name="Test"/>
<Target Name="VSTest"/>
<Target Name="Pack"/>
</Project>
Loading