-
Couldn't load subscription status.
- Fork 3.5k
Description
Describe the issue
Commit cd450d1 introduced the usage of the KleidiAI library. However, the test to enable it in platform.cpp just checks for SME, rather than SME2.
if(MLAS_CPUIDINFO::GetCPUIDInfo().HasArm_SME()){
this->MlasGemmBatchOverride = ArmKleidiAI::MlasGemmBatch;
this->MlasGemmPackBSizeOverride = ArmKleidiAI::MlasGemmPackBSize;
this->MlasGemmPackBOverride = ArmKleidiAI::MlasGemmPackB;
this->MlasConvPrepareOverride = ArmKleidiAI::MlasConvPrepare;
this->MlasConvOverride = ArmKleidiAI::MlasConv;
}
This allows the library to be used on systems that support SME but not SME2, leading to illegal instructions during a run.
The newest pytorch/cpuinfo implementation has support for cpuinfo_has_arm_sme2(). https://github.com/search?q=repo%3Apytorch%2Fcpuinfo%20cpuinfo_has_arm_sme2&type=code
This needs to be added to cpuid_info.cc and exposed with a new function. Meanwhile, the default build should include "--no_kleidiai".
To reproduce
Run a simple convolution using the CPU execution provider on a device that supports SME1, but not SME2.
Urgency
No response
Platform
Android
OS Version
16
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
1.23
ONNX Runtime API
C++
Architecture
ARM64
Execution Provider
Default CPU
Execution Provider Library Version
No response