Skip to content
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

Remove pmull feature from A64FX #59

Merged
merged 2 commits into from
Dec 7, 2022
Merged

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Dec 6, 2022

With this change in Spack I finally get on Ookami

$ spack arch
linux-rocky8-a64fx

This was missed in #44. Should fix #23. Again.

With this change in Spack I finally get on Ookami
```console
$ spack arch
linux-rocky8-a64fx
```
@alalazo
Copy link
Member

alalazo commented Dec 6, 2022

Can you add a sample of that system /proc/cpuinfo for the tests?

@alalazo alalazo self-assigned this Dec 6, 2022
@giordano
Copy link
Contributor Author

giordano commented Dec 6, 2022

I added the test. I get exactly the same on both Isambard 2 and Ookami, which are both HPE Apollo 80, maybe that's the difference as suggested by @christopheredsall in #23 (comment).

@giordano
Copy link
Contributor Author

giordano commented Dec 6, 2022

For reference, on Fugaku I get

diff --git a/tests/targets/linux-rocky8-a64fx b/tests/targets/linux-rocky8-a64fx
index 2484dbe..2c383c7 100644
--- a/tests/targets/linux-rocky8-a64fx
+++ b/tests/targets/linux-rocky8-a64fx
@@ -1,6 +1,6 @@
 processor       : 0
 BogoMIPS        : 200.00
-Features        : fp asimd evtstrm sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm fcma dcpop sve
+Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm fcma dcpop sve
 CPU implementer : 0x46
 CPU architecture: 8
 CPU variant     : 0x1

so the difference is really aes+pmull. Quite worryingly, they show the same midr, which makes it impossible to distinguish the two CPUs in a proper way without looking at the individual features.

@giordano
Copy link
Contributor Author

giordano commented Dec 6, 2022

Actually, with this change in Spack on Isambard

$ git diff
diff --git a/lib/spack/external/archspec/json/cpu/microarchitectures.json b/lib/spack/external/archspec/json/cpu/microarchitectures.json
index 15d32e9fa0..493f4d2278 100644
--- a/lib/spack/external/archspec/json/cpu/microarchitectures.json
+++ b/lib/spack/external/archspec/json/cpu/microarchitectures.json
@@ -2302,7 +2302,6 @@
         "fp",
         "asimd",
         "evtstrm",
-        "pmull",
         "sha1",
         "sha2",
         "crc32",

I still get

$ spack arch
cray-rhel8-aarch64

So this change seems to do the trick only on Ookami, but not Isambard, but now I'm running out of ideas 😞

@alalazo
Copy link
Member

alalazo commented Dec 6, 2022

If you can add (or post in a comment) a /proc/cpuinfo for Isambard too, we can have a look at that too.

@giordano
Copy link
Contributor Author

giordano commented Dec 6, 2022

It's identical to Ookami 🙂

@giordano
Copy link
Contributor Author

giordano commented Dec 6, 2022

We found offline that

$ spack python -c "import archspec.cpu;str(archspec.cpu.host())"
'a64fx'

so the problem might be in Spack how it detects the microarchitecture for Cray system, but archspec should be doing its job correctly 🥳

@alalazo
Copy link
Member

alalazo commented Dec 7, 2022

@fspiga Another case where clang activates more features than gcc:

root@af353b147339:/# gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@af353b147339:/# gcc -dM -E - -mcpu=a64fx < /dev/null | grep __ARM_FEATURE_ | sort
#define __ARM_FEATURE_ATOMICS 1
#define __ARM_FEATURE_CLZ 1
#define __ARM_FEATURE_CRC32 1
#define __ARM_FEATURE_FMA 1
#define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
#define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
#define __ARM_FEATURE_IDIV 1
#define __ARM_FEATURE_NUMERIC_MAXMIN 1
#define __ARM_FEATURE_QRDMX 1
#define __ARM_FEATURE_SVE 1
#define __ARM_FEATURE_SVE_BITS 0
#define __ARM_FEATURE_SVE_VECTOR_OPERATORS 1
#define __ARM_FEATURE_UNALIGNED 1

root@af353b147339:/# clang --version
Ubuntu clang version 14.0.0-1ubuntu1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
root@af353b147339:/# clang -dM -E - -mcpu=a64fx < /dev/null | grep __ARM_FEATURE_ | sort             
#define __ARM_FEATURE_AES 1
#define __ARM_FEATURE_ATOMICS 1
#define __ARM_FEATURE_CLZ 1
#define __ARM_FEATURE_CRC32 1
#define __ARM_FEATURE_CRYPTO 1
#define __ARM_FEATURE_DIRECTED_ROUNDING 1
#define __ARM_FEATURE_DIV 1
#define __ARM_FEATURE_FMA 1
#define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1
#define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1
#define __ARM_FEATURE_IDIV 1
#define __ARM_FEATURE_LDREX 0xF
#define __ARM_FEATURE_NUMERIC_MAXMIN 1
#define __ARM_FEATURE_QRDMX 1
#define __ARM_FEATURE_SHA2 1
#define __ARM_FEATURE_SVE 1
#define __ARM_FEATURE_UNALIGNED 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A64FX processor in Isambard 2 not recognized by archspec
2 participants