WebNN: initial implementation of adding label for MLOperator [chromium/src : main]

79 views
Skip to first unread message

Mingming1 Xu (Gerrit)

unread,
May 23, 2024, 11:15:49 PMMay 23
to Lisha Guo, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
Attention needed from Lisha Guo

Mingming1 Xu added 1 comment

File services/webnn/dml/graph_impl.cc
Line 2384, Patchset 3 (Latest): const OperatorNode* resample2d_node = graph_builder.CreateOperatorNode(
Mingming1 Xu . unresolved

You can pass label to dml operator here.

Open in Gerrit

Related details

Attention is currently required from:
  • Lisha Guo
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
Gerrit-Change-Number: 5528797
Gerrit-PatchSet: 3
Gerrit-Owner: Lisha Guo <lish...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
Gerrit-Attention: Lisha Guo <lish...@intel.com>
Gerrit-Comment-Date: Fri, 24 May 2024 03:15:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Lisha Guo (Gerrit)

unread,
Jun 3, 2024, 4:08:55 AMJun 3
to Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org

New activity on the change

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
Gerrit-Change-Number: 5528797
Gerrit-PatchSet: 4
Gerrit-Owner: Lisha Guo <lish...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
Gerrit-Comment-Date: Mon, 03 Jun 2024 08:08:40 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Lisha Guo (Gerrit)

unread,
Jun 3, 2024, 4:10:02 AMJun 3
to Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
Attention needed from Mingming1 Xu

Lisha Guo added 1 comment

File services/webnn/dml/graph_impl.cc
Line 2384, Patchset 3: const OperatorNode* resample2d_node = graph_builder.CreateOperatorNode(
Mingming1 Xu . unresolved

You can pass label to dml operator here.

Lisha Guo

Sounds good. Set name for dml operator in PS4. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Mingming1 Xu
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
Gerrit-Change-Number: 5528797
Gerrit-PatchSet: 4
Gerrit-Owner: Lisha Guo <lish...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
Gerrit-Comment-Date: Mon, 03 Jun 2024 08:09:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Mingming1 Xu <mingmi...@intel.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Mingming1 Xu (Gerrit)

unread,
Jun 4, 2024, 3:19:29 AMJun 4
to Lisha Guo, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
Attention needed from Lisha Guo

Mingming1 Xu added 1 comment

File services/webnn/dml/graph_impl.cc
Line 2384, Patchset 3: const OperatorNode* resample2d_node = graph_builder.CreateOperatorNode(
Mingming1 Xu . resolved

You can pass label to dml operator here.

Lisha Guo

Sounds good. Set name for dml operator in PS4. Thanks!

Mingming1 Xu

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Lisha Guo
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
Gerrit-Change-Number: 5528797
Gerrit-PatchSet: 5
Gerrit-Owner: Lisha Guo <lish...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
Gerrit-Attention: Lisha Guo <lish...@intel.com>
Gerrit-Comment-Date: Tue, 04 Jun 2024 07:19:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
Comment-In-Reply-To: Mingming1 Xu <mingmi...@intel.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Lisha Guo (Gerrit)

unread,
Jun 11, 2024, 1:29:42 AMJun 11
to ningxin hu, Phillis Tang, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org

Lisha Guo added 1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Lisha Guo . resolved

As the discussion in this issue -https://github.com/webmachinelearning/webnn/issues/585, I just implement a prototype which adds labels to MLOperator. The downside with adding to the MLOperator is that it doesn't exist as a concept in the spec, so we will need to add the param to each of the builder method. The advantages compared to adding to MLOperand are listed below:
1. We can get the label in the error message in the validation phase.
2. Since build() is async we need to deal with labels changing during the build process. Right now MLOperand is immutable.
3. If a sequence of operands were returned when invoking some operator, such as split, we need to make a rule to set the label.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
Gerrit-Change-Number: 5528797
Gerrit-PatchSet: 7
Gerrit-Owner: Lisha Guo <lish...@intel.com>
Gerrit-CC: Dwayne Robinson <dwa...@microsoft.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
Gerrit-CC: Phillis Tang <phi...@chromium.org>
Gerrit-CC: ningxin hu <ningx...@intel.com>
Gerrit-Comment-Date: Tue, 11 Jun 2024 05:29:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Phillis Tang (Gerrit)

unread,
Jun 12, 2024, 4:40:00 PMJun 12
to Lisha Guo, Shiyi Zou, ningxin hu, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
Attention needed from Dwayne Robinson, Lisha Guo and ningxin hu

Phillis Tang added 3 comments

File services/webnn/dml/graph_impl_dml.cc
Line 2394, Patchset 7 (Latest): std::optional<std::string> label) {
Phillis Tang . unresolved

remove the param and get from resample2d->label()

File services/webnn/dml/utils.cc
Line 219, Patchset 7 (Latest): error_code, base::StrCat({kBackendName, label.value(), error_message}));
Phillis Tang . unresolved

How about base::StrCat({"[", label.value(), "] ", error_message}); and drop the backend name? The backend name feels like an implementation detail we don't need to expose.

File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
Line 2084, Patchset 7 (Latest): const String label = options->hasLabel() ? options->label() : "resample2d";
Phillis Tang . unresolved

I think we can always have the operator name in the log whether the label is presented or not.

Also you can use ops::kResample2d

Open in Gerrit

Related details

Attention is currently required from:
  • Dwayne Robinson
  • Lisha Guo
  • ningxin hu
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 7
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Wed, 12 Jun 2024 20:39:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 13, 2024, 2:27:38 AMJun 13
    to ningxin hu, Shiyi Zou, Dwayne Robinson, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson and Phillis Tang

    Lisha Guo added 3 comments

    File services/webnn/dml/graph_impl_dml.cc
    Line 2394, Patchset 7: std::optional<std::string> label) {
    Phillis Tang . resolved

    remove the param and get from resample2d->label()

    Lisha Guo

    Done

    File services/webnn/dml/utils.cc
    Line 219, Patchset 7: error_code, base::StrCat({kBackendName, label.value(), error_message}));
    Phillis Tang . unresolved

    How about base::StrCat({"[", label.value(), "] ", error_message}); and drop the backend name? The backend name feels like an implementation detail we don't need to expose.

    Lisha Guo

    Agree that one day when all implementation is stable, we can remove many error messages including this one. But currently, we have reported some detailed error messages, for example "Failed to create pooling operator.", the backend name let developer know which backend reports these messages, it can help us to locate and debug.

    How about 
    ```
    if (label.has_value()) {
    return mojom::Error::New(error_code,
    base::StrCat({kBackendName, "[", label.value(), "] ",
    error_message}));
    }
    ```
    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 2084, Patchset 7: const String label = options->hasLabel() ? options->label() : "resample2d";
    Phillis Tang . unresolved

    I think we can always have the operator name in the log whether the label is presented or not.

    Also you can use ops::kResample2d

    Lisha Guo

    Remove the default name. If the label is not presented, label will be assigned with empty string.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Phillis Tang
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 8
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-CC: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Comment-Date: Thu, 13 Jun 2024 06:27:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    Jun 13, 2024, 3:48:14 PMJun 13
    to Lisha Guo, ningxin hu, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo and ningxin hu

    Phillis Tang added 3 comments

    File services/webnn/dml/utils.cc
    Line 219, Patchset 7: error_code, base::StrCat({kBackendName, label.value(), error_message}));
    Phillis Tang . resolved

    How about base::StrCat({"[", label.value(), "] ", error_message}); and drop the backend name? The backend name feels like an implementation detail we don't need to expose.

    Lisha Guo

    Agree that one day when all implementation is stable, we can remove many error messages including this one. But currently, we have reported some detailed error messages, for example "Failed to create pooling operator.", the backend name let developer know which backend reports these messages, it can help us to locate and debug.

    How about 
    ```
    if (label.has_value()) {
    return mojom::Error::New(error_code,
    base::StrCat({kBackendName, "[", label.value(), "] ",
    error_message}));
    }
    ```
    Phillis Tang

    SGTM for now.

    Line 240, Patchset 8 (Latest): base::StrCat({kBackendName, "[", label.value(), "] ", error_message}));
    Phillis Tang . unresolved

    let's create a helper function in webnn_utils like:
    ```
    std::string GetLabelErrorSuffix(const str::optional<std::string& label) {

      if (!label.has_value()){
    return "";
    }
    return base::StrCat("[", label.value(), "] ");

    }
    ```

    and we can use it here as:
    ```
    base:: StrCat({kBackendName, GetLabelErrorSuffix(label), error_message});
    ```
    and also in ml_graph_builder.cc

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 2084, Patchset 7: const String label = options->hasLabel() ? options->label() : "resample2d";
    Phillis Tang . unresolved

    I think we can always have the operator name in the log whether the label is presented or not.

    Also you can use ops::kResample2d

    Lisha Guo

    Remove the default name. If the label is not presented, label will be assigned with empty string.

    Phillis Tang

    oh I was suggesting something like:

    ```
    ml_context_->LogConsoleWarning(base:: StrCat({GetLabelErrorSuffix(label), ops::kResample2d, ": ", error_message});
    ```

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Lisha Guo
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 8
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Thu, 13 Jun 2024 19:48:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
    Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    Jun 13, 2024, 4:10:29 PMJun 13
    to Lisha Guo, ningxin hu, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo and ningxin hu

    Phillis Tang added 1 comment

    File services/webnn/dml/graph_builder_dml.cc
    Line 111, Patchset 8 (Latest): if (label.has_value()) {
    Phillis Tang . unresolved

    let's add the comment here too.

    Gerrit-Comment-Date: Thu, 13 Jun 2024 20:10:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mingming1 Xu (Gerrit)

    unread,
    Jun 14, 2024, 1:42:24 AMJun 14
    to Lisha Guo, ningxin hu, Shiyi Zou, Dwayne Robinson, Phillis Tang, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo and ningxin hu

    Mingming1 Xu added 1 comment

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
    Line 186, Patchset 8 (Latest):dictionary MLResample2dOptions : MLLabelOptions{
    Mingming1 Xu . unresolved

    How about renaming as `MLOperatorOptions`? Each like `MLResample2dOptions` and `MLReduceOptions` should inherit the base operator options `MLOperatorOptions`

    Gerrit-Comment-Date: Fri, 14 Jun 2024 05:42:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 14, 2024, 5:20:23 AMJun 14
    to ningxin hu, Shiyi Zou, Dwayne Robinson, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Phillis Tang and ningxin hu

    Lisha Guo added 3 comments

    File services/webnn/dml/graph_builder_dml.cc
    Line 111, Patchset 8: if (label.has_value()) {
    Phillis Tang . resolved

    let's add the comment here too.

    Lisha Guo

    Done

    File services/webnn/dml/utils.cc
    Line 240, Patchset 8: base::StrCat({kBackendName, "[", label.value(), "] ", error_message}));
    Phillis Tang . resolved

    let's create a helper function in webnn_utils like:
    ```
    std::string GetLabelErrorSuffix(const str::optional<std::string& label) {

      if (!label.has_value()){
    return "";
    }
    return base::StrCat("[", label.value(), "] ");

    }
    ```

    and we can use it here as:
    ```
    base:: StrCat({kBackendName, GetLabelErrorSuffix(label), error_message});
    ```
    and also in ml_graph_builder.cc

    Lisha Guo

    Done

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 2084, Patchset 7: const String label = options->hasLabel() ? options->label() : "resample2d";
    Phillis Tang . resolved

    I think we can always have the operator name in the log whether the label is presented or not.

    Also you can use ops::kResample2d

    Lisha Guo

    Remove the default name. If the label is not presented, label will be assigned with empty string.

    Phillis Tang

    oh I was suggesting something like:

    ```
    ml_context_->LogConsoleWarning(base:: StrCat({GetLabelErrorSuffix(label), ops::kResample2d, ": ", error_message});
    ```

    Lisha Guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 9
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Comment-Date: Fri, 14 Jun 2024 09:20:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    Jun 14, 2024, 1:23:20 PMJun 14
    to Lisha Guo, ningxin hu, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo and ningxin hu

    Phillis Tang added 1 comment

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 2086, Patchset 9 (Latest): String::Format("%s ops::kResample2d: When sizes and scales are both "
    Phillis Tang . unresolved

    I meant using ops::kResample2d in webnn_utils, not the literal string.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Lisha Guo
    • ningxin hu
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Fri, 14 Jun 2024 17:23:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 14, 2024, 7:27:18 PMJun 14
    to Lisha Guo, ningxin hu, Shiyi Zou, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Lisha Guo, Phillis Tang and ningxin hu

    Dwayne Robinson added 4 comments

    Patchset-level comments
    File-level comment, Patchset 9 (Latest):
    Dwayne Robinson . resolved

    👍 LGTM after Phillis's comment.

    File services/webnn/dml/graph_impl_dml.cc
    Line 2435, Patchset 9 (Latest): const std::optional<std::string>& label = resample2d->label;
    Dwayne Robinson . resolved

    (repeated comment from other CR) When/if we autogenerate missing node names later, I want to avoid each backend generating its own names which makes it more brittle to inconsistencies, making it harder to compare backend results when one has a failure. So this shouldn't be `optional` after that, as the front-end already generated the labels for each backend. (resolving for now)

    File services/webnn/dml/utils.cc
    Line 219, Patchset 7: error_code, base::StrCat({kBackendName, label.value(), error_message}));
    Phillis Tang . resolved

    How about base::StrCat({"[", label.value(), "] ", error_message}); and drop the backend name? The backend name feels like an implementation detail we don't need to expose.

    Lisha Guo

    Agree that one day when all implementation is stable, we can remove many error messages including this one. But currently, we have reported some detailed error messages, for example "Failed to create pooling operator.", the backend name let developer know which backend reports these messages, it can help us to locate and debug.

    How about 
    ```
    if (label.has_value()) {
    return mojom::Error::New(error_code,
                                 base::StrCat({kBackendName, "[", label.value(), "] ",
    error_message}));
    }
    ```
    Phillis Tang

    SGTM for now.

    Dwayne Robinson

    Yeah, having the backend would be helpful for now. Once they reach parity of completeness, it will probably be less relevant.

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 2086, Patchset 9 (Latest): String::Format("%s ops::kResample2d: When sizes and scales are both "
    Phillis Tang . unresolved

    I meant using ops::kResample2d in webnn_utils, not the literal string.

    Dwayne Robinson

    ++

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 9
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Fri, 14 Jun 2024 23:27:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 17, 2024, 7:30:40 AM (12 days ago) Jun 17
    to ningxin hu, Shiyi Zou, Dwayne Robinson, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Phillis Tang and ningxin hu

    Lisha Guo added 2 comments

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    Lisha Guo . resolved

    For PS12, this CL added the implementation of prelu which doesn't have any options before.
    @dwa...@microsoft.com Please take another look. Thanks!

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 2086, Patchset 9: String::Format("%s ops::kResample2d: When sizes and scales are both "
    Phillis Tang . resolved

    I meant using ops::kResample2d in webnn_utils, not the literal string.

    Dwayne Robinson

    ++

    Lisha Guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 12
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Comment-Date: Mon, 17 Jun 2024 11:30:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    Jun 17, 2024, 3:49:13 PM (12 days ago) Jun 17
    to Lisha Guo, ningxin hu, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo, Mingming1 Xu and ningxin hu

    Phillis Tang added 4 comments

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 1996, Patchset 12 (Latest): webnn::OpTagToString(webnn::mojom::blink::Operation::Tag::kPrelu)
    Phillis Tang . unresolved

    no need to use OpTagToString, just use `webnn::ops::kPrelu`, same for resample2d

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
    Line 186, Patchset 8:dictionary MLResample2dOptions : MLLabelOptions{
    Mingming1 Xu . unresolved

    How about renaming as `MLOperatorOptions`? Each like `MLResample2dOptions` and `MLReduceOptions` should inherit the base operator options `MLOperatorOptions`

    Phillis Tang

    +1

    Line 316, Patchset 12 (Latest): [RaisesException] MLOperand prelu(MLOperand x, MLOperand slope, optional MLPreluOptions options = {});
    Phillis Tang . unresolved

    we can just specify `optional MLOperatorOptions`? No need to define a MLPreluOptions

    File third_party/blink/renderer/modules/ml/webnn/ml_operator.h
    Phillis Tang . unresolved

    remove

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Lisha Guo
    • Mingming1 Xu
    • ningxin hu
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Mon, 17 Jun 2024 19:49:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mingming1 Xu <mingmi...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 17, 2024, 5:16:00 PM (12 days ago) Jun 17
    to Lisha Guo, ningxin hu, Shiyi Zou, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Lisha Guo, Mingming1 Xu, Phillis Tang and ningxin hu

    Dwayne Robinson added 3 comments

    Patchset-level comments
    Dwayne Robinson . resolved

    👍 LGTM after addressing other's comments.

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
    Line 186, Patchset 8:dictionary MLResample2dOptions : MLLabelOptions{
    Mingming1 Xu . unresolved

    How about renaming as `MLOperatorOptions`? Each like `MLResample2dOptions` and `MLReduceOptions` should inherit the base operator options `MLOperatorOptions`

    Phillis Tang

    +1

    Dwayne Robinson

    ++

    Line 316, Patchset 12 (Latest): [RaisesException] MLOperand prelu(MLOperand x, MLOperand slope, optional MLPreluOptions options = {});
    Phillis Tang . unresolved

    we can just specify `optional MLOperatorOptions`? No need to define a MLPreluOptions

    Dwayne Robinson

    ++

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    • Mingming1 Xu
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 12
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Comment-Date: Mon, 17 Jun 2024 21:15:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
    Comment-In-Reply-To: Mingming1 Xu <mingmi...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 17, 2024, 10:14:40 PM (12 days ago) Jun 17
    to ningxin hu, Shiyi Zou, Dwayne Robinson, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Mingming1 Xu, Phillis Tang and ningxin hu

    Lisha Guo added 4 comments

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 1996, Patchset 12: webnn::OpTagToString(webnn::mojom::blink::Operation::Tag::kPrelu)
    Phillis Tang . resolved

    no need to use OpTagToString, just use `webnn::ops::kPrelu`, same for resample2d

    Lisha Guo

    Done

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
    Line 186, Patchset 8:dictionary MLResample2dOptions : MLLabelOptions{
    Mingming1 Xu . resolved

    How about renaming as `MLOperatorOptions`? Each like `MLResample2dOptions` and `MLReduceOptions` should inherit the base operator options `MLOperatorOptions`

    Phillis Tang

    +1

    Dwayne Robinson

    ++

    Lisha Guo

    Sound good. Rename `MLLabelOptions` to `MLOperatorOptions` in PS13.

    Line 316, Patchset 12: [RaisesException] MLOperand prelu(MLOperand x, MLOperand slope, optional MLPreluOptions options = {});
    Phillis Tang . resolved

    we can just specify `optional MLOperatorOptions`? No need to define a MLPreluOptions

    Dwayne Robinson

    ++

    Lisha Guo

    Use `MLOperatorOptions` instead of `MLPreluOptions` in PS13.

    File third_party/blink/renderer/modules/ml/webnn/ml_operator.h
    Phillis Tang . resolved

    remove

    Lisha Guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Mingming1 Xu
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 14
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Tue, 18 Jun 2024 02:14:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 17, 2024, 11:18:00 PM (12 days ago) Jun 17
    to Lisha Guo, ningxin hu, Shiyi Zou, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Lisha Guo, Mingming1 Xu, Phillis Tang and ningxin hu

    Dwayne Robinson added 1 comment

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 1996, Patchset 12: webnn::OpTagToString(webnn::mojom::blink::Operation::Tag::kPrelu)
    Phillis Tang . resolved

    no need to use OpTagToString, just use `webnn::ops::kPrelu`, same for resample2d

    Lisha Guo

    Done

    Dwayne Robinson
    Phillis more likely meant...
    ```
    exception_state.ThrowTypeError(String::Format(
    "%s %s: %s", webnn::GetLabelErrorSuffix(label).c_str(),
    webnn::ops::kPrelu, ...
    ```
    ...and not literally type `webnn::ops::kPrelu` in the user-visible string.
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    • Mingming1 Xu
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 14
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Tue, 18 Jun 2024 03:17:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 17, 2024, 11:30:18 PM (12 days ago) Jun 17
    to ningxin hu, Shiyi Zou, Dwayne Robinson, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Mingming1 Xu, Phillis Tang and ningxin hu

    Lisha Guo added 1 comment

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 1996, Patchset 12: webnn::OpTagToString(webnn::mojom::blink::Operation::Tag::kPrelu)
    Phillis Tang . resolved

    no need to use OpTagToString, just use `webnn::ops::kPrelu`, same for resample2d

    Lisha Guo

    Done

    Dwayne Robinson
    Phillis more likely meant...
    ```
    exception_state.ThrowTypeError(String::Format(
    "%s %s: %s", webnn::GetLabelErrorSuffix(label).c_str(),
    webnn::ops::kPrelu, ...
    ```
    ...and not literally type `webnn::ops::kPrelu` in the user-visible string.
    Lisha Guo

    Sorry for the misunderstanding. Updated the code in PS15. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Mingming1 Xu
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 15
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Tue, 18 Jun 2024 03:30:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dwayne Robinson (Gerrit)

    unread,
    Jun 18, 2024, 12:23:15 AM (12 days ago) Jun 18
    to Lisha Guo, ningxin hu, Shiyi Zou, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Lisha Guo, Mingming1 Xu, Phillis Tang and ningxin hu

    Dwayne Robinson added 1 comment

    Patchset-level comments
    File-level comment, Patchset 15 (Latest):
    Dwayne Robinson . resolved

    👍 Thanks for improving the diagnosability for WebNN users, Lisha.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Lisha Guo
    • Mingming1 Xu
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 15
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Tue, 18 Jun 2024 04:23:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lisha Guo (Gerrit)

    unread,
    Jun 18, 2024, 2:06:48 AM (12 days ago) Jun 18
    to ningxin hu, Shiyi Zou, Dwayne Robinson, Phillis Tang, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Mingming1 Xu, Phillis Tang and ningxin hu

    Lisha Guo added 2 comments

    Patchset-level comments
    Dwayne Robinson . resolved

    👍 Thanks for improving the diagnosability for WebNN users, Lisha.

    Lisha Guo

    It is my pleasure. Look forward to your edit of WebNN spec.

    Dwayne Robinson . resolved

    👍 Thanks for improving the diagnosability for WebNN users, Lisha.

    Lisha Guo

    It is my pleasure. Look forward to the WebNN spec

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Mingming1 Xu
    • Phillis Tang
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 15
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Phillis Tang <phi...@chromium.org>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Tue, 18 Jun 2024 06:06:37 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dwayne Robinson <dwa...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    Jun 18, 2024, 12:51:08 PM (11 days ago) Jun 18
    to Lisha Guo, ningxin hu, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Lisha Guo, Mingming1 Xu and ningxin hu

    Phillis Tang voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Lisha Guo
    • Mingming1 Xu
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 15
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Tue, 18 Jun 2024 16:50:48 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Phillis Tang (Gerrit)

    unread,
    Jun 20, 2024, 1:00:41 PM (9 days ago) Jun 20
    to Lisha Guo, Chromium IPC Reviews, ningxin hu, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Chromium IPC Reviews, Dwayne Robinson, Lisha Guo, Mingming1 Xu and ningxin hu

    Phillis Tang added 1 comment

    Patchset-level comments
    Phillis Tang . resolved

    @lish...@intel.com can you please rebase?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Chromium IPC Reviews
    • Dwayne Robinson
    • Lisha Guo
    • Mingming1 Xu
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 15
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Thu, 20 Jun 2024 17:00:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    gwsq (Gerrit)

    unread,
    Jun 20, 2024, 1:04:31 PM (9 days ago) Jun 20
    to Lisha Guo, Chromium IPC Reviews, Kinuko Yasuda, Phillis Tang, ningxin hu, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

    Message from gwsq

    From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
    IPC: kin...@chromium.org

    📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).

    IPC reviewer(s): kin...@chromium.org


    Reviewer source(s):
    kin...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Kinuko Yasuda
    • Lisha Guo
    • Mingming1 Xu
    • ningxin hu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
    Gerrit-Change-Number: 5528797
    Gerrit-PatchSet: 15
    Gerrit-Owner: Lisha Guo <lish...@intel.com>
    Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
    Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-CC: Shiyi Zou <shiy...@intel.com>
    Gerrit-CC: gwsq
    Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
    Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
    Gerrit-Attention: ningxin hu <ningx...@intel.com>
    Gerrit-Attention: Lisha Guo <lish...@intel.com>
    Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
    Gerrit-Comment-Date: Thu, 20 Jun 2024 17:04:13 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    ningxin hu (Gerrit)

    unread,
    Jun 24, 2024, 2:38:02 AM (6 days ago) Jun 24
    to Lisha Guo, Chromium IPC Reviews, Kinuko Yasuda, Phillis Tang, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
    Attention needed from Dwayne Robinson, Kinuko Yasuda, Lisha Guo and Mingming1 Xu

    ningxin hu added 8 comments

    Commit Message
    Line 9, Patchset 15 (Latest):This CL attempts to add label for MLOperator to report more detailed
    error message during the async build.
    ningxin hu . unresolved

    You may want to mention this CL only implements the label for two operators `prelu` and `resample2d`. Other operators will be supported in a separate CL.

    Line 11, Patchset 15 (Latest):
    ningxin hu . unresolved

    Please also add a reference to spec discussion https://github.com/webmachinelearning/webnn/issues/585

    File components/ml/webnn/graph_validation_utils.cc
    Line 1012, Patchset 15 (Latest): "The data type of the input must be "
    "one of the floating point types.");
    ningxin hu . unresolved

    Do we really need this change?

    File services/webnn/dml/graph_builder_dml.h
    Line 161, Patchset 15 (Latest): // stored in `GraphBuilder::operator_nodes_` and returns its pointer. When it
    ningxin hu . unresolved

    The class name is now `GraphBuilderDml`.

    File services/webnn/public/mojom/webnn_graph.mojom
    Line 794, Patchset 15 (Latest): // Specifies the name for the operator
    ningxin hu . unresolved

    Add period at the end of this sentence.

    Line 949, Patchset 15 (Latest): // Specifies the name for the operator
    ningxin hu . unresolved

    ditto.

    File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
    Line 2002, Patchset 15 (Latest): /*sub_kind=*/absl::monostate{});
    ningxin hu . unresolved
    `options` should be passed to `MLOperator` constructor otherwise it will use the default value nullptr.
    ```suggestion
    /*sub_kind=*/absl::monostate{}, options);
    ```
    Line 2095, Patchset 15 (Latest): "%s %s: When sizes and scales are both "
    "specified, scales argument is "
    "ignored.",
    ningxin hu . unresolved

    Can this message be in two lines? The lines seem to break too short?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dwayne Robinson
    • Kinuko Yasuda
    • Lisha Guo
    • Mingming1 Xu
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
      Gerrit-Change-Number: 5528797
      Gerrit-PatchSet: 15
      Gerrit-Owner: Lisha Guo <lish...@intel.com>
      Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
      Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
      Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
      Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
      Gerrit-CC: Shiyi Zou <shiy...@intel.com>
      Gerrit-CC: gwsq
      Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
      Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
      Gerrit-Attention: Lisha Guo <lish...@intel.com>
      Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
      Gerrit-Comment-Date: Mon, 24 Jun 2024 06:37:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Lisha Guo (Gerrit)

      unread,
      Jun 25, 2024, 4:04:54 AM (5 days ago) Jun 25
      to ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Phillis Tang, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
      Attention needed from Dwayne Robinson, Kinuko Yasuda, Mingming1 Xu, Phillis Tang and ningxin hu

      Lisha Guo added 9 comments

      Patchset-level comments
      File-level comment, Patchset 19 (Latest):
      Lisha Guo . resolved

      Uploaded PS19 to reach your comments. @ningx...@intel.com @phi...@chromium.org Please take another look. Thanks!

      Commit Message
      Line 9, Patchset 15:This CL attempts to add label for MLOperator to report more detailed

      error message during the async build.
      ningxin hu . resolved

      You may want to mention this CL only implements the label for two operators `prelu` and `resample2d`. Other operators will be supported in a separate CL.

      Lisha Guo

      Done

      Line 11, Patchset 15:
      ningxin hu . resolved

      Please also add a reference to spec discussion https://github.com/webmachinelearning/webnn/issues/585

      Lisha Guo

      Done

      File components/ml/webnn/graph_validation_utils.cc
      Line 1012, Patchset 15: "The data type of the input must be "

      "one of the floating point types.");
      ningxin hu . resolved

      Do we really need this change?

      Lisha Guo

      Done

      File services/webnn/dml/graph_builder_dml.h
      Line 161, Patchset 15: // stored in `GraphBuilder::operator_nodes_` and returns its pointer. When it
      ningxin hu . resolved

      The class name is now `GraphBuilderDml`.

      Lisha Guo

      Done

      File services/webnn/public/mojom/webnn_graph.mojom
      Line 794, Patchset 15: // Specifies the name for the operator
      ningxin hu . resolved

      Add period at the end of this sentence.

      Lisha Guo

      Done

      Line 949, Patchset 15: // Specifies the name for the operator
      ningxin hu . resolved

      ditto.

      Lisha Guo

      Done

      File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
      Line 2002, Patchset 15: /*sub_kind=*/absl::monostate{});
      ningxin hu . resolved
      `options` should be passed to `MLOperator` constructor otherwise it will use the default value nullptr.
      ```suggestion
      /*sub_kind=*/absl::monostate{}, options);
      ```
      Lisha Guo

      Done

      Line 2095, Patchset 15: "%s %s: When sizes and scales are both "

      "specified, scales argument is "
      "ignored.",
      ningxin hu . resolved

      Can this message be in two lines? The lines seem to break too short?

      Lisha Guo

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dwayne Robinson
      • Kinuko Yasuda
      • Mingming1 Xu
      • Phillis Tang
      • ningxin hu
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
      Gerrit-Change-Number: 5528797
      Gerrit-PatchSet: 19
      Gerrit-Owner: Lisha Guo <lish...@intel.com>
      Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
      Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
      Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
      Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
      Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
      Gerrit-CC: Shiyi Zou <shiy...@intel.com>
      Gerrit-CC: gwsq
      Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
      Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
      Gerrit-Attention: ningxin hu <ningx...@intel.com>
      Gerrit-Attention: Phillis Tang <phi...@chromium.org>
      Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
      Gerrit-Comment-Date: Tue, 25 Jun 2024 08:04:43 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: ningxin hu <ningx...@intel.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Phillis Tang (Gerrit)

      unread,
      Jun 25, 2024, 2:24:35 PM (4 days ago) Jun 25
      to Lisha Guo, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
      Attention needed from Dwayne Robinson, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

      Phillis Tang added 2 comments

      File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
      Line 1867, Patchset 19 (Latest): char op_str[] = "webnn::ops::kResample2d";
      Phillis Tang . unresolved

      never creates a op str, just use the webnn::ops::kResample2d variable.

      Line 1868, Patchset 19 (Latest): ASSIGN_OR_THROW_AND_RETURN_IF_ERROR_WITH_LABEL(
      Phillis Tang . unresolved

      instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to `ValidateResample2dAndInferOutput`?

      This allows more flexibilities on where to put the label and op name in the error message. Also the macro is kind of hard to read with implicitly capturing of label and op_str.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dwayne Robinson
      • Kinuko Yasuda
      • Lisha Guo
      • Mingming1 Xu
      • ningxin hu
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
        Gerrit-Change-Number: 5528797
        Gerrit-PatchSet: 19
        Gerrit-Owner: Lisha Guo <lish...@intel.com>
        Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
        Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
        Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
        Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
        Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Jiewei Qian <q...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-CC: Shiyi Zou <shiy...@intel.com>
        Gerrit-CC: gwsq
        Gerrit-Attention: Dwayne Robinson <dwa...@microsoft.com>
        Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
        Gerrit-Attention: ningxin hu <ningx...@intel.com>
        Gerrit-Attention: Lisha Guo <lish...@intel.com>
        Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-Comment-Date: Tue, 25 Jun 2024 18:24:26 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Lisha Guo (Gerrit)

        unread,
        Jun 26, 2024, 2:45:55 AM (4 days ago) Jun 26
        to Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Phillis Tang, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
        Attention needed from Kinuko Yasuda, Mingming1 Xu, Phillis Tang and ningxin hu

        Lisha Guo added 1 comment

        File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
        Line 1868, Patchset 19 (Latest): ASSIGN_OR_THROW_AND_RETURN_IF_ERROR_WITH_LABEL(
        Phillis Tang . unresolved

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to `ValidateResample2dAndInferOutput`?

        This allows more flexibilities on where to put the label and op name in the error message. Also the macro is kind of hard to read with implicitly capturing of label and op_str.

        Lisha Guo

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to ValidateResample2dAndInferOutput?

        Agree. Move the logic down to validate functions seems more flexibilities. However, I can not find out how to use the `GetLabelErrorSuffix` and `webnn::ops::kResample2d` defined in services/webnn/webnn_util.h from the `validateResample2dAndInferOut` which is located in `services/webnn/public/cpp/graph_validation_utils.h`. If we add the deps of `services/webnn::webnn_utils` in the build.gn file under the `services/webnn/public/cpp`, the ninja failed as below:
        ```
        Regenerating ninja filesERROR Dependency cycle:
        //services/webnn/public/mojom:mojom ->
        //services/webnn/public/mojom:webnn_mojom_traits ->
        //services/webnn/public/cpp:cpp ->
        //services/webnn:webnn_utils ->
        //services/webnn/public/mojom:mojom
        ```
        Could you please share some solution?
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kinuko Yasuda
        • Mingming1 Xu
        • Phillis Tang
        • ningxin hu
        Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
        Gerrit-Attention: ningxin hu <ningx...@intel.com>
        Gerrit-Attention: Phillis Tang <phi...@chromium.org>
        Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-Comment-Date: Wed, 26 Jun 2024 06:45:44 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Phillis Tang (Gerrit)

        unread,
        Jun 26, 2024, 4:12:54 PM (3 days ago) Jun 26
        to Lisha Guo, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
        Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

        Phillis Tang added 1 comment

        File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
        Line 1868, Patchset 19 (Latest): ASSIGN_OR_THROW_AND_RETURN_IF_ERROR_WITH_LABEL(
        Phillis Tang . unresolved

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to `ValidateResample2dAndInferOutput`?

        This allows more flexibilities on where to put the label and op name in the error message. Also the macro is kind of hard to read with implicitly capturing of label and op_str.

        Lisha Guo

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to ValidateResample2dAndInferOutput?

        Agree. Move the logic down to validate functions seems more flexibilities. However, I can not find out how to use the `GetLabelErrorSuffix` and `webnn::ops::kResample2d` defined in services/webnn/webnn_util.h from the `validateResample2dAndInferOut` which is located in `services/webnn/public/cpp/graph_validation_utils.h`. If we add the deps of `services/webnn::webnn_utils` in the build.gn file under the `services/webnn/public/cpp`, the ninja failed as below:
        ```
        Regenerating ninja filesERROR Dependency cycle:
        //services/webnn/public/mojom:mojom ->
        //services/webnn/public/mojom:webnn_mojom_traits ->
        //services/webnn/public/cpp:cpp ->
        //services/webnn:webnn_utils ->
        //services/webnn/public/mojom:mojom
        ```
        Could you please share some solution?
        Phillis Tang

        Oh right, now that https://chromium-review.googlesource.com/c/chromium/src/+/5608793 is merged, you can move the function to services/webnn/public/cpp/webnn_errors.h

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kinuko Yasuda
        • Lisha Guo
        • Mingming1 Xu
        • ningxin hu
        Gerrit-Attention: Lisha Guo <lish...@intel.com>
        Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-Comment-Date: Wed, 26 Jun 2024 20:12:40 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
        Comment-In-Reply-To: Lisha Guo <lish...@intel.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Phillis Tang (Gerrit)

        unread,
        Jun 26, 2024, 7:12:09 PM (3 days ago) Jun 26
        to Lisha Guo, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
        Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

        Phillis Tang added 1 comment

        File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
        Line 1868, Patchset 19 (Latest): ASSIGN_OR_THROW_AND_RETURN_IF_ERROR_WITH_LABEL(
        Phillis Tang . unresolved

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to `ValidateResample2dAndInferOutput`?

        This allows more flexibilities on where to put the label and op name in the error message. Also the macro is kind of hard to read with implicitly capturing of label and op_str.

        Lisha Guo

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to ValidateResample2dAndInferOutput?

        Agree. Move the logic down to validate functions seems more flexibilities. However, I can not find out how to use the `GetLabelErrorSuffix` and `webnn::ops::kResample2d` defined in services/webnn/webnn_util.h from the `validateResample2dAndInferOut` which is located in `services/webnn/public/cpp/graph_validation_utils.h`. If we add the deps of `services/webnn::webnn_utils` in the build.gn file under the `services/webnn/public/cpp`, the ninja failed as below:
        ```
        Regenerating ninja filesERROR Dependency cycle:
        //services/webnn/public/mojom:mojom ->
        //services/webnn/public/mojom:webnn_mojom_traits ->
        //services/webnn/public/cpp:cpp ->
        //services/webnn:webnn_utils ->
        //services/webnn/public/mojom:mojom
        ```
        Could you please share some solution?
        Phillis Tang

        Oh right, now that https://chromium-review.googlesource.com/c/chromium/src/+/5608793 is merged, you can move the function to services/webnn/public/cpp/webnn_errors.h

        Phillis Tang

        also you don't need to include the op name in the error message, as they should be TypeError like:
        ```
        TypeError: Failed to execute 'resample2d' on 'MLGraphBuilder': ...'
        ```

        Gerrit-Comment-Date: Wed, 26 Jun 2024 23:11:59 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Lisha Guo (Gerrit)

        unread,
        Jun 27, 2024, 5:16:40 AM (2 days ago) Jun 27
        to Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Phillis Tang, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
        Attention needed from Kinuko Yasuda, Mingming1 Xu, Phillis Tang and ningxin hu

        Lisha Guo added 3 comments

        Patchset-level comments
        File-level comment, Patchset 21 (Latest):
        Lisha Guo . resolved

        Rebased to the latest main branch. @phi...@chromium.org Please take another look. Thanks!

        File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
        Line 1867, Patchset 19: char op_str[] = "webnn::ops::kResample2d";
        Phillis Tang . resolved

        never creates a op str, just use the webnn::ops::kResample2d variable.

        Lisha Guo

        Done

        Line 1868, Patchset 19: ASSIGN_OR_THROW_AND_RETURN_IF_ERROR_WITH_LABEL(
        Phillis Tang . resolved

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to `ValidateResample2dAndInferOutput`?

        This allows more flexibilities on where to put the label and op name in the error message. Also the macro is kind of hard to read with implicitly capturing of label and op_str.

        Lisha Guo

        instead of creating this macro that piece together an error message from a downstream message, can we just move the logic down to ValidateResample2dAndInferOutput?

        Agree. Move the logic down to validate functions seems more flexibilities. However, I can not find out how to use the `GetLabelErrorSuffix` and `webnn::ops::kResample2d` defined in services/webnn/webnn_util.h from the `validateResample2dAndInferOut` which is located in `services/webnn/public/cpp/graph_validation_utils.h`. If we add the deps of `services/webnn::webnn_utils` in the build.gn file under the `services/webnn/public/cpp`, the ninja failed as below:
        ```
        Regenerating ninja filesERROR Dependency cycle:
        //services/webnn/public/mojom:mojom ->
        //services/webnn/public/mojom:webnn_mojom_traits ->
        //services/webnn/public/cpp:cpp ->
        //services/webnn:webnn_utils ->
        //services/webnn/public/mojom:mojom
        ```
        Could you please share some solution?
        Phillis Tang

        Oh right, now that https://chromium-review.googlesource.com/c/chromium/src/+/5608793 is merged, you can move the function to services/webnn/public/cpp/webnn_errors.h

        Phillis Tang

        also you don't need to include the op name in the error message, as they should be TypeError like:
        ```
        TypeError: Failed to execute 'resample2d' on 'MLGraphBuilder': ...'
        ```

        Lisha Guo

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kinuko Yasuda
        • Mingming1 Xu
        • Phillis Tang
        • ningxin hu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
        Gerrit-Change-Number: 5528797
        Gerrit-PatchSet: 21
        Gerrit-Owner: Lisha Guo <lish...@intel.com>
        Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
        Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
        Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
        Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
        Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Jiewei Qian <q...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-CC: Shiyi Zou <shiy...@intel.com>
        Gerrit-CC: gwsq
        Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
        Gerrit-Attention: ningxin hu <ningx...@intel.com>
        Gerrit-Attention: Phillis Tang <phi...@chromium.org>
        Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-Comment-Date: Thu, 27 Jun 2024 09:16:26 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Lisha Guo (Gerrit)

        unread,
        Jun 27, 2024, 5:20:13 AM (2 days ago) Jun 27
        to Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Phillis Tang, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
        Attention needed from Alex Gough, Kinuko Yasuda, Mingming1 Xu, Phillis Tang and ningxin hu

        Lisha Guo added 1 comment

        Patchset-level comments
        Lisha Guo . resolved

        Adding @aj...@chromium.org as reviewer since this CL also modified the mojo definition. PTAL. Thanks!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Gough
        • Kinuko Yasuda
        • Mingming1 Xu
        • Phillis Tang
        • ningxin hu
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        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: I4880e48eaa6c203bf5428b0672c73ca2beb8c76c
        Gerrit-Change-Number: 5528797
        Gerrit-PatchSet: 21
        Gerrit-Owner: Lisha Guo <lish...@intel.com>
        Gerrit-Reviewer: Alex Gough <aj...@chromium.org>
        Gerrit-Reviewer: Dwayne Robinson <dwa...@microsoft.com>
        Gerrit-Reviewer: Kinuko Yasuda <kin...@chromium.org>
        Gerrit-Reviewer: Lisha Guo <lish...@intel.com>
        Gerrit-Reviewer: Phillis Tang <phi...@chromium.org>
        Gerrit-Reviewer: ningxin hu <ningx...@intel.com>
        Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
        Gerrit-CC: Jiewei Qian <q...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-CC: Shiyi Zou <shiy...@intel.com>
        Gerrit-CC: gwsq
        Gerrit-Attention: Alex Gough <aj...@chromium.org>
        Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
        Gerrit-Attention: ningxin hu <ningx...@intel.com>
        Gerrit-Attention: Phillis Tang <phi...@chromium.org>
        Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
        Gerrit-Comment-Date: Thu, 27 Jun 2024 09:20:03 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Phillis Tang (Gerrit)

        unread,
        Jun 27, 2024, 12:59:40 PM (2 days ago) Jun 27
        to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
        Attention needed from Alex Gough, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

        Phillis Tang voted and added 4 comments

        Votes added by Phillis Tang

        Code-Review+1

        4 comments

        Patchset-level comments
        Phillis Tang . resolved

        LGTM % minor suggestions

        File services/webnn/public/cpp/graph_validation_utils.h
        Line 553, Patchset 21 (Latest): const std::optional<std::string>& label = std::nullopt);
        Phillis Tang . unresolved

        ditto

        Line 457, Patchset 21 (Latest): const std::optional<std::string>& label = std::nullopt);
        Phillis Tang . unresolved

        let's remove the default std::nullopt and always require this param.

        File services/webnn/public/cpp/graph_validation_utils.cc
        Line 983, Patchset 21 (Latest): base::StrCat({GetLabelErrorSuffix(label), "The scale is too large."}));
        Phillis Tang . unresolved

        nit: move this to a helper function:
        ```
        namespace {

        std::string ErrorWithLabel(base::string_view error_message, std::optional<std::string> label){
        ...
        };

        } // namespace
        ```

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Gough
        • Kinuko Yasuda
        • Lisha Guo
        • Mingming1 Xu
        • ningxin hu
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Thu, 27 Jun 2024 16:59:26 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Alex Gough (Gerrit)

          unread,
          Jun 27, 2024, 6:28:51 PM (2 days ago) Jun 27
          to Lisha Guo, Phillis Tang, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Alex Gough added 1 comment

          Patchset-level comments
          Alex Gough . unresolved

          why does the label need to go to the gpu side of the mojom interface - we shouldn't be generating graphs that are invalid through that point?

          Open in Gerrit

          Related details

          Attention is currently required from:
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Thu, 27 Jun 2024 22:28:38 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Alex Gough (Gerrit)

          unread,
          Jun 27, 2024, 6:35:47 PM (2 days ago) Jun 27
          to Lisha Guo, Phillis Tang, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Alex Gough added 2 comments

          File services/webnn/public/mojom/webnn_graph.mojom
          Line 799, Patchset 21 (Latest): string? label;
          Alex Gough . unresolved

          if the gpu side /needs/ to have an identifier that makes sense in the renderer then this could instead be a uint64 label_id and the labels live in the renderer all the time?

          File third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
          Line 1228, Patchset 21 (Latest): CHECK(options);
          Alex Gough . unresolved

          don't need to CHECK() you will crash anyway

          Gerrit-Comment-Date: Thu, 27 Jun 2024 22:35:31 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 27, 2024, 7:22:49 PM (2 days ago) Jun 27
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Alex Gough, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang added 2 comments

          Patchset-level comments
          Alex Gough . unresolved

          why does the label need to go to the gpu side of the mojom interface - we shouldn't be generating graphs that are invalid through that point?

          Phillis Tang

          the graph could be valid and there could be backend specific errors during graph execution.

          File services/webnn/public/mojom/webnn_graph.mojom
          Alex Gough . unresolved

          if the gpu side /needs/ to have an identifier that makes sense in the renderer then this could instead be a uint64 label_id and the labels live in the renderer all the time?

          Phillis Tang

          it's less as an identifier(doesn't need to be unique) but a descriptor to be attached to error message.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Gough
          Gerrit-Attention: Alex Gough <aj...@chromium.org>
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Thu, 27 Jun 2024 23:22:37 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Alex Gough <aj...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Alex Gough (Gerrit)

          unread,
          Jun 27, 2024, 7:49:11 PM (2 days ago) Jun 27
          to Lisha Guo, Phillis Tang, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu, Phillis Tang and ningxin hu

          Alex Gough added 1 comment

          File services/webnn/public/mojom/webnn_graph.mojom
          Alex Gough . unresolved

          if the gpu side /needs/ to have an identifier that makes sense in the renderer then this could instead be a uint64 label_id and the labels live in the renderer all the time?

          Phillis Tang

          it's less as an identifier(doesn't need to be unique) but a descriptor to be attached to error message.

          Alex Gough

          are there other cases where we provide this level of detail back to the renderer from a backend process? It feels somewhat wasteful to send strings around only in case they are needed for error reporting

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • Phillis Tang
          • ningxin hu
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Phillis Tang <phi...@chromium.org>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Thu, 27 Jun 2024 23:48:58 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Alex Gough <aj...@chromium.org>
          Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 27, 2024, 7:58:19 PM (2 days ago) Jun 27
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Alex Gough, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang added 1 comment

          File services/webnn/public/mojom/webnn_graph.mojom
          Alex Gough . unresolved

          if the gpu side /needs/ to have an identifier that makes sense in the renderer then this could instead be a uint64 label_id and the labels live in the renderer all the time?

          Phillis Tang

          it's less as an identifier(doesn't need to be unique) but a descriptor to be attached to error message.

          Alex Gough

          are there other cases where we provide this level of detail back to the renderer from a backend process? It feels somewhat wasteful to send strings around only in case they are needed for error reporting

          Phillis Tang

          the concept is borrowed from webgpu(consulted with their team), and the problem we are trying to solve is that it's very hard for developers to debug async errors coming back from the backend process during graph compilation/execution, so having user defined labels are very helpful to decipher errors from a complex graph.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Gough
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • ningxin hu
          Gerrit-Attention: Alex Gough <aj...@chromium.org>
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Thu, 27 Jun 2024 23:58:01 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Alex Gough (Gerrit)

          unread,
          Jun 27, 2024, 8:07:55 PM (2 days ago) Jun 27
          to Lisha Guo, Phillis Tang, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu, Phillis Tang and ningxin hu

          Alex Gough added 1 comment

          File services/webnn/public/mojom/webnn_graph.mojom
          Alex Gough . unresolved

          if the gpu side /needs/ to have an identifier that makes sense in the renderer then this could instead be a uint64 label_id and the labels live in the renderer all the time?

          Phillis Tang

          it's less as an identifier(doesn't need to be unique) but a descriptor to be attached to error message.

          Alex Gough

          are there other cases where we provide this level of detail back to the renderer from a backend process? It feels somewhat wasteful to send strings around only in case they are needed for error reporting

          Phillis Tang

          the concept is borrowed from webgpu(consulted with their team), and the problem we are trying to solve is that it's very hard for developers to debug async errors coming back from the backend process during graph compilation/execution, so having user defined labels are very helpful to decipher errors from a complex graph.

          Alex Gough

          thanks - perhaps this can be called 'debug_label' to make its purpose clearer?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • Phillis Tang
          • ningxin hu
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Phillis Tang <phi...@chromium.org>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 00:07:42 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 27, 2024, 8:17:16 PM (2 days ago) Jun 27
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Alex Gough, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang added 2 comments

          File services/webnn/public/mojom/webnn_graph.mojom
          Line 798, Patchset 21 (Latest): // Specifies the name for the operator.
          Phillis Tang . unresolved

          Update the comment to "User defined label from `MLOperatorOptions`"

          Alex Gough . unresolved

          if the gpu side /needs/ to have an identifier that makes sense in the renderer then this could instead be a uint64 label_id and the labels live in the renderer all the time?

          Phillis Tang

          it's less as an identifier(doesn't need to be unique) but a descriptor to be attached to error message.

          Alex Gough

          are there other cases where we provide this level of detail back to the renderer from a backend process? It feels somewhat wasteful to send strings around only in case they are needed for error reporting

          Phillis Tang

          the concept is borrowed from webgpu(consulted with their team), and the problem we are trying to solve is that it's very hard for developers to debug async errors coming back from the backend process during graph compilation/execution, so having user defined labels are very helpful to decipher errors from a complex graph.

          Alex Gough

          thanks - perhaps this can be called 'debug_label' to make its purpose clearer?

          Phillis Tang

          seems fine, although would it be confusing to have the mojo name different from the idl? (the comment should be updated to clarify though)

          For the idl I'd prefer `label` as that's a [concept](https://www.w3.org/TR/webgpu/#dom-gpuobjectbase-label) develoeprs already familiar with from WebGPU.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Gough
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • ningxin hu
          Gerrit-Attention: Alex Gough <aj...@chromium.org>
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 00:17:00 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Alex Gough (Gerrit)

          unread,
          Jun 27, 2024, 8:28:11 PM (2 days ago) Jun 27
          to Lisha Guo, Phillis Tang, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Alex Gough added 2 comments

          File services/webnn/public/cpp/webnn_errors.cc
          Line 87, Patchset 21 (Latest): return base::StrCat({"[", label.value(), "] "});
          Alex Gough . unresolved

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?

          File services/webnn/public/mojom/webnn_graph.mojom
          Alex Gough . resolved

          if the gpu side /needs/ to have an identifier that makes sense in the renderer then this could instead be a uint64 label_id and the labels live in the renderer all the time?

          Phillis Tang

          it's less as an identifier(doesn't need to be unique) but a descriptor to be attached to error message.

          Alex Gough

          are there other cases where we provide this level of detail back to the renderer from a backend process? It feels somewhat wasteful to send strings around only in case they are needed for error reporting

          Phillis Tang

          the concept is borrowed from webgpu(consulted with their team), and the problem we are trying to solve is that it's very hard for developers to debug async errors coming back from the backend process during graph compilation/execution, so having user defined labels are very helpful to decipher errors from a complex graph.

          Alex Gough

          thanks - perhaps this can be called 'debug_label' to make its purpose clearer?

          Phillis Tang

          seems fine, although would it be confusing to have the mojo name different from the idl? (the comment should be updated to clarify though)

          For the idl I'd prefer `label` as that's a [concept](https://www.w3.org/TR/webgpu/#dom-gpuobjectbase-label) develoeprs already familiar with from WebGPU.

          Alex Gough

          `label` is ok if it matches the idl - thanks for the gpu example.

          Open in Gerrit

          Related details

          Attention is currently required from:
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 00:27:57 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 27, 2024, 8:58:41 PM (2 days ago) Jun 27
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Alex Gough, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang added 2 comments

          File services/webnn/public/cpp/webnn_errors.cc
          Line 87, Patchset 21 (Latest): return base::StrCat({"[", label.value(), "] "});
          Alex Gough . unresolved

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?

          Phillis Tang

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?

          Seems irrelevant to me. If develoeprs label them "[[[" they will just get a less helpful error message.

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?

          Do you have a case in mind that's unsafe?

          File services/webnn/public/mojom/webnn_graph.mojom
          Line 800, Patchset 21 (Latest):};
          Phillis Tang . unresolved

          thinking more about it. I think passing empty string should be treated the same as not passing label. So how about making it not optional in mojom. So that in third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc , if it's null we just set it to empty string?


          Then we can replace all the chunky `const std::optional<std::string>&` with `std::string_view`.
          ```
          std::string GetLabelErrorSuffix(string_view label) {
          if (label.empty()) {
          return "";
          }
          return base::StrCat({"[", label, "] "});
          ```
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Gough
          Gerrit-Attention: Alex Gough <aj...@chromium.org>
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 00:58:30 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Alex Gough (Gerrit)

          unread,
          Jun 27, 2024, 9:18:45 PM (2 days ago) Jun 27
          to Lisha Guo, Phillis Tang, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu, Phillis Tang and ningxin hu

          Alex Gough added 1 comment

          File services/webnn/public/cpp/webnn_errors.cc
          Line 87, Patchset 21 (Latest): return base::StrCat({"[", label.value(), "] "});
          Alex Gough . unresolved

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?

          Phillis Tang

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?
          Seems irrelevant to me. If develoeprs label them "[[[" they will just get a less helpful error message.

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?
          Do you have a case in mind that's unsafe?

          Alex Gough

          I guess I don't just mean here - will these error strings be interpreted somewhere later - are there any constraints that the labels should meet?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • Phillis Tang
          • ningxin hu
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Phillis Tang <phi...@chromium.org>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 01:18:30 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Alex Gough <aj...@chromium.org>
          Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Lisha Guo (Gerrit)

          unread,
          Jun 27, 2024, 9:40:44 PM (2 days ago) Jun 27
          to Phillis Tang, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Mingming1 Xu, Phillis Tang and ningxin hu

          Lisha Guo added 1 comment

          File services/webnn/public/cpp/graph_validation_utils.h
          Line 457, Patchset 21 (Latest): const std::optional<std::string>& label = std::nullopt);
          Phillis Tang . unresolved

          let's remove the default std::nullopt and always require this param.

          Lisha Guo
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Kinuko Yasuda
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 01:40:31 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 27, 2024, 9:44:12 PM (2 days ago) Jun 27
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang voted and added 1 comment

          Votes added by Phillis Tang

          Code-Review+0

          1 comment

          File services/webnn/public/cpp/graph_validation_utils.h
          Line 457, Patchset 21 (Latest): const std::optional<std::string>& label = std::nullopt);
          Phillis Tang . unresolved

          let's remove the default std::nullopt and always require this param.

          Lisha Guo

          Setting the default std::nullopt because this validate method is also invoked by webnn_graph_impl.cc- https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/webnn_graph_impl.cc?q=ValidateResample2dAndInferOutput&ss=chromium%2Fchromium%2Fsrc.

          Phillis Tang

          the webnn_graph_impl should also pass label?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • ningxin hu
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 01:44:01 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 28, 2024, 1:58:01 PM (yesterday) Jun 28
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Alex Gough, Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang added 1 comment

          File services/webnn/public/cpp/webnn_errors.cc
          Line 87, Patchset 21 (Latest): return base::StrCat({"[", label.value(), "] "});
          Alex Gough . unresolved

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?

          Phillis Tang

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?
          Seems irrelevant to me. If develoeprs label them "[[[" they will just get a less helpful error message.

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?
          Do you have a case in mind that's unsafe?

          Alex Gough

          I guess I don't just mean here - will these error strings be interpreted somewhere later - are there any constraints that the labels should meet?

          Phillis Tang

          It should be mostly used by reporting error using this helper method.
          Another place it's used right now is as [directml operator name](https://chromium-review.googlesource.com/c/chromium/src/+/5528797/21/services/webnn/dml/graph_builder_dml.cc#112) that's also used for debugging purpose.


          As for constraints, after some reading, it seems we should switch to USVString for the idl, so it's safe to utf8 encode and pass to backends. @lish...@intel.com

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Gough
          Gerrit-Attention: Alex Gough <aj...@chromium.org>
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 17:57:46 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Alex Gough (Gerrit)

          unread,
          Jun 28, 2024, 2:05:18 PM (yesterday) Jun 28
          to Lisha Guo, Alex Gough, Phillis Tang, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu, Phillis Tang and ningxin hu

          Alex Gough voted and added 2 comments

          Votes added by Alex Gough

          Code-Review+1

          2 comments

          Patchset-level comments
          Alex Gough . resolved

          lgtm mojom

          File services/webnn/public/cpp/webnn_errors.cc
          Line 87, Patchset 21 (Latest): return base::StrCat({"[", label.value(), "] "});
          Alex Gough . unresolved

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?

          Phillis Tang

          would it be good/bad/irrelevant if label is something like "[[[[[" or "]]]]]" ?
          Seems irrelevant to me. If develoeprs label them "[[[" they will just get a less helpful error message.

          Is it safe to generate error strings using renderer supplied values, or should the label and error message be rejoined in the renderer?
          Do you have a case in mind that's unsafe?

          Alex Gough

          I guess I don't just mean here - will these error strings be interpreted somewhere later - are there any constraints that the labels should meet?

          Phillis Tang

          It should be mostly used by reporting error using this helper method.
          Another place it's used right now is as [directml operator name](https://chromium-review.googlesource.com/c/chromium/src/+/5528797/21/services/webnn/dml/graph_builder_dml.cc#112) that's also used for debugging purpose.


          As for constraints, after some reading, it seems we should switch to USVString for the idl, so it's safe to utf8 encode and pass to backends. @lish...@intel.com

          Alex Gough

          great - thanks for digging in to it

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • Phillis Tang
          • ningxin hu
          Gerrit-Attention: Kinuko Yasuda <kin...@chromium.org>
          Gerrit-Attention: ningxin hu <ningx...@intel.com>
          Gerrit-Attention: Phillis Tang <phi...@chromium.org>
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 18:05:04 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 28, 2024, 2:09:29 PM (yesterday) Jun 28
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang added 1 comment

          File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
          Line 22, Patchset 21 (Latest): DOMString label;
          Phillis Tang . unresolved

          let's switch to USVString instead so it's safe to utf8 encode and pass to backends.

          (I will open an issue for operand name too)

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Kinuko Yasuda
          • Lisha Guo
          • Mingming1 Xu
          • ningxin hu
          Gerrit-Attention: Lisha Guo <lish...@intel.com>
          Gerrit-Attention: Mingming1 Xu <mingmi...@intel.com>
          Gerrit-Comment-Date: Fri, 28 Jun 2024 18:09:12 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Phillis Tang (Gerrit)

          unread,
          Jun 28, 2024, 2:15:47 PM (yesterday) Jun 28
          to Lisha Guo, Alex Gough, Chromium LUCI CQ, ningxin hu, Chromium IPC Reviews, Kinuko Yasuda, Shiyi Zou, Dwayne Robinson, Mingming1 Xu, Kentaro Hara, AyeAye, chromium...@chromium.org, Jiewei Qian, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org, ipc-securi...@chromium.org, jmedle...@chromium.org
          Attention needed from Kinuko Yasuda, Lisha Guo, Mingming1 Xu and ningxin hu

          Phillis Tang added 1 comment

          File third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
          Phillis Tang . unresolved

          let's switch to USVString instead so it's safe to utf8 encode and pass to backends.

          (I will open an issue for operand name too)

          Gerrit-Comment-Date: Fri, 28 Jun 2024 18:15:35 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Phillis Tang <phi...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages