Skip to content

Comments

WebNN: Add some 1D tests for reduce op with empty axes#51493

Merged
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-6359997
Mar 24, 2025
Merged

WebNN: Add some 1D tests for reduce op with empty axes#51493
chromium-wpt-export-bot merged 1 commit intomasterfrom
chromium-export-cl-6359997

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 20, 2025

According to the WebNN specification[1], if the axes parameter is
empty, the reduction function is applied to each value in the tensor
individually, with no dimensions being reduced. Currently, most of
the reduce tests focus only on this case for 0D inputs, which is
insufficient for thorough verification. For example, with a 0D input,
operations like reduceMin and reduceMean that reduce each value
individually are effectively no-ops. However, for 1D inputs, we can
better verify the behavior of reducing each value individually.

[1] https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-reduce

Bug: 404004620
Change-Id: I61a358c9a3e393adf8b69b87310c426976581c70
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/+/6359997
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Commit-Queue: Mingming1 Xu <mingming1.xu@intel.com>
Cr-Commit-Position: refs/heads/main@{#1436675}

According to the WebNN specification[1], if the `axes` parameter is
empty, the reduction function is applied to each value in the tensor
individually, with no dimensions being reduced. Currently, most of
the reduce tests focus only on this case for 0D inputs, which is
insufficient for thorough verification. For example, with a 0D input,
operations like `reduceMin` and `reduceMean` that reduce each value
individually are effectively no-ops. However, for 1D inputs, we can
better verify the behavior of reducing each value individually.

[1] https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-reduce

Bug: 404004620
Change-Id: I61a358c9a3e393adf8b69b87310c426976581c70
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/+/6359997
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Commit-Queue: Mingming1 Xu <mingming1.xu@intel.com>
Cr-Commit-Position: refs/heads/main@{#1436675}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 18f7b0c into master Mar 24, 2025
21 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-6359997 branch March 24, 2025 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants