WebNN/WebGPU zero-copy device selection
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- machine-learning, web-dev
Research direction
The change belongs in the WebNN specification source, which is written in Bikeshed, and the payload names no specific file or section. Read the existing text on createContext() and exportToGPU() and the MLContextOptions definition, then decide on the proposed interopDevice hint with the maintainers named in the thread. Done means the spec defines how the device choice is made, which needs a spec-level decision rather than a small edit.
Written by the indexing model from the issue text.
Description
WebNN and WebGPU select devices independently, so zero-copy interop is not guaranteed. Web developers need a reliable way to determine whether a WebNN context and GPUDevice are compatible for zero-copy.
The WebNN spec does not define how createContext() and exportToGPU() interact with device selection when both a GPUDevice and MLContextOptions (such as powerPreference) are provided.
For example, if an app passes a WebGPU GPUDevice to createContext(), zero-copy is only possible if WebNN selects that same device or a compatible one (for example, an NPU or integrated GPU sharing the same memory). Otherwise, exportToGPU() may require a copy or fail because the selected devices are incompatible.
One possible solution would be to add an { interopDevice: gpuDevice } option to createContext() as a hint for interop compatibility. If provided, WebNN would preferentially select a compatible device, allowing exportToGPU() to remain zero-copy when possible.
@reillyeon @RafaelCintron @huningxin @anssiko
- Dominant language
- Bikeshed
- Stars
- 566
- Forks
- 72
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from webmachinelearning/webnn
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
webmachinelearning/webnn#967 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
webmachinelearning/webnn#966 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
webmachinelearning/webnn#965 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
webmachinelearning/webnn#964 · 1 comment · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
webmachinelearning/webnn#963 · 2 comments · 1 reaction ·
All issues in webmachinelearning/webnn
Similar issues
-
CUDA OOM in omnivoice-demo voice cloning: create_voice_clone_prompt() runs without inference_modePossibly taken @karthik24iyer claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area-Native untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dotnet/machinelearning#7837 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mindspore-ai/hyper-parallel#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
521xueweihan/HelloGitHub#4062 ·
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
selimfirat/pysad#379 ·
Maintainers usually reply within 1 day