-
Notifications
You must be signed in to change notification settings - Fork 34
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
archspec 0.1.3 identies AMD Milan in Azure as zen2 due to pku feature that is only listed for zen3 #38
Comments
I’d be curious to see if there’s much of a performance difference between zen2, zen3, and x86_64_v3 targets on Milan. |
@alalazo: I see the support in GCC and also some kernel support for PKU/PKEYS as of 4.9; however this appears already from Intel Skylake; Why now add this as a requirement for recognizing Zen3? In practice, this feature is not supported on the Azure Hypervisor and we have not any customers asking for it either. We're happy to look into it further based on actual application requirements, but I would like to ask to drop this requirement for detection only.... |
I can confirm that on an Intel Skylake system (on prem at HPC-UGent), the
So if we're not including We're actually only doing that for There's still both |
@hmeiland As replied to @boegel in #40 I need to check if the lack of I think the correct solution is to check why PKU is not in the Intel uarchs and eventually start to think of modelling "optional cpu features". As a stop-gap, if we realize this might take more time than we want, we could remove PKU - but we also need to be sure to add flags to each compiler entry that disable the emission of those kind of instructions. |
@alalazo : thank you for looking further into this; as an alternative I'm happy to help compose arch definitions for "Hypervisor vendor: Microsoft", where I do not see a full 1:1 mapping of bare-metal features in the short run.... |
Using
This news seems to point to the fact that PKU instructions have been added to GCC around 2015. Looking at GCC man pages it seems this was introduced in the 6.X series. |
I think the error here is not having Designing support for optional features is possibly good also for AARCH64. Off the top of my head I think we need to:
|
@hmeiland is the goal here to accurately identify the processor or to accurately identify the best instruction set for things compiled on it? I think if it's the latter, using a generic target like |
The goal is to distinguish between We could also consider using the generic targets like We haven't assessed the performance impact of this, it could be small, but it's likely very dependent on the workload too, so difficult to assess. In fact, we probably also want to discriminate between Milan and Milan X, but that may be out of scope for |
I agree with @alalazo — we probably should list pku for skylake, as it’s listed by gcc as supported on skylake machines. It’s also listed in the phoronix releases about zen3 support for gcc and clang:
I don’t consider them “misidentified” at all if it means that binaries labeled We could try to confirm, I suppose. Any chance you could run See here for a more detailed description of what the feature is: What I can’t tell from this is where it would really be used and whether binaries would use instructions directly or go through pkey_set, and whether they would have some sort of mechanism for making that portable if pku isn’t actually available. If the latter is typically the case or if we can narrow down that this just doesn’t appear in any zen3 binaries I think it’s fine to remove. If not we either need fine grained feature selection, or we need to start differentiating between identifying the chip for tuning and identifying the chip for compatibiity. For example, I could see the benefit of having a zen3-tuned x86_64_v3 binary — it might perform way better than a genetically tuned one. That is something we haven’t modeled in archspec much. We could also decide that we don’t care about all the instructions and just start disabling pku by default for zen3 in archspec. That would be sort of like removing it, but we should also add compiler flags to ensure that pku instructions are never emitted. We do finer-grained flags like this for the x86_64_vX descriptions on older compilers — usually by adding instructions to an older target (see, e.g., here for gcc: https://github.com/archspec/archspec-json/blob/master/cpu/microarchitectures.json#L159:L169). This would be simpler than trying to actually model pku. I’d be curious to see performance results, though, to know whether we really need to tune for the arch here, or whether a zen2 or x86_64_v3 binary is just as good. IMO showing that the generic target works just as well is a bigger win — and if it doesn’t we do probably need to think hard about tuning vs. compatibility. |
When running
archspec cpu
on an Azure HB120rs v3 instance (AMD Milan), it answers withzen2
, while it should bezen3
.The problem is that
pku
is not listed as a CPU feature:Should we drop
pku
from thezen3
entry incpu/microarchitectures.json
.Note that
pku
was dropped fromznver3
in #28 by @amd-toolchain-support@hmeiland Do you happen to know why
pku
is not supported as a CPU feature in Azure instances with AMD Milan CPUs?The text was updated successfully, but these errors were encountered: