Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] WASM build of v1.20.1 with --use_xnnpack fails #23460

Open
raphaelmenges opened this issue Jan 22, 2025 · 1 comment
Open

[Build] WASM build of v1.20.1 with --use_xnnpack fails #23460

raphaelmenges opened this issue Jan 22, 2025 · 1 comment
Labels
build build issues; typically submitted using template ep:Xnnpack issues related to XNNPACK EP platform:web issues related to ONNX Runtime web; typically submitted using template

Comments

@raphaelmenges
Copy link

Describe the issue

Hello 👋

I want to utilize the ONNX runtime in a Web application. I successfully built the static library of ONNX runtime with SIMD and threading and linked it within my Emscripten project. The CPU execution providers works great. Now I tried to also include the XNNPACK execution provider with the --use_xnnpack flag to improve the performance of the inferencing.

However, the src/amalgam directory is missing from the XNNPACK distribution. xnnpack.cmake says:

# See source lists in _deps/googlexnnpack-src/BUILD.bazel for wasm_prod_microkernels

I cannot find any documentation at the XNNPACK how to manually generate these amalgam (?) microkernels. I also cannot find an example in this repository. How to build the XNNPACK execution provider for the Web?

Urgency

No response

Target platform

WASM

Build script

onnxruntime/build.sh \
    --build_dir ./onnxruntime-build \
    --config Release \
    --build_wasm_static_lib \
    --enable_wasm_simd \
    --enable_wasm_threads \
    --skip_tests \
    --disable_wasm_exception_catching \
    --disable_rtti \
    --use_xnnpack \
    --parallel

Error / output

CMake Error at external/xnnpack.cmake:189 (target_sources):
  Cannot find source file:

    ./onnxruntime-build/Release/_deps/googlexnnpack-src/src/amalgam/gen/scalar.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  external/onnxruntime_external_deps.cmake:566 (include)
  CMakeLists.txt:614 (include)

Visual Studio Version

No response

GCC / Compiler Version

No response

@raphaelmenges raphaelmenges added the build build issues; typically submitted using template label Jan 22, 2025
@github-actions github-actions bot added ep:Xnnpack issues related to XNNPACK EP platform:web issues related to ONNX Runtime web; typically submitted using template labels Jan 22, 2025
@raphaelmenges
Copy link
Author

Apparently there was an update of the XNNPACK dependency in b94ba09 from google/XNNPACK@0da379f to google/XNNPACK@309b75c. The old version of the XNNPACK dependency still contained the src/amalgam directory. As I understand it, this directory could be created once but there is no more such a script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template ep:Xnnpack issues related to XNNPACK EP platform:web issues related to ONNX Runtime web; typically submitted using template
Projects
None yet
Development

No branches or pull requests

1 participant