Fix --enable_arm_neon_nchwc being a silent no-op on Windows ARM64 - #32094
Open
Hariharan Seshadri (hariharans29) with Copilot wants to merge 2 commits into
Open
Fix --enable_arm_neon_nchwc being a silent no-op on Windows ARM64#32094Hariharan Seshadri (hariharans29) with Copilot wants to merge 2 commits into
Hariharan Seshadri (hariharans29) with Copilot wants to merge 2 commits into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started work on behalf of
Hariharan Seshadri (hariharans29)
August 14, 2026 19:42
View session
Co-authored-by: hariharans29 <9969784+hariharans29@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix silent no-op for --enable_arm_neon_nchwc on Windows ARM64
Fix --enable_arm_neon_nchwc being a silent no-op on Windows ARM64
Aug 14, 2026
Hariharan Seshadri (hariharans29)
marked this pull request as ready for review
August 14, 2026 23:39
Copilot started reviewing on behalf of
Hariharan Seshadri (hariharans29)
August 14, 2026 23:40
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Windows ARM64 NCHWc builds silently dropping required MLAS compile definitions across nested CMake function scopes.
Changes:
- Adds a directory-property helper for scope-independent compile definitions.
- Migrates ARM NCHWc and Windows SVE definitions to the helper.
- Merges accumulated definitions before applying them to MLAS targets and tests.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot started reviewing on behalf of
Hariharan Seshadri (hariharans29)
August 15, 2026 04:35
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
setup_arm_neon_nchwc()exportedMLAS_USE_ARM_NEON_NCHWCwith a singleset(... PARENT_SCOPE). On Windows ARM64 it is called from insidesetup_mlas_source_for_windows(), so the value landed in that function's local scope and was discarded on return — it never reached the directory-scopetarget_compile_definitions(). Linux/macOS aarch64 call it at directory scope, where one hop is enough.Changes in
cmake/onnxruntime_mlas.cmake:mlas_add_private_compile_definitions()— accumulates definitions in a directory property. Directory properties are unaffected by CMake function scopes, so call depth stops mattering.mlas_private_compile_definitionsjust before theforeach(mlas_target ...)loop, and ahead ofonnxruntime_unittests.cmakebeing included. This is why the fix is not simplytarget_compile_definitions(onnxruntime_mlas ...)inside the function: the mlas test and benchmark targets also consume this list.MLAS_USE_SVEin the Windows branch switched to the same helper. It happens to work today (itsPARENT_SCOPEis one hop from directory scope) but carries the same latent trap.Directory-scope
list(APPEND ...)sites (Linux/macOS aarch64, RVV) are untouched.Motivation and Context
Every
#if defined(MLAS_USE_ARM_NEON_NCHWC)guard evaluated false on Windows ARM64:MlasNchwcGetBlockSize()returned 1,NchwcTransformernever ran, andsconv_nchwc_kernel_neon.cpp/spool_nchwc_kernel_neon.cppcompiled into empty translation units. The flag was accepted and silently dropped, producing a binary identical to one built without it.Because the failure mode is a missing define rather than a build error,
win-qnn-arm64-ci-pipeline.yml— which passes--enable_arm_neon_nchwcexplicitly for NCHWc coverage — has been testing the non-NCHWc path. That pipeline now exercises the code paths it was added to cover.