Repository navigation
WebGPU: add physical Dawn adapter index selection - #32319
Conversation
There was a problem hiding this comment.
Pull request overview
Adds physical Dawn adapter selection to the WebGPU EP through adapterIndex.
Changes:
- Parses and validates the new provider option.
- Selects indexed native Dawn adapters and detects context conflicts.
- Adds tests and Python-facing documentation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
plugin-ep-webgpu/README.md |
Documents adapter selection. |
plugin-ep-webgpu/python/onnxruntime_ep_webgpu/README.md |
Adds Python usage guidance. |
onnxruntime/test/providers/webgpu/webgpu_context_test.cc |
Adds option parsing tests. |
onnxruntime/core/providers/webgpu/webgpu_provider_options.h |
Defines the option key. |
onnxruntime/core/providers/webgpu/webgpu_provider_factory.cc |
Parses and logs the index. |
onnxruntime/core/providers/webgpu/webgpu_context.h |
Stores adapter configuration. |
onnxruntime/core/providers/webgpu/webgpu_context.cc |
Implements indexed selection and reuse validation. |
π‘ Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Tianlei Wu (@tianleiwu) Thanks for addressing this! Great fix. We recently ran into a similar multi-GPU challenge with the WebGPU EP as well. While reviewing the design, a couple of related scenarios and use cases came to mind that might be worth considering:
Just wanted to share these observations to see how they align with your current scope and roadmap. Would love to hear your thoughts on this! |
|
Xiaofei Han (@xiaofeihan1) Thanks for raising both cases. They are valid follow-up concerns, but I would keep them separate from this PR because mapping an For multiple sessions, |
|
Thanks Tianlei Wu (@tianleiwu), LGTM! Have you tested different adapters with this PR on setups with 3 or more GPUs? Does it work as expected? My main concern is that our CI/pipeline runners might not have enough GPUs to cover this scenario, potentially leaving edge cases untested |
|
Please resolve the merge conflicts |
bf86e2f to
8d965e3
Compare
Summary
adapterIndexprovider option for selecting a zero-based physical Dawn adapteradapterIndexand ORTdeviceIdTesting
clang-format --dry-run --Werroron all changed C++ fileswebgpu_context.ccandwebgpu_provider_factory.cccompiled successfully against Dawn v20260818.211311-Werror=maybe-uninitializedfailures in WebGPU Gemm/InstanceNorm; PR CI covers the supported build matrix