dotnet / BenchmarkDotNet

Powerful .NET library for benchmarking
https://benchmarkdotnet.org
MIT License
10.24k stars 952 forks source link

Processor model is not detected on Azure arm64 #2577

Open EgorBo opened 1 month ago

EgorBo commented 1 month ago

When I run any benchmark on Azure ARM64, it reports

BenchmarkDotNet v0.13.12, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
Unknown processor

E.g. https://github.com/dotnet/runtime/pull/102705#issuecomment-2132450520

cat /proc/cpuinfo (which BDN uses) outputs:

$ cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1

processor       : 1
BogoMIPS        : 50.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x3
CPU part        : 0xd0c
CPU revision    : 1
...

and lscpu is:

$ lscpu
Architecture:           aarch64
  CPU op-mode(s):       32-bit, 64-bit
  Byte Order:           Little Endian
CPU(s):                 16
  On-line CPU(s) list:  0-15
Vendor ID:              ARM
  Model name:           Neoverse-N1
    Model:              1
    Thread(s) per core: 1
    Core(s) per socket: 16
    Socket(s):          1
    Stepping:           r3p1
    BogoMIPS:           50.00
    Flags:              fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp

So at least Neoverse-N1, 16 cores would be better than Unknown processor.

From my understanding, on Azure we have 1) Neoverse-N1 (Ampere Altra) 2) Neoverse-N2 (Cobalt 100) (e.g. this is how it's recognized in LLVM)

I'll try to implement it myself if nobody grabs it 🙂

adamsitnik commented 1 month ago

I'll try to implement it myself if nobody grabs it

I am afraid that others might not be able to test this particular case easily. Should I just assign you? ;)

EgorBo commented 1 month ago

I'll try to implement it myself if nobody grabs it

I am afraid that others might not be able to test this particular case easily. Should I just assign you? ;)

Sure, please do 🙂