microsoft / microsoft/onnxruntime

Can I use Microsoft.AI.MachineLearning(WinML) interfaces to enable OnnxRuntime-QNN-EP(Qualcomm NPU) or other no-DirectX EP ?

Open
#19,361 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request platform:windows
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the feature request

Can I use Microsoft.AI.MachineLearning(WinML) interfaces to enable OnnxRuntime-QNN-EP(Qualcomm NPU) or other no-DirectX EP ?

1. From "windows-ml/get-started", we can see 2 solutions: In-box vs NuGet
https://learn.microsoft.com/en-us/windows/ai/windows-ml/get-started

2. In-box: OnnxRuntime as a part of Windows, we can't change. so it's no chance to use myself built OnnxRuntime with QNN-EP.
![image](https://github.com/microsoft/onnxruntime/assets/32449616/2dbfa51a-6894-4c7a-97d1-5cbee1cede75)

3. NuGet: Microsoft.ai.machinelearning.dll does not contain an embedded ONNX runtime, instead the ONNX runtime is built into a file: onnxruntime.dll.
![image](https://github.com/microsoft/onnxruntime/assets/32449616/b45c50e9-f60c-433d-8157-273554e18a85)

and maybe we can replace the onnxruntime.dll to myself built OnnxRuntime with QNN-EP.
but the WinML interface: public enum LearningModelDeviceKind, only support 4 kinds: 0 Default, 1 Cpu, 2 DirectX, 3 DirectXHighPerformance, 4 DirectXMinPower.
But there is no option for QNN-EP or other EP in the LearningModelDeviceKind enumeration.

So can I use Microsoft.AI.MachineLearning(WinML) interfaces to enable OnnxRuntime-QNN-EP(Qualcomm NPU) or other no-DirectX EP?

### Describe scenario use case

Windows: Microsoft.AI.MachineLearning(WinML) interfaces to enable OnnxRuntime-QNN-EP(Qualcomm NPU) or other no-DirectX EP

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Windows ML get-started documentation and the Microsoft.AI.MachineLearning LearningModelDeviceKind interface described in the issue. Check whether replacing onnxruntime.dll with a QNN-EP build is supported for NuGet-based WinML, and document a supported integration path or the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, machine-learning
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.