Skip to content

Conversation

@Colm-in-Arm
Copy link
Contributor

Description

Adding a cmake compile time parameter to disable the use of SME by KleidiAI.

Motivation and Context

There are occasions during testing that some users wish to compare the relative performance of a model both with and without the SME CPU feature. This change adds a cmake parameter, onnxruntime_KLEIDIAI_SME_DISABLED, to enable this.

In addition there was an error in the handling of the existing onnxruntime_KLEIDIAI_KERNEL_LOGGING and onnxruntime_KLEIDIAI_KERNEL_LOGGING compile time parameters. The definition in cmake/onnxruntime_mlas.cmake did not match the usage in onnxruntime/core/mlas/lib/kleidiai/mlasi_kleidiai.h.

JonathanC-ARM and others added 3 commits December 10, 2025 11:22
* Add onnxruntime_KLEIDIAI_SME_DISABLED as a cmake parameter.
* In mlas_kleidiai.h set to false IsSMEAvailable when the parameter is set.
* Fix bad parameter naming of onnxruntime_KLEIDIAI_DEBUG_LOGGING and
  onnxruntime_KLEIDIAI_KERNEL_LOGGING in cmake/onnxruntime_mlas.cmake.

Signed-off-by: Colm Donelan <[email protected]>
@Colm-in-Arm
Copy link
Contributor Author

@microsoft-github-policy-service agree [company="Arm"]
@microsoft-github-policy-service agree company="Microsoft"

@Colm-in-Arm
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Arm"

set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES} PARENT_SCOPE)

if(onnxruntime_KLEIDIAI_SME_DISABLED)
target_compile_definitions(onnxruntime_mlas PRIVATE onnxruntime_KLEIDIAI_SME_DISABLED=1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need exposing via build.py as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to avoid putting this in build.py. Users can specify "--cmake_extra_defines onnxruntime_KLEIDIAI_SME_DISABLED=1" instead.

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