Skip to content

Conversation

@snnn
Copy link
Member

@snnn snnn commented Oct 24, 2025

This PR fixes an issue where KleidiAI was incorrectly enabled on systems that support SME1 but not SME2, leading to crashes.

The issue was reported in #26377.

The fix involves changing the check in onnxruntime/core/mlas/lib/platform.cpp to use HasArm_SME2() instead of HasArm_SME(). This ensures that KleidiAI is only enabled on systems that have SME2 support.

This PR fixes an issue where KleidiAI was incorrectly enabled on systems that support SME1 but not SME2, leading to crashes.

The issue was reported in #26377.

The fix involves changing the check in onnxruntime/core/mlas/lib/platform.cpp to use HasArm_SME2() instead of HasArm_SME(). This ensures that KleidiAI is only enabled on systems that have SME2 support.
@snnn snnn closed this Oct 24, 2025
@snnn snnn reopened this Oct 24, 2025
@patryk-kaiser-ARM
Copy link
Contributor

patryk-kaiser-ARM commented Oct 24, 2025

sme_check_fix.patch

We are aware that SME2 kernels can be executed on SME only hardware in qgemm.cpp and convolve.cpp, #26301 fixes the issue for qgemm and another pr will be put in place soon to fix the checks in convolve.
For now it would be suggested to apply the attached patch to fix this issue and leave the check in platform.cpp for SME only as sgemm supports both (SME2 feature present implies SME).
Future PRs from us will have made these checks more robust also as we are moving to use an interface for all the kernels starting with sgemm (#26302)

@Craigacp
Copy link
Contributor

I think this might fix the crash reported in #26361 as well.

@snnn
Copy link
Member Author

snnn commented Oct 24, 2025

@patryk-kaiser-ARM , then I will close this pull request and wait your PRs.

@snnn snnn closed this Oct 24, 2025
@snnn
Copy link
Member Author

snnn commented Oct 24, 2025

I extracted the other part to a new PR: #26405

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants