Merged
Conversation
guschmue
previously approved these changes
Mar 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes WebGPU DequantizeLinear implementation issues that were causing test failures, and improves related test coverage/readability.
Changes:
- Fix shader codegen for blocked quantization zero-point indexing (use correct linear offset).
- Adjust program output definition to support cases where the last dimension isn’t divisible by
component=4(via output flattening when vectorized). - Rename existing JS test cases and add a new blocked dequantization test case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| onnxruntime/core/providers/webgpu/quantization/quantize_linear.cc | Fixes zero-point indexing for blocked quantization shaders; updates output definition to flatten when using vectorized components. |
| js/web/test/data/ops/dequantizelinear.jsonc | Renames test cases for clarity and adds a new blocked dequantization scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
guschmue
previously approved these changes
Mar 18, 2026
guschmue
approved these changes
Mar 20, 2026
Contributor
|
this fixes some of the webnn DequantizeLinear compliance tests: |
guschmue
added a commit
that referenced
this pull request
Mar 30, 2026
…27778) This PR is on top of a previous PR and fixes the remaining issues. #27706 All tests here should be passing now over webgpu: https://wpt.live/webnn/conformance_tests/dequantizeLinear.https.any.html?gpu --------- Co-authored-by: edgchen1 <18449977+edgchen1@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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
Fix some issues that show up as test failures in
js/web/test/data/ops/dequantizelinear.jsonc.When
component=4, output shapes where the last dimension was not divisible bycomponentwere not handled.onnxruntime/core/providers/webgpu/program.cc:247 TensorShape onnxruntime::webgpu::(anonymous namespace)::GetReducedShape(const TensorShape &, int) shape.NumDimensions() > 0 && shape.GetDims()[shape.NumDimensions() - 1] % component == 0 was false. Cannot reduce shape {2,2} by component=4Added
ProgramOutput::Flattento the output definition to address this.Fix handling of zero point in blocked quantization path.
Also renamed some test cases with more descriptive names.
Motivation and Context
Fix some issues with WebGPU DequantizeLinear op implementation.