[WebGPU EP] grouped conv audio underflow fix - #32478
Open
Prathik Rao (prathikr) wants to merge 2 commits into
Open
[WebGPU EP] grouped conv audio underflow fix#32478Prathik Rao (prathikr) wants to merge 2 commits into
Prathik Rao (prathikr) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The signed-coordinate fix is correctly bounded and covered by a focused regression test.
Pull request overview
Fixes WebGPU grouped convolution padding underflow during shader generation.
Changes:
- Uses signed WGSL coordinates for padded convolution bounds checks.
- Converts validated coordinates to unsigned indices.
- Adds a grouped-convolution padding regression test.
No actionable findings identified.
File summaries
| File | Description |
|---|---|
onnxruntime/core/providers/webgpu/nn/grouped_conv.cc |
Corrects padded coordinate arithmetic and indexing. |
onnxruntime/test/providers/webgpu/grouped_conv_padding_test.cc |
Verifies grouped convolution zero-padding behavior. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fix padded WebGPU grouped convolution coordinates
Issue
Gemma 4 audio processing could abort on macOS while Dawn compiled the WebGPU
GroupedConvshader:The generated shader computed padded convolution coordinates as
u32. When an output position required a negative input coordinate, subtracting the padding underflowed to a large unsigned value. The subsequentx < 0ucheck could never succeed. This affected the padded grouped-convolution path used by the audio frontend and could trigger a Metal/Dawn shader-compilation failure.Fix
GroupedConv now:
i32values.u32only after they are known to be in range.Regression test
Added a WebGPU test using a two-group, 1D-style convolution represented as a padded 2D convolution. The test exercises negative left-border coordinates and verifies the expected zero-padding behavior.
Validation: