[WebGPU] Add GridSample operator#28264
Merged
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds initial support for the ONNX GridSample operator (opset 16–19) to the WebGPU Execution Provider, and expands existing GridSample operator tests to exercise the WebGPU EP.
Changes:
- Register
GridSample(16–19) kernel for the WebGPU EP and add shader/program implementation. - Add WebGPU EP to the GridSample provider test matrix (when
USE_WEBGPUis enabled). - Add a layout-conversion override so WebGPU doesn’t try to transform
GridSampleinto NHWC.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| onnxruntime/test/providers/cpu/tensor/grid_sample_test.cc | Adds WebGPU EP to the set of execution providers used by GridSample tests. |
| onnxruntime/core/providers/webgpu/webgpu_execution_provider.cc | Registers the WebGPU GridSample kernel and disables NHWC layout conversion for this op. |
| onnxruntime/core/providers/webgpu/tensor/grid_sample.h | Declares the WebGPU GridSample kernel and its shader program. |
| onnxruntime/core/providers/webgpu/tensor/grid_sample.cc | Implements GridSample shader generation and kernel execution for WebGPU. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
guschmue
approved these changes
Apr 29, 2026
Contributor
|
thanks for the op !!! |
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the GridSample operator (opset 16–19) for the WebGPU EP.
Motivation and Context
GridSample was missing from the WebGPU EP and all other major execution providers already support it. The GridSample tests were extended to cover the WebGPU EP and seem to pass successfully.
I haven't tested that the
onnxruntime-webbuild would pick up this new operator implementation because it's really hard to build this locally, but it seems like it should just work.Closes #27085