webnn: add webgpu interop float16 test [chromium/src : main]

0 views
Skip to first unread message

Reilly Grant (Gerrit)

unread,
12:44 AM (22 hours ago) 12:44 AM
to Phillis Tang, Reilly Grant, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Phillis Tang

Reilly Grant voted and added 5 comments

Votes added by Reilly Grant

Code-Review+1

5 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Reilly Grant . resolved

LGTM with a style nit

File third_party/blink/web_tests/external/wpt/webnn/conformance_tests/tensor.https.any.js
Line 1424, Patchset 4 (Latest): let mlTensor = await mlContext.createExportableTensor(
{
dataType: dataType,
shape: shape,
},
gpuDevice);
Reilly Grant . unresolved
```suggestion
let mlTensor = await mlContext.createExportableTensor(
{dataType, shape}, gpuDevice);
```
Line 1496, Patchset 4 (Latest): const mlTensor = await mlContext.createTensor({
dataType: dataType,
shape: shape,
});
Reilly Grant . unresolved
```suggestion
const mlTensor = await mlContext.createTensor({dataType, shape});
```
Line 1514, Patchset 4 (Latest): {dataType: dataType, shape: shape}, gpuDevice);
Reilly Grant . unresolved
```suggestion
{dataType, shape}, gpuDevice);
```
Line 1525, Patchset 4 (Latest): {dataType: dataType, shape: shape, readable: true, writable: true};
Reilly Grant . unresolved
```suggestion
{dataType, shape, readable: true, writable: true};
```

Same comment below.

Open in Gerrit

Related details

Attention is currently required from:
  • Phillis Tang
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iec6eb063b03c71747eae56229984247d0c282616
Gerrit-Change-Number: 7129702
Gerrit-PatchSet: 4
Gerrit-Owner: Phillis Tang <phi...@chromium.org>
Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-Attention: Phillis Tang <phi...@chromium.org>
Gerrit-Comment-Date: Fri, 14 Nov 2025 05:43:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Phillis Tang (Gerrit)

unread,
6:46 PM (4 hours ago) 6:46 PM
to Reilly Grant, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

Phillis Tang voted and added 4 comments

Votes added by Phillis Tang

Commit-Queue+2

4 comments

File third_party/blink/web_tests/external/wpt/webnn/conformance_tests/tensor.https.any.js
Line 1424, Patchset 4: let mlTensor = await mlContext.createExportableTensor(

{
dataType: dataType,
shape: shape,
},
gpuDevice);
Reilly Grant . resolved
```suggestion
let mlTensor = await mlContext.createExportableTensor(
{dataType, shape}, gpuDevice);
```
Phillis Tang

Done

Line 1496, Patchset 4: const mlTensor = await mlContext.createTensor({

dataType: dataType,
shape: shape,
});
Reilly Grant . resolved
```suggestion
const mlTensor = await mlContext.createTensor({dataType, shape});
```
Phillis Tang

Done

Line 1514, Patchset 4: {dataType: dataType, shape: shape}, gpuDevice);
Reilly Grant . resolved
```suggestion
{dataType, shape}, gpuDevice);
```
Phillis Tang

Done

Line 1525, Patchset 4: {dataType: dataType, shape: shape, readable: true, writable: true};
Reilly Grant . resolved
```suggestion
{dataType, shape, readable: true, writable: true};
```

Same comment below.

Phillis Tang

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iec6eb063b03c71747eae56229984247d0c282616
    Gerrit-Change-Number: 7129702
    Gerrit-PatchSet: 4
    Gerrit-Owner: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
    Gerrit-Comment-Date: Fri, 14 Nov 2025 23:46:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Reilly Grant <rei...@chromium.org>
    satisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    6:48 PM (4 hours ago) 6:48 PM
    to Reilly Grant, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, mac-r...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

    Phillis Tang voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iec6eb063b03c71747eae56229984247d0c282616
    Gerrit-Change-Number: 7129702
    Gerrit-PatchSet: 5
    Gerrit-Owner: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
    Gerrit-Comment-Date: Fri, 14 Nov 2025 23:47:47 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    7:31 PM (4 hours ago) 7:31 PM
    to Phillis Tang, Reilly Grant, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    4 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: third_party/blink/web_tests/external/wpt/webnn/conformance_tests/tensor.https.any.js
    Insertions: 24, Deletions: 63.

    @@ -1421,12 +1421,8 @@

    // Check if WebNN interop is supported.
    try {
    - let mlTensor = await mlContext.createExportableTensor(
    - {
    - dataType: dataType,
    - shape: shape,
    - },
    - gpuDevice);
    + let mlTensor =
    + await mlContext.createExportableTensor({dataType, shape}, gpuDevice);
    await mlContext.exportToGPU(mlTensor);
    } catch (e) {
    if (e.name === 'NotSupportedError') {
    @@ -1438,7 +1434,7 @@

    // Construct a simple graph: OUTPUT = LHS + RHS.
    const mlBuilder = new MLGraphBuilder(mlContext);
    - const mlOperandDescriptor = {dataType: dataType, shape};
    + const mlOperandDescriptor = {dataType, shape};
    const lhsOperand = mlBuilder.input('lhs', mlOperandDescriptor);
    const rhsOperand = mlBuilder.input('rhs', mlOperandDescriptor);
    mlGraph = await mlBuilder.build(
    @@ -1472,10 +1468,7 @@
    return;
    }

    - const mlTensorDescriptor = {
    - dataType: dataType,
    - shape: shape,
    - };
    + const mlTensorDescriptor = {dataType, shape};
    const mlTensor = await mlContext.createExportableTensor(mlTensorDescriptor,
    gpuDevice);

    @@ -1493,10 +1486,7 @@
    return;
    }

    - const mlTensor = await mlContext.createTensor({
    - dataType: dataType,
    - shape: shape,
    - });
    + const mlTensor = await mlContext.createTensor({dataType, shape});

    await promise_rejects_js(t, TypeError, mlContext.exportToGPU(mlTensor));
    }, `${testName} / export wrong tensor`);
    @@ -1510,8 +1500,8 @@
    const elementSize = typedArray.BYTES_PER_ELEMENT;
    const shape = [maxBufferSizeOOB / elementSize];

    - const mlTensor = await mlContext.createExportableTensor(
    - {dataType: dataType, shape: shape}, gpuDevice);
    + const mlTensor =
    + await mlContext.createExportableTensor({dataType, shape}, gpuDevice);

    await mlContext.exportToGPU(mlTensor);
    }, `${testName} / export big tensor`)
    @@ -1522,7 +1512,7 @@
    }

    const mlTensorDescriptor =
    - {dataType: dataType, shape: shape, readable: true, writable: true};
    + {dataType, shape, readable: true, writable: true};

    let mlTensor = await mlContext.createExportableTensor(mlTensorDescriptor, gpuDevice);
    const inputData = new typedArray(sizeOfShape(shape)).fill(1.0);
    @@ -1539,11 +1529,7 @@
    return;
    }

    - const mlTensorDescriptor = {
    - dataType: dataType,
    - shape: shape,
    - writable: true
    - };
    + const mlTensorDescriptor = {dataType, shape, writable: true};

    let mlTensor = await mlContext.createExportableTensor(mlTensorDescriptor, gpuDevice);

    @@ -1561,12 +1547,8 @@
    return;
    }

    - const mlTensor = await mlContext.createExportableTensor(
    - {
    - dataType: dataType,
    - shape: shape,
    - },
    - gpuDevice);
    + const mlTensor =
    + await mlContext.createExportableTensor({dataType, shape}, gpuDevice);
    await mlContext.exportToGPU(mlTensor);
    assert_throws_js(
    TypeError,
    @@ -1579,12 +1561,8 @@
    return;
    }

    - const mlTensor = await mlContext.createExportableTensor(
    - {
    - dataType: dataType,
    - shape: shape,
    - },
    - gpuDevice);
    + const mlTensor =
    + await mlContext.createExportableTensor({dataType, shape}, gpuDevice);

    // Second call rejects because the first export is still pending and multiple
    // exports aren’t allowed.
    @@ -1604,13 +1582,13 @@

    // Initialize the tensor buffers from WebNN.
    let mlTensorInput = await mlContext.createExportableTensor(
    - {dataType: dataType, shape: shape, writable: true}, gpuDevice);
    + {dataType, shape, writable: true}, gpuDevice);

    const inputData1 = new typedArray(sizeOfShape(shape)).fill(1.0);
    mlContext.writeTensor(mlTensorInput, inputData1);

    - let mlTensorOutput = await mlContext.createExportableTensor(
    - {dataType: dataType, shape: shape}, gpuDevice);
    + let mlTensorOutput =
    + await mlContext.createExportableTensor({dataType, shape}, gpuDevice);

    let gpuTensorBufferInput = await mlContext.exportToGPU(mlTensorInput);
    let gpuTensorBufferOutput = await mlContext.exportToGPU(mlTensorOutput);
    @@ -1644,13 +1622,13 @@

    // Initialize the tensor buffers from WebNN.
    let mlTensorInput = await mlContext.createExportableTensor(
    - {dataType: dataType, shape: shape, writable: true}, gpuDevice);
    + {dataType, shape, writable: true}, gpuDevice);

    const inputData = new typedArray(sizeOfShape(shape)).fill(1.0);
    mlContext.writeTensor(mlTensorInput, inputData);

    let mlTensorOutput = await mlContext.createExportableTensor(
    - {dataType: dataType, shape: shape, readable: true}, gpuDevice);
    + {dataType, shape, readable: true}, gpuDevice);

    let gpuTensorBufferInput = await mlContext.exportToGPU(mlTensorInput);
    let gpuTensorBufferOutput = await mlContext.exportToGPU(mlTensorOutput);
    @@ -1678,18 +1656,13 @@

    // Initialize the tensor buffers from WebNN.
    let mlTensorInput = await mlContext.createExportableTensor(
    - {
    - dataType: dataType,
    - shape: shape,
    - writable: true,
    - },
    - gpuDevice);
    + {dataType, shape, writable: true}, gpuDevice);

    const inputData = new typedArray(sizeOfShape(shape)).fill(1.0);
    mlContext.writeTensor(mlTensorInput, inputData);

    - let mlTensorOutput = await mlContext.createExportableTensor(
    - {dataType: dataType, shape: shape}, gpuDevice);
    + let mlTensorOutput =
    + await mlContext.createExportableTensor({dataType, shape}, gpuDevice);

    let gpuTensorBufferInput = await mlContext.exportToGPU(mlTensorInput);
    let gpuTensorBufferOutput = await mlContext.exportToGPU(mlTensorOutput);
    @@ -1730,12 +1703,7 @@
    let anotherMLContext = await navigator.ml.createContext(contextOptions);

    let mlTensor = await anotherMLContext.createExportableTensor(
    - {
    - dataType: dataType,
    - shape: shape,
    - writable: true,
    - },
    - gpuDevice);
    + {dataType, shape, writable: true}, gpuDevice);

    const inputData = new typedArray(sizeOfShape(shape)).fill(1.0);
    anotherMLContext.writeTensor(mlTensor, inputData);
    @@ -1758,13 +1726,7 @@
    let anotherMLContext = await navigator.ml.createContext(contextOptions);

    let mlTensor = await anotherMLContext.createExportableTensor(
    - {
    - dataType: dataType,
    - shape: shape,
    - readable: true,
    - writable: true,
    - },
    - anotherGPUDevice);
    + {dataType, shape, readable: true, writable: true}, anotherGPUDevice);

    const inputData = new typedArray(sizeOfShape(shape)).fill(1.0);
    anotherMLContext.writeTensor(mlTensor, inputData);
    @@ -1789,8 +1751,7 @@
    let anotherMLContext = await navigator.ml.createContext(contextOptions);

    let mlTensor = await anotherMLContext.createExportableTensor(
    - {dataType: dataType, shape: shape, readable: true, writable: true},
    - anotherGPUDevice);
    + {dataType, shape, readable: true, writable: true}, anotherGPUDevice);
    const inputData = new typedArray(sizeOfShape(shape)).fill(1.0);
    anotherMLContext.writeTensor(mlTensor, inputData);

    ```

    Change information

    Commit message:
    webnn: add webgpu interop float16 test

    Add test coverage for float16. Also update the tensor shape to not use
    the same number for width and height.
    Change-Id: Iec6eb063b03c71747eae56229984247d0c282616
    Reviewed-by: Reilly Grant <rei...@chromium.org>
    Commit-Queue: Phillis Tang <phi...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1545337}
    Files:
    • M third_party/blink/web_tests/external/wpt/webnn/conformance_tests/tensor.https.any.js
    • A third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any.serviceworker_gpu-expected.txt
    • A third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any.sharedworker_gpu-expected.txt
    • A third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any.worker_gpu-expected.txt
    • A third_party/blink/web_tests/platform/mac-mac15-arm64/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any_gpu-expected.txt
    • M third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any.serviceworker_gpu-expected.txt
    • M third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any.sharedworker_gpu-expected.txt
    • M third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any.worker_gpu-expected.txt
    • M third_party/blink/web_tests/platform/mac/virtual/webnn-service-with-gpu/external/wpt/webnn/conformance_tests/tensor.https.any_gpu-expected.txt
    Change size: L
    Delta: 9 files changed, 198 insertions(+), 151 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Reilly Grant
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iec6eb063b03c71747eae56229984247d0c282616
    Gerrit-Change-Number: 7129702
    Gerrit-PatchSet: 6
    Gerrit-Owner: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
    open
    diffy
    satisfied_requirement

    Blink W3C Test Autoroller (Gerrit)

    unread,
    8:33 PM (3 hours ago) 8:33 PM
    to Chromium LUCI CQ, Phillis Tang, Reilly Grant, AyeAye, chromium...@chromium.org, mac-r...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

    Message from Blink W3C Test Autoroller

    The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/56046

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Iec6eb063b03c71747eae56229984247d0c282616
    Gerrit-Change-Number: 7129702
    Gerrit-PatchSet: 6
    Gerrit-Owner: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Comment-Date: Sat, 15 Nov 2025 01:33:04 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages