Skip to content

Update xnnpack.cmake for WASM build - #24860

Merged
fs-eire merged 4 commits into
microsoft:mainfrom
fanchenkong1:fix-xnnpack-wasm-build
Feb 5, 2026
Merged

Update xnnpack.cmake for WASM build#24860
fs-eire merged 4 commits into
microsoft:mainfrom
fanchenkong1:fix-xnnpack-wasm-build

Conversation

@fanchenkong1

Copy link
Copy Markdown
Contributor

Description

This change updates the xnnpack.cmake file to reflect changes in XNNPACK's CMake and Bazel build files.

Motivation and Context

Fixes the WASM build issue with --use_xnnpack (#23460).

@fs-eire

fs-eire commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

could you please merge to latest main branch (which fixes the web CI)

@fanchenkong1
fanchenkong1 force-pushed the fix-xnnpack-wasm-build branch from 15de0e1 to 366e204 Compare June 5, 2025 04:22
@fanchenkong1

Copy link
Copy Markdown
Contributor Author

@fs-eire , Thank you for reminding me! This change is rebased.

After rebasing to the current head, I'm seeing build failure on both x64(linux) and WASM target with --use_xnnpack. This failure comes with a recent commit (e55ce52). Bypass it at https://github.com/microsoft/onnxruntime/blob/main/cmake/CMakeLists.txt#L1930 seems to help keep the main build green.

@fanchenkong1

Copy link
Copy Markdown
Contributor Author

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

@fs-eire

fs-eire commented Jun 7, 2025

Copy link
Copy Markdown
Contributor

@fanchenkong1 what is your full build commandline and platform?

I ran into a problem related to google/XNNPACK#8488 when I try to build with XNNPACK. ONNX Runtime handled this issue https://github.com/microsoft/onnxruntime/blob/main/cmake/external/abseil-cpp.cmake#L13-L21 but this causes other problem:

CMake Error: install(EXPORT "onnxruntimeTargets" ...) includes target "onnxruntime_common" which requires target "absl_absl_log" that is not in any export set.

This error is expected since absl installation is disabled explicitly.

we probably need to patch the XNNPACK CMakeLists.txt and revert the change in cmake/external/abseil-cpp.cmake.

(Seems not happening on Linux/macOS, so maybe this is a Windows only problem?)

@fanchenkong1

Copy link
Copy Markdown
Contributor Author

@fanchenkong1 what is your full build commandline and platform?

I ran into a problem related to google/XNNPACK#8488 when I try to build with XNNPACK. ONNX Runtime handled this issue https://github.com/microsoft/onnxruntime/blob/main/cmake/external/abseil-cpp.cmake#L13-L21 but this causes other problem:

CMake Error: install(EXPORT "onnxruntimeTargets" ...) includes target "onnxruntime_common" which requires target "absl_absl_log" that is not in any export set.

This error is expected since absl installation is disabled explicitly.

we probably need to patch the XNNPACK CMakeLists.txt and revert the change in cmake/external/abseil-cpp.cmake.

(Seems not happening on Linux/macOS, so maybe this is a Windows only problem?)

That's the issue I encountered. I build for x64 native and wasm on ubuntu. The command I use is,

x64: ./build.sh --build_dir=build_native_testing --config RelWithDebInfo --use_xnnpack
wasm: ./build.sh --parallel --build_dir build_wasm_testing --config Release --build_wasm --enable_wasm_simd --enable_wasm_threads --use_xnnpack --disable_rtti --enable_wasm_exception_throwing

@fanchenkong1

Copy link
Copy Markdown
Contributor Author

@fs-eire, I noticed your fix has been merged into XNNPACK (google/XNNPACK#8552). Do you have plans to upgrade the XNNPACK here soon? Once that’s done, I can rebase and verify my changes accordingly.

@fs-eire

fs-eire commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

@fs-eire, I noticed your fix has been merged into XNNPACK (google/XNNPACK#8552). Do you have plans to upgrade the XNNPACK here soon? Once that’s done, I can rebase and verify my changes accordingly.

Sorry for the late reply. I will work on a change to bump the XNNPACK version to include it.

@jchen10

jchen10 commented Jun 21, 2025

Copy link
Copy Markdown
Contributor

@fs-eire, I noticed your fix has been merged into XNNPACK (google/XNNPACK#8552). Do you have plans to upgrade the XNNPACK here soon? Once that’s done, I can rebase and verify my changes accordingly.

Sorry for the late reply. I will work on a change to bump the XNNPACK version to include it.

Thank you for your help despite being so busy. If anything we can do to offload you a little bit, feel free to let us know.

@fanchenkong1
fanchenkong1 force-pushed the fix-xnnpack-wasm-build branch from 366e204 to 3655780 Compare December 17, 2025 02:02
@fanchenkong1

Copy link
Copy Markdown
Contributor Author

Hi @fs-eire, could you help rerun the tests for this PR? This change shouldn’t affect the Windows x86 release.

@fs-eire

fs-eire commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@fs-eire

fs-eire commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@fs-eire
fs-eire merged commit 1bc1475 into microsoft:main Feb 5, 2026
88 checks passed
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