From 8eb5698c6c9785c34e6eff67eff18bfdca2cde8b Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 22 Oct 2024 22:05:14 +0000 Subject: [PATCH] Bug 1925437 [wpt PR 48690] - webnn: Deprecate MLTensorUsage in favor of boolean flags, a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests webnn: Deprecate MLTensorUsage in favor of boolean flags As per the feedback on this thread on the MLTensor explainer PR: https://github.com/webmachinelearning/webnn/pull/754#discussion_r1772300523 This CL includes logic to still support specifying the deprecated MLTensorUsage flags for now, though this logic will only exist for about a milestone to give callers the opportunity to migrate their existing code Bug: 343638938 Change-Id: I56209e68fde3920b8d6c781c8f804ac6fcd35c9a Cq-Include-Trybots: luci.chromium.try​:mac14.arm64-blink-rel,win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5933323 Reviewed-by: ningxin hu Auto-Submit: Austin Sullivan Commit-Queue: ningxin hu Cr-Commit-Position: refs/heads/main{#1370419} -- wpt-commits: ab3cd3a3748943c7ec96b7fdcc7b8e3acebe1396 wpt-pr: 48690 UltraBlame original commit: 6f4fb11a34977957f99608befb8bd2ecaaec0153 --- .../byob_readtensor.https.any.js | 25 +-- .../inputs-are-not-modified.https.any.js | 38 ++--- .../parallel-dispatch.https.any.js | 117 +++++-------- .../conformance_tests/tensor.https.any.js | 160 ++++++++---------- .../destroyContext.https.any.js | 18 +- .../destroyGraph.https.any.js | 18 +- 6 files changed, 146 insertions(+), 230 deletions(-) diff --git a/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js index 39aeeafe7093..3bd3046333db 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js @@ -121,15 +121,12 @@ shape 2 4 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) ; @@ -742,11 +739,9 @@ shape 2 2 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ; @@ -846,11 +841,9 @@ shape 2 2 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ; diff --git a/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js index c2c3ae67ded2..7b3dcf719d0b 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js @@ -131,15 +131,12 @@ shape [ 4 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) mlContext @@ -157,11 +154,9 @@ shape [ 4 ] -usage +readable : -MLTensorUsage -. -READ +true } ) builder @@ -385,15 +380,12 @@ shape [ 4 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) mlContext @@ -411,11 +403,9 @@ shape [ 4 ] -usage +readable : -MLTensorUsage -. -READ +true } ) builder diff --git a/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js index 197e4b6548cc..055072d38d64 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js @@ -138,15 +138,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -371,15 +368,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -564,15 +558,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -839,15 +830,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -1100,15 +1088,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -1332,15 +1317,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -1610,15 +1592,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -1877,15 +1856,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const @@ -2137,15 +2113,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const diff --git a/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js index 199f69bb6894..39d532f0f89a 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js @@ -188,11 +188,21 @@ shape tensor . shape -usage +readable : tensor . -usage +readable +writable +: +tensor +. +writable +importableToWebGPU +: +tensor +. +importableToWebGPU } ; } @@ -810,11 +820,9 @@ shape [ 1 ] -usage +writable : -MLTensorUsage -. -WRITE +true } ; let @@ -1020,11 +1028,9 @@ shape 2 2 ] -usage +writable : -MLTensorUsage -. -WRITE +true } ; let @@ -1100,11 +1106,9 @@ shape 2 3 ] -usage +writable : -MLTensorUsage -. -WRITE +true } ; let @@ -1226,15 +1230,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) ; @@ -1341,15 +1342,12 @@ shape 2 2 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; let @@ -1599,11 +1597,9 @@ shape 2 2 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ; @@ -1663,11 +1659,9 @@ shape 2 3 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ; @@ -1752,11 +1746,9 @@ shape [ 1024 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ; @@ -1807,15 +1799,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -READ -| -MLTensorUsage -. -WRITE +true +writable +: +true } ) ; @@ -1903,15 +1892,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) ; @@ -2005,15 +1991,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) ; @@ -2108,15 +2091,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) ; @@ -2211,15 +2191,12 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ) ; @@ -2293,11 +2270,9 @@ shape 2 3 ] -usage +readable : -MLTensorUsage -. -READ +true } ; let @@ -2475,15 +2450,12 @@ float32 shape : shape -usage +readable : -MLTensorUsage -. -WRITE -| -MLTensorUsage -. -READ +true +writable +: +true } ; const diff --git a/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js b/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js index d01718f6656a..a0d37f9ed531 100644 --- a/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js @@ -1040,11 +1040,9 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ; @@ -1119,11 +1117,9 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ; @@ -1230,11 +1226,9 @@ shape [ 1 ] -usage +writable : -MLTensorUsage -. -WRITE +true } ) ; diff --git a/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js b/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js index 2c8d93b05813..e12df9554fb2 100644 --- a/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js @@ -953,11 +953,9 @@ shape [ 1 ] -usage +writable : -MLTensorUsage -. -WRITE +true } ) ; @@ -980,11 +978,9 @@ shape [ 1 ] -usage +writable : -MLTensorUsage -. -WRITE +true } ) ; @@ -1007,11 +1003,9 @@ shape [ 1 ] -usage +readable : -MLTensorUsage -. -READ +true } ) ;