Restrict padding options to better match backend limits#843
Merged
fdwr merged 3 commits intowebmachinelearning:mainfrom May 9, 2025
inexorabletash:pad-constraints
Merged
Restrict padding options to better match backend limits#843fdwr merged 3 commits intowebmachinelearning:mainfrom inexorabletash:pad-constraints
fdwr merged 3 commits intowebmachinelearning:mainfrom
inexorabletash:pad-constraints
Conversation
Per discussion in the linked issues and working group, drop "symmetric" padding since it is not widely supported by backends, isn't used by notable models, and can be emulated. Also for non-constant padding, backends typically impose restrictions on the amount of padding to reasonable values based on the input size, so incorporate those limits too. Resolves #377. Resolves #739.
Contributor
Author
|
Notes:
|
fdwr
approved these changes
Apr 29, 2025
Collaborator
There was a problem hiding this comment.
Thank you Joshua.
If we need to restore the edge-inclusive reflection¹, then we can easily construct it from two pad calls, just inflating by 1 replicated tensel and then using edge-exclusive reflection: pad(pad(input, [1,1,1,1...], "replicate"), paddingMinusOne, "reflect").
¹ I'm starting to refer to it as this, since "reflection" and "symmetric" alone are less clear, as I always forget which "reflection" is edge-inclusive (standard behavior for textures in graphics API's) vs which reflection is edge-exclusive (the more common one in ML).
Co-authored-by: Dwayne Robinson <[email protected]>
fdwr
approved these changes
Apr 30, 2025
Collaborator
fdwr
left a comment
There was a problem hiding this comment.
Removing edge replication size restriction LGTM.
github-actions bot
added a commit
that referenced
this pull request
May 9, 2025
SHA: 3aa67b3 Reason: push, by fdwr Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
May 19, 2025
This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: ningxin hu <[email protected]> Auto-Submit: Feng Dai <[email protected]> Commit-Queue: Feng Dai <[email protected]> Cr-Commit-Position: refs/heads/main@{#1461938}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 19, 2025
This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: ningxin hu <[email protected]> Auto-Submit: Feng Dai <[email protected]> Commit-Queue: Feng Dai <[email protected]> Cr-Commit-Position: refs/heads/main@{#1461938}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 19, 2025
This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: ningxin hu <[email protected]> Auto-Submit: Feng Dai <[email protected]> Commit-Queue: Feng Dai <[email protected]> Cr-Commit-Position: refs/heads/main@{#1461938}
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
May 20, 2025
Implement the spec change [1] for removing symmetric padding mode. The padding size restriction for reflection padding mode will be fixed in a follow-up CL. [1]:webmachinelearning/webnn#843 Bug: 417227410 Change-Id: If9afb745696b1b6cdae4c2f6583715b526fa4d59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6557483 Reviewed-by: Alex Gough <[email protected]> Commit-Queue: ningxin hu <[email protected]> Reviewed-by: Phillis Tang <[email protected]> Cr-Commit-Position: refs/heads/main@{#1462516}
lando-prod-mozilla bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
May 22, 2025
…bNN API Spec change for pad(), Automatic update from web-platform-tests webnn: update tests align with latest WebNN API Spec change for pad() This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: ningxin hu <[email protected]> Auto-Submit: Feng Dai <[email protected]> Commit-Queue: Feng Dai <[email protected]> Cr-Commit-Position: refs/heads/main@{#1461938} -- wpt-commits: 2a5ceec5c242259bafaab3091625ae2d5af89d9a wpt-pr: 52629 Differential Revision: https://phabricator.services.mozilla.com/D250693
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
May 22, 2025
…bNN API Spec change for pad(), Automatic update from web-platform-tests webnn: update tests align with latest WebNN API Spec change for pad() This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: ningxin hu <[email protected]> Auto-Submit: Feng Dai <[email protected]> Commit-Queue: Feng Dai <[email protected]> Cr-Commit-Position: refs/heads/main@{#1461938} -- wpt-commits: 2a5ceec5c242259bafaab3091625ae2d5af89d9a wpt-pr: 52629 Differential Revision: https://phabricator.services.mozilla.com/D250693
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this pull request
May 28, 2025
…bNN API Spec change for pad(), Automatic update from web-platform-tests webnn: update tests align with latest WebNN API Spec change for pad() This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <reillygchromium.org> Reviewed-by: ningxin hu <ningxin.huintel.com> Auto-Submit: Feng Dai <feng.daiintel.com> Commit-Queue: Feng Dai <feng.daiintel.com> Cr-Commit-Position: refs/heads/main{#1461938} -- wpt-commits: 2a5ceec5c242259bafaab3091625ae2d5af89d9a wpt-pr: 52629 Differential Revision: https://phabricator.services.mozilla.com/D250693 UltraBlame original commit: 1f32789a126993b3a7254926412f6c3e5d15b8a6
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this pull request
May 28, 2025
…bNN API Spec change for pad(), Automatic update from web-platform-tests webnn: update tests align with latest WebNN API Spec change for pad() This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <reillygchromium.org> Reviewed-by: ningxin hu <ningxin.huintel.com> Auto-Submit: Feng Dai <feng.daiintel.com> Commit-Queue: Feng Dai <feng.daiintel.com> Cr-Commit-Position: refs/heads/main{#1461938} -- wpt-commits: 2a5ceec5c242259bafaab3091625ae2d5af89d9a wpt-pr: 52629 Differential Revision: https://phabricator.services.mozilla.com/D250693 UltraBlame original commit: 1f32789a126993b3a7254926412f6c3e5d15b8a6
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this pull request
May 28, 2025
…bNN API Spec change for pad(), Automatic update from web-platform-tests webnn: update tests align with latest WebNN API Spec change for pad() This CL is to update tests align with latest WebNN API Spec change for pad()[1] by removing one conformance test with symmetric padding mode and adding four validation tests of restrict the padding size for reflection model. The failure validation tests are tracked by issue#417227410[2]. [1] webmachinelearning/webnn#843 [2] https://issues.chromium.org/issues/417227410 Bug: 416604162 Change-Id: I7a3ec7539138019c7cab78eb3cd616de3a7d630d 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Reviewed-by: Reilly Grant <reillygchromium.org> Reviewed-by: ningxin hu <ningxin.huintel.com> Auto-Submit: Feng Dai <feng.daiintel.com> Commit-Queue: Feng Dai <feng.daiintel.com> Cr-Commit-Position: refs/heads/main{#1461938} -- wpt-commits: 2a5ceec5c242259bafaab3091625ae2d5af89d9a wpt-pr: 52629 Differential Revision: https://phabricator.services.mozilla.com/D250693 UltraBlame original commit: 1f32789a126993b3a7254926412f6c3e5d15b8a6
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
May 29, 2025
This CL implements the padding size restriction for reflection padding mode that was introduced by WebNN spec change [1]. With this CL, the WPT tests for validating reflection padding size restriction [2] now can pass. This CL also rebaselines the WPT test results. [1]: webmachinelearning/webnn#843 [2]: https://chromium-review.googlesource.com/c/chromium/src/+/6529861 Bug: 417227410 Change-Id: I4600f7624179f6058828f165221c063db112b182 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6586298 Reviewed-by: Phillis Tang <[email protected]> Commit-Queue: ningxin hu <[email protected]> Cr-Commit-Position: refs/heads/main@{#1466903}
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.
Per discussion in the linked issues and working group, drop "symmetric" padding since it is not widely supported by backends, isn't used by notable models, and can be emulated. Also for non-constant padding, backends typically impose restrictions on the amount of padding to reasonable values based on the input size, so incorporate those limits too.
Resolves #377. Resolves #739.
Preview | Diff