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

[Mobile] need vulkan ep support #22973

Open
WangHHY19931001 opened this issue Nov 29, 2024 · 9 comments
Open

[Mobile] need vulkan ep support #22973

WangHHY19931001 opened this issue Nov 29, 2024 · 9 comments
Labels
ep:QNN issues related to QNN exeution provider platform:mobile issues related to ONNX Runtime mobile; typically submitted using template stale issues that have not been addressed in a while; categorized by a bot

Comments

@WangHHY19931001
Copy link

Describe the issue

in qualcomm device select app ndk abiFilters armeabi-v7a, nnapi just only use cpu.

after google some, i fund qnn sdk not support armeabi-v7a, just only support arm64-v8a, maybe qualcomm nnapi not support npu for armeabi-v7a, so need vulkan ep to use gpu

To reproduce

build onnxruntime android with nnapi, create app, set ndk abiFilters armeabi-v7a, and use c++ call onnxruntime to run onnx

Urgency

No response

Platform

Android

OS Version

14

ONNX Runtime Installation

Built from Source

Compiler Version (if 'Built from Source')

26.3.11579264

Package Name (if 'Released Package')

None

ONNX Runtime Version or Commit ID

c4fb724

ONNX Runtime API

C++/C

Architecture

ARM32

Execution Provider

NNAPI

Execution Provider Library Version

No response

@WangHHY19931001 WangHHY19931001 added the platform:mobile issues related to ONNX Runtime mobile; typically submitted using template label Nov 29, 2024
@github-actions github-actions bot added the ep:QNN issues related to QNN exeution provider label Nov 29, 2024
@wejoncy
Copy link
Contributor

wejoncy commented Nov 29, 2024

There is a webgpu EP you might be insterested in

@Red-Eyed
Copy link
Contributor

Red-Eyed commented Dec 1, 2024

There is a webgpu EP you might be insterested in

Is there a way to use webgpu in Android native (C++) library?

@skottmckay
Copy link
Contributor

WebGPU EP uses the Dawn native library, which converts WGSL to Vulkan on Android. https://github.com/google/dawn/

The EP is new and only supports a limited number of operators currently, but those will be increased.

Not sure how well it supports 32-bit ARM though as most mobile phones are 64-bit ARM.

FWIW NNAPI is deprecated, and always had unpredictable performance.

@ashumish-QCOM
Copy link

Hi @WangHHY19931001,

I checked on this issue regarding the need for Vulkan EP support on Qualcomm devices. It appears that the QNN SDK does not support armeabi-v7a, only arm64-v8a. This might be why NNAPI is only using the CPU for armeabi-v7a.

For using the GPU, you might want to explore the WebGPU Execution Provider (EP), which uses the Dawn native library to convert WGSL to Vulkan on Android. However, please note that the WebGPU EP is relatively new and currently supports a limited number of operators, though this is expected to increase over time. Additionally, most mobile phones are 64-bit ARM, so support for 32-bit ARM might be limited.

FWIW, NNAPI is deprecated and has always had unpredictable performance.

Hope this helps!

@WangHHY19931001
Copy link
Author

Hi @WangHHY19931001,

I checked on this issue regarding the need for Vulkan EP support on Qualcomm devices. It appears that the QNN SDK does not support armeabi-v7a, only arm64-v8a. This might be why NNAPI is only using the CPU for armeabi-v7a.

For using the GPU, you might want to explore the WebGPU Execution Provider (EP), which uses the Dawn native library to convert WGSL to Vulkan on Android. However, please note that the WebGPU EP is relatively new and currently supports a limited number of operators, though this is expected to increase over time. Additionally, most mobile phones are 64-bit ARM, so support for 32-bit ARM might be limited.

FWIW, NNAPI is deprecated and has always had unpredictable performance.

Hope this helps!

need way to build android c++ version

@Red-Eyed
Copy link
Contributor

Red-Eyed commented Dec 4, 2024

Hi @WangHHY19931001,
I checked on this issue regarding the need for Vulkan EP support on Qualcomm devices. It appears that the QNN SDK does not support armeabi-v7a, only arm64-v8a. This might be why NNAPI is only using the CPU for armeabi-v7a.
For using the GPU, you might want to explore the WebGPU Execution Provider (EP), which uses the Dawn native library to convert WGSL to Vulkan on Android. However, please note that the WebGPU EP is relatively new and currently supports a limited number of operators, though this is expected to increase over time. Additionally, most mobile phones are 64-bit ARM, so support for 32-bit ARM might be limited.
FWIW, NNAPI is deprecated and has always had unpredictable performance.
Hope this helps!

need way to build android c++ version

I haven't tried it yet, but there is option --use_webgpu in the build script.
I hope it will work with Android
https://github.com/microsoft/onnxruntime/blob/main/tools/ci_build/build.py#L579

@WangHHY19931001
Copy link
Author

Hi @WangHHY19931001,
I checked on this issue regarding the need for Vulkan EP support on Qualcomm devices. It appears that the QNN SDK does not support armeabi-v7a, only arm64-v8a. This might be why NNAPI is only using the CPU for armeabi-v7a.
For using the GPU, you might want to explore the WebGPU Execution Provider (EP), which uses the Dawn native library to convert WGSL to Vulkan on Android. However, please note that the WebGPU EP is relatively new and currently supports a limited number of operators, though this is expected to increase over time. Additionally, most mobile phones are 64-bit ARM, so support for 32-bit ARM might be limited.
FWIW, NNAPI is deprecated and has always had unpredictable performance.
Hope this helps!

need way to build android c++ version

I haven't tried it yet, but there is option --use_webgpu in the build script. I hope it will work with Android https://github.com/microsoft/onnxruntime/blob/main/tools/ci_build/build.py#L579

onnxruntime\include\onnxruntime\core\providers\webgpu\webgpu_provider_factory.h is empty header

@Red-Eyed
Copy link
Contributor

Red-Eyed commented Dec 5, 2024

Copy link
Contributor

github-actions bot commented Jan 7, 2025

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:QNN issues related to QNN exeution provider platform:mobile issues related to ONNX Runtime mobile; typically submitted using template stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

5 participants