-
Notifications
You must be signed in to change notification settings - Fork 52
Bugfix: Only allow 1 to N rank input for operators that take 1 axis #882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
huningxin
merged 1 commit into
webmachinelearning:main
from
huningxin:fix_allowed_ranks
Aug 29, 2025
Merged
Bugfix: Only allow 1 to N rank input for operators that take 1 axis #882
huningxin
merged 1 commit into
webmachinelearning:main
from
huningxin:fix_allowed_ranks
Aug 29, 2025
Conversation
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
fdwr
approved these changes
Aug 26, 2025
Collaborator
fdwr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 TY NH.
I see gatherElements and scatterElements are already good.
reillyeon
approved these changes
Aug 28, 2025
github-actions bot
added a commit
that referenced
this pull request
Aug 29, 2025
SHA: 5aec997 Reason: push, by huningxin Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Sep 30, 2025
This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Sep 30, 2025
This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Cq-Include-Trybots: luci.chromium.try:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
Oct 9, 2025
This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6972256 Commit-Queue: ningxin hu <ningxin.hu@intel.com> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1527306}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 9, 2025
This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6972256 Commit-Queue: ningxin hu <ningxin.hu@intel.com> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1527306}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
Oct 9, 2025
This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6972256 Commit-Queue: ningxin hu <ningxin.hu@intel.com> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1527306}
lando-prod-mozilla bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Oct 20, 2025
…n with spec, a=testonly Automatic update from web-platform-tests WebNN: Align tensor limits implementation with spec This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6972256 Commit-Queue: ningxin hu <ningxin.hu@intel.com> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1527306} -- wpt-commits: a460ea73b9d67a705401622c6a7f8c0088b6a036 wpt-pr: 55147
i3roly
pushed a commit
to i3roly/firefox-dynasty
that referenced
this pull request
Oct 25, 2025
…n with spec, a=testonly Automatic update from web-platform-tests WebNN: Align tensor limits implementation with spec This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6972256 Commit-Queue: ningxin hu <ningxin.hu@intel.com> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1527306} -- wpt-commits: a460ea73b9d67a705401622c6a7f8c0088b6a036 wpt-pr: 55147
mertcanaltin
pushed a commit
to mertcanaltin/wpt
that referenced
this pull request
Oct 26, 2025
This CL aligns the tensor limits setting in `WebNNContextImpl::IntersectWithBaseProperties` with spec, especially for scalar operand limits that was fixed by spec PR [1]. The change includes: 1. argMin/Max doesn't accept scalar input and output data types except int32 and int64 [2] 2. batchNormalization doesn't accept scalar input [3] 3. concat doesn't accept scalar input [4] 4. conv2d/convTranspose2d only accept floating-point input data types [5] 5. softmax doesn't accept scalar input [6] 6. split doesn't accept scalar input [7] Pad [8] and slice [9] support scalar input as a no-op. This CL replaces pad or slice having scalar input with an identity operator at MLGraphBuilder to unify the behaviors across backends. [1]: webmachinelearning/webnn#882 [2]: https://www.w3.org/TR/webnn/#tensor-limits-argMin-argMax [3]: https://www.w3.org/TR/webnn/#tensor-limits-batchNormalization [4]: https://www.w3.org/TR/webnn/#tensor-limits-concat [5]: https://www.w3.org/TR/webnn/#tensor-limits-conv2d [6]: https://www.w3.org/TR/webnn/#tensor-limits-softmax [7]: https://www.w3.org/TR/webnn/#tensor-limits-split [8]: https://www.w3.org/TR/webnn/#tensor-limits-pad [9]: https://www.w3.org/TR/webnn/#tensor-limits-slice Change-Id: I8480cf9ef1e9e18a175677a16a553c1562a747c5 Bug: 446481989 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6972256 Commit-Queue: ningxin hu <ningxin.hu@intel.com> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1527306}
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.
Only allow 1 to N rank input operand for
argMin,argMax,batchNormalization,concat,cumulativeSum,gather,softmaxandsplitoperators that take 1 axis.@fdwr and @reillyeon , PTAL.
/cc @miaobin
Fix #873
Preview | Diff