You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove the AddScaleSU performance regression for AVX #1195
Our profiles show that AddScaleSU which should be faster with AVX is actually slower and takes more time. This can be confirmed running our CpuMathBenchmarks:
..\..\Tools\dotnetcli\dotnet.exe run -c Release-Intrinsics -- -f *.AddScaleSU --join
GatherVector256 is now implemented: dotnet/coreclr#19392, so we should be able to use the latest .NET Core 3.0 runtime and we should be able to fix this.
@helloguo GitHub won't let me actually set the assigned to field to you, but this note indicates that others should not work on it without interacting here.
@eerhardt if you have the rights to assign @helloguo to this issue please do so
It's possible that gather instruction helps more on the newer generation processors when we replace Avx.SetVector256 with Avx2.GatherVector256 than that on the old generation processors.
This particular API spends a lot of time loading data and storing the data back. If we compare the AVX C# version and SSE C# version, the store part is almost same. For the load part, it may worth trying Load4 twice and SetHighLow to see it could help on @adamsitnik 's machine.
Activity
eerhardt commentedon Oct 9, 2018
GatherVector256is now implemented: dotnet/coreclr#19392, so we should be able to use the latest .NET Core 3.0 runtime and we should be able to fix this.helloguo commentedon Oct 9, 2018
I can update the code with GatherVector256. Please assign it to me :)
adamsitnik commentedon Oct 9, 2018
@helloguo GitHub won't let me actually set the assigned to field to you, but this note indicates that others should not work on it without interacting here.
@eerhardt if you have the rights to assign @helloguo to this issue please do so
eerhardt commentedon Oct 9, 2018
I can't either - I think it is because @helloguo is not a contributor to this repo...?
Update Load8 with GatherVector256 instruction for .NET Core 3 (#1200) f…
adamsitnik commentedon Oct 10, 2018
I have to reopen this issue, #1200 has helped a LOT, but it's still slower:
danmoseley commentedon Oct 11, 2018
BTW, would any other methods in avxintrinsics.cs potentially benefit from an AVX2 codepath? If so we should open an up for grabs issue. @tannergooding
tannergooding commentedon Oct 11, 2018
@adamsitnik, @helloguo. Is the perf differences potentially caused by the varying latency per microarchitecture for the
VGATHER*instructions?Agner's Instruction Tables gives the following (see https://www.agner.org/optimize/instruction_tables.pdf for more details):
AMD Ryzen
Intel Haswell
Intel Broadwell
Intel Skylake
helloguo commentedon Oct 12, 2018
It's possible that gather instruction helps more on the newer generation processors when we replace
Avx.SetVector256withAvx2.GatherVector256than that on the old generation processors.This particular API spends a lot of time loading data and storing the data back. If we compare the AVX C# version and SSE C# version, the store part is almost same. For the load part, it may worth trying
Load4twice andSetHighLowto see it could help on @adamsitnik 's machine.