Repository navigation
[WebNN EP] Add output rank validation - #31708
Merged
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Wanming Lin (Honry)
force-pushed
the
limit-output-rank
branch
2 times, most recently
from
August 10, 2026 01:30
e2838e2 to
ae08201
Compare
Mirror the existing input rank check by validating each node's output rank against the WebNN opSupportLimits rankRange. - Rename IsInputRankSupported -> IsRankSupportedByWebNNOp. - Add IsOutputRankSupportedByOp for the common single-"output" case. - Add output rank checks to multi-output ops (gru, lstm, split) using their specific output parameter names. - Skip decomposed ops (their type checks loop over sub-ops whose ranks differ from the final output).
Contributor
Author
|
Dwayne Robinson (@fdwr), PTAL, thanks! |
Dwayne Robinson (fdwr)
merged commit Aug 12, 2026
8bbb81e
into
microsoft:main
96 of 99 checks passed
Wanming Lin (Honry)
added a commit
to Honry/onnxruntime
that referenced
this pull request
Aug 13, 2026
The output rank validation added in microsoft#31708 wrongly falls back ops whose ONNX output rank differs from the WebNN operand rank: - InstanceNormalization, Conv (conv1d) and MatMul (1-D input) reshape the input to a WebNN-valid rank and reshape the output back. Skip the output rank check exactly when that workaround fires, mirroring the existing input-side skips. Also make the InstanceNormalization input-side check symmetric (only validate the 4D direct path). - Gather with 0-D indices yields a valid 0-D output, but the WebNN gather output rankRange is reported with min=1; permit 0-D output.
Dwayne Robinson (fdwr)
pushed a commit
that referenced
this pull request
Aug 14, 2026
The output rank validation added in #31708 wrongly falls back ops whose ONNX output rank differs from the WebNN operand rank: - InstanceNormalization, Conv (conv1d) and MatMul (1-D input) reshape the input to a WebNN-valid rank and reshape the output back. Skip the output rank check exactly when that workaround fires, mirroring the existing input-side skips. Also make the InstanceNormalization input-side check symmetric (only validate the 4D direct path). - Gather with 0-D indices yields a valid 0-D output, but the WebNN gather output rankRange is reported with min=1; permit 0-D output.
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.
Mirror the existing input rank check by validating each node's output rank against the WebNN
opSupportLimits'srankRange.IsInputRankSupported->IsRankSupportedByWebNNOp.IsOutputRankSupportedByOpfor the common single-"output" case.