From 0daed2af6ec3f989228985ed47d1a073af77ef23 Mon Sep 17 00:00:00 2001 From: lisa0314 Date: Mon, 3 Jun 2024 16:42:28 +0000 Subject: [PATCH] Bug 1900081 [wpt PR 46568] - WebNN: Add missing 64-bit integers support for some reduce operators, a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests WebNN: Add missing 64-bit integers support for some reduce operators This CL adds 64-bit integer support for reduceL1, reduceProduct, reduceSum and reduceSumSquare. It's based on the spec change being proposed by https://github.com/webmachinelearning/webnn/pull/695. Bug: 328567884 Change-Id: Ia858b47082f81a9eb6ab3b9403e3773a752eb608 Cq-Include-Trybots: luci.chromium.try​:win11-blink-rel,mac14-blink-rel,mac14.arm64-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5569544 Reviewed-by: ningxin hu Reviewed-by: Austin Sullivan Commit-Queue: Lisha Guo Cr-Commit-Position: refs/heads/main@{#1309157} -- wpt-commits: 50c7448895efb9f6cfe0b37d77d018ea549d4b99 wpt-pr: 46568 --- .../validation_tests/reduction.https.any.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js b/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js index e9643c0f8a591..219a60076af4d 100644 --- a/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js @@ -24,7 +24,7 @@ const kFloatRestrictReductionOperators = [ 'reduceMean', ]; -const kFloatInt32Uint32RestrictReductionOperators = [ +const kFloatInt32Uint32Int64Uint64RestrictReductionOperators = [ 'reduceL1', 'reduceProduct', 'reduceSum', @@ -87,7 +87,7 @@ const kFloatRestrictOperatorsTests = [ }, ]; -const kFloatInt32Uint32RestrictOperatorsTests = [ +const kFloatInt32Uint32Int64Uint64RestrictOperatorsTests = [ { name: '[reduce] Test reduce when input\'s datatype is int32.', input: {dataType: 'int32', dimensions: [1, 2, 5, 5]}, @@ -99,9 +99,19 @@ const kFloatInt32Uint32RestrictOperatorsTests = [ output: {dataType: 'uint32', dimensions: []} }, { - name: - '[reduce] Throw if the input data type is not one of the {float32, float16, int32, uint32}.', + name: '[reduce] Test reduce when input\'s datatype is int64.', input: {dataType: 'int64', dimensions: [1, 2, 5, 5]}, + output: {dataType: 'int64', dimensions: []} + }, + { + name: '[reduce] Test reduce when input\'s datatype is uint64.', + input: {dataType: 'uint64', dimensions: [1, 2, 5, 5]}, + output: {dataType: 'uint64', dimensions: []} + }, + { + name: + '[reduce] Throw if the input data type is not one of the {float32, float16, int32, uint32, int64, uint64}.', + input: {dataType: 'int8', dimensions: [1, 2, 5, 5]}, options: { axes: [0, 1], }, @@ -159,9 +169,11 @@ kFloatRestrictReductionOperators.forEach((operatorName) => { runReductionTests(operatorName, kFloatRestrictOperatorsTests); }); -kFloatInt32Uint32RestrictReductionOperators.forEach((operatorName) => { - runReductionTests(operatorName, kFloatInt32Uint32RestrictOperatorsTests); -}); +kFloatInt32Uint32Int64Uint64RestrictReductionOperators.forEach( + (operatorName) => { + runReductionTests( + operatorName, kFloatInt32Uint32Int64Uint64RestrictOperatorsTests); + }); kNoTypeRestrictReductionOperators.forEach((operatorName) => { runReductionTests(operatorName, kNoTypeRestrictOperatorsTests);