-
-
Notifications
You must be signed in to change notification settings - Fork 970
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
Add support for LoongArch64. #1971
Add support for LoongArch64. #1971
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @HFDude
Big thanks for your contribution! Overall the code looks good to me, but I don't have the possibility to test it. Is there any chance you have an access to LoongArch64
machine and could provide a screen shot with sample results?
cd .\samples\BenchmarkDotNet.Samples\
dotnet run -c Release -f net5.0 --filter *Basic* --job dry
OK, thank you for your guidance and take time to review and give me suggestions. By the way, may I ask why the size of BenchmarkDotNet.dll compiled by the local BenchmarkDotNet project is only 953K , but the size of the BenchmarkDotNet.dll which download from https://www.nuget.org/packages/BenchmarkDotNet/0.13.1 is 3.4M ? Is there any other projects need to be packed into BenchmarkDotNet.dll together? Yesterday's tests on Ubuntu azure pipelines environment takes so long time, this is indeed abnormal. I have tested this on my local environment Debian10-amd64, and all test cases have passed. The full log can be seen in BenchmarkDotnet-buildandtest-Debian10-arm64.log
~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
~$ uname -a
Linux debian 4.19.0-20-amd64 #1 SMP Debian 4.19.235-1 (2022-03-17) x86_64 GNU/Linux Currently we don’t support dotnet-sdk-5.0, so I add net6.0 TargetFrameworks in BenchmarkDotNet.Samples.csproj: $ git diff samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj
diff --git a/samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj b/samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj
index 299e4138..414035a9 100644
--- a/samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj
+++ b/samples/BenchmarkDotNet.Samples/BenchmarkDotNet.Samples.csproj
@@ -2,7 +2,7 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<AssemblyTitle>BenchmarkDotNet.Samples</AssemblyTitle>
- <TargetFrameworks>net461;net5.0</TargetFrameworks>
+ <TargetFrameworks>net461;net5.0;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AssemblyName>BenchmarkDotNet.Samples</AssemblyName>
<OutputType>Exe</OutputType> Then run on LoongArch64 machine:
Then I choose |
@HFDude I am sorry, I have provided invalid filter. On Unix we need to escape the asterisks with dotnet run -c Release -f net6.0 --filter '*Basic*' --job dry |
That is a great question! The official build is always using Windows machine, which builds the disassembler projects and copies the produced BenchmarkDotNet/src/BenchmarkDotNet/BenchmarkDotNet.csproj Lines 32 to 43 in 09d9396
The full answer is https://adamsitnik.com/Disassembly-Diagnoser/#desktop-net, but in general you should not need these exes if you don't run on Windows. |
It seems that MSBuild does not recognize Could you please remove the following line:
To see if it works when we use |
@adamsitnik ,thanks for your patient and comprehensive guide.
What puzzled me now is that I can't use But while I use |
@HFDude if my suggestion from #1971 (comment) helps, then I am going to merge your PR immediately and our CI is going to publish a "proper" NuGet package for you to our CI feed |
Yes, it worked. Full log: BenchmarkDotnet-linuxLA64-test1.log Thank you very much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, big thanks for your contribution @HFDude !
Big thanks again for your great help! @adamsitnik ! |
The CI failure is unrelated (#1925), I am merging. |
@HFDude once this build finishes (30-60 minutes from now) and it's green (no flaky test failures) the CI is going to publish <packageSources>
<add key="bdn-ci" value="https://ci.appveyor.com/nuget/benchmarkdotnet" />
</packageSources> |
OK, I got it ! And I can successful run performance:release6.0 testcases on linux-LoongArch64 now! @adamsitnik ,Thank you very much! ~/performance/artifacts/bin/MicroBenchmarks/Release/net6.0$ dotnet MicroBenchmarks.dll
Available Benchmarks:
#0 BilinearTest
#1 Burgers
#2 ByteMark
#3 CscBench
#4 LinqBenchmarks
...
...
#438 Perf_XmlNode
You should select the target benchmark(s). Please, print a number of a benchmark (e.g. `0`) or a contained benchmark caption (e.g. `BilinearTest`).
If you want to select few, please separate them with space ` ` (e.g. `1 2 3`).
You can also provide the class name in console arguments by using --filter. (e.g. `--filter '*BilinearTest*'`).
3
// Validating benchmarks:
// ***** BenchmarkRunner: Start *****
// ***** Found 406 benchmark(s) in total *****
// ***** Building 1 exe(s) in Parallel: Start *****
// start dotnet restore /p:DebugType=portable -bl:benchmarkdotnet.binlog /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true in /data/xuliangyu/aaa/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/a6d63f1f-4dcb-45f1-8a70-f0cc010d50db
// command took 9.09s and exited with 0
// start dotnet build -c Release /p:DebugType=portable -bl:benchmarkdotnet.binlog --no-restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true in /data/xuliangyu/aaa/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/a6d63f1f-4dcb-45f1-8a70-f0cc010d50db
// command took 53.7s and exited with 0
// ***** Done, took 00:01:05 (65.52 sec) *****
// Found 2 benchmarks:
// CscBench.CompileTest: Job-FCXLHJ(PowerPlanMode=00000000-0000-0000-0000-000000000000, Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, WarmupCount=1)
// CscBench.DatflowTest: Job-FCXLHJ(PowerPlanMode=00000000-0000-0000-0000-000000000000, Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, WarmupCount=1)
// **************************
// Benchmark: CscBench.CompileTest: Job-FCXLHJ(PowerPlanMode=00000000-0000-0000-0000-000000000000, Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, WarmupCount=1)
// *** Execute ***
// Launch: 1 / 1
// Execute: dotnet a6d63f1f-4dcb-45f1-8a70-f0cc010d50db.dll --benchmarkName CscBench.CompileTest --job "PowerPlanMode=00000000-0000-0000-0000-000000000000, Arguments=/p:DebugType=portable,-bl:benchmarkdotnet.binlog, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, WarmupCount=1" --benchmarkId 0 in /data/xuliangyu/aaa/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/a6d63f1f-4dcb-45f1-8a70-f0cc010d50db/bin/Release/net6.0
...
...
// BeforeAnythingElse
// Benchmark Process Environment Information:
// Runtime=.NET 6.0.3 (42.42.42.42424), LoongArch64 RyuJIT
// GC=Concurrent Workstation
// Job: Job-KGNPHI(PowerPlanMode=00000000-0000-0000-0000-000000000000, IterationTime=250.0000 ms, MaxIterationCount=20, MinIterationCount=15, WarmupCount=1)
OverheadJitting 1: 1 op, 519381.00 ns, 519.3810 us/op
WorkloadJitting 1: 1 op, 3432740297.00 ns, 3.4327 s/op
OverheadJitting 2: 1 op, 970.00 ns, 970.0000 ns/op
WorkloadJitting 2: 1 op, 1046283088.00 ns, 1.0463 s/op
WorkloadWarmup 1: 1 op, 915047434.00 ns, 915.0474 ms/op
// BeforeActualRun
WorkloadActual 1: 1 op, 1011612854.00 ns, 1.0116 s/op
WorkloadActual 2: 1 op, 1018340870.00 ns, 1.0183 s/op
WorkloadActual 3: 1 op, 870055599.00 ns, 870.0556 ms/op
WorkloadActual 4: 1 op, 966901400.00 ns, 966.9014 ms/op
WorkloadActual 5: 1 op, 826897078.00 ns, 826.8971 ms/op
WorkloadActual 6: 1 op, 827985399.00 ns, 827.9854 ms/op
WorkloadActual 7: 1 op, 826334717.00 ns, 826.3347 ms/op
WorkloadActual 8: 1 op, 1011806290.00 ns, 1.0118 s/op
WorkloadActual 9: 1 op, 1003737802.00 ns, 1.0037 s/op
WorkloadActual 10: 1 op, 1001885599.00 ns, 1.0019 s/op
WorkloadActual 11: 1 op, 999917836.00 ns, 999.9178 ms/op
WorkloadActual 12: 1 op, 1003938340.00 ns, 1.0039 s/op
WorkloadActual 13: 1 op, 846382892.00 ns, 846.3829 ms/op
WorkloadActual 14: 1 op, 822978370.00 ns, 822.9784 ms/op
WorkloadActual 15: 1 op, 1003039938.00 ns, 1.0030 s/op
WorkloadActual 16: 1 op, 821671307.00 ns, 821.6713 ms/op
WorkloadActual 17: 1 op, 981547786.00 ns, 981.5478 ms/op
WorkloadActual 18: 1 op, 987987231.00 ns, 987.9872 ms/op
WorkloadActual 19: 1 op, 982453696.00 ns, 982.4537 ms/op
WorkloadActual 20: 1 op, 820786704.00 ns, 820.7867 ms/op
// AfterActualRun
WorkloadResult 1: 1 op, 1011612854.00 ns, 1.0116 s/op
WorkloadResult 2: 1 op, 1018340870.00 ns, 1.0183 s/op
WorkloadResult 3: 1 op, 870055599.00 ns, 870.0556 ms/op
WorkloadResult 4: 1 op, 966901400.00 ns, 966.9014 ms/op
WorkloadResult 5: 1 op, 826897078.00 ns, 826.8971 ms/op
WorkloadResult 6: 1 op, 827985399.00 ns, 827.9854 ms/op
WorkloadResult 7: 1 op, 826334717.00 ns, 826.3347 ms/op
WorkloadResult 8: 1 op, 1011806290.00 ns, 1.0118 s/op
WorkloadResult 9: 1 op, 1003737802.00 ns, 1.0037 s/op
WorkloadResult 10: 1 op, 1001885599.00 ns, 1.0019 s/op
WorkloadResult 11: 1 op, 999917836.00 ns, 999.9178 ms/op
WorkloadResult 12: 1 op, 1003938340.00 ns, 1.0039 s/op
...
... |
@HFDude awesome! btw we are most likely going to update BDN version used by the performance repo very soon (so you won't need any local changes) |
Looking forward it! |
@HFDude dotnet/performance#2341 (I expect it to get merged today as soon as USA folks start their workday) |
Add LoongArch64 architecture.