Skip to content

Fix: Disable KleidiAI on systems with SME1 but not SME2 - #26399

Closed
snnn wants to merge 1 commit into
mainfrom
fix/kleidiai-sme2-check
Closed

Fix: Disable KleidiAI on systems with SME1 but not SME2#26399
snnn wants to merge 1 commit into
mainfrom
fix/kleidiai-sme2-check

Conversation

@snnn

@snnn snnn commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

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

patryk-kaiser-ARM commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@snnn

snnn commented Oct 24, 2025

Copy link
Copy Markdown
Contributor Author

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

@snnn snnn closed this Oct 24, 2025
@snnn

snnn commented Oct 24, 2025

Copy link
Copy Markdown
Contributor Author

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.

3 participants