cpuinfo icon indicating copy to clipboard operation
cpuinfo copied to clipboard

Windows ARM I8MM detection

Open edgchen1 opened this issue 10 months ago • 2 comments

On my Windows ARM device, cpuinfo_has_arm_i8mm() returns false but the value of ID_AA64ISAR1_EL1 indicates that I8MM is supported.

From a look at the code, I did not see where cpuinfo_isa.i8mm gets set in the Windows ARM code path. https://github.com/pytorch/cpuinfo/blob/b73ae6ce38d5dd0b7fe46dbe0a4b5f4bab91c7ea/src/arm/windows/init.c#L189-L219

Is I8MM detection implemented for Windows ARM?

edgchen1 avatar Feb 20 '25 20:02 edgchen1

You are right, it doesn't look like it. Do you want to create a PR?

digantdesai avatar Feb 21 '25 04:02 digantdesai

Also note that in ARM v9 with sve, i8mm is optional and technically needs to be detected.

i8mm requires a fairly new arm cpu. Its in the Pixel 8, which is Cortex X1. Its in the Qualcomm Oryon based Windows ARM machines, which we can test on Android in Samsung S25.

I maintain libyuv and it has i8mm detect for windows, that looks like what you have.

// For AArch64, but public to allow testing on any CPU.
LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() {
  // Neon is mandatory on AArch64, so enable unconditionally.
  int features = kCpuHasNEON;

  // For more information on IsProcessorFeaturePresent(), see:
  // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent#parameters
#ifdef PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE
  if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)) {
    features |= kCpuHasNeonDotProd;
  }
#endif
  // No Neon I8MM or SVE feature detection available here at time of writing.
  return features;
}

fbarchard avatar Jun 24 '25 21:06 fbarchard

Fixed by https://github.com/pytorch/cpuinfo/pull/333.

edgchen1 avatar Nov 18 '25 20:11 edgchen1