webnn: avoid executing alpha * A * B when gemma.alpha is 0 for TFLite backend [chromium/src : main]

0 views
Skip to first unread message

lisha guo (Gerrit)

unread,
Jan 28, 2026, 12:42:41 AMJan 28
to Jiewei Qian, Hu, Ningxin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from lisha guo

Message from lisha guo

Set Ready For Review

Open in Gerrit

Related details

Attention is currently required from:
  • lisha guo
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
Gerrit-Change-Number: 7509907
Gerrit-PatchSet: 3
Gerrit-Owner: lisha guo <guol...@kylinos.cn>
Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-Attention: lisha guo <guol...@kylinos.cn>
Gerrit-Comment-Date: Wed, 28 Jan 2026 05:42:12 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

lisha guo (Gerrit)

unread,
Jan 28, 2026, 9:29:53 PMJan 28
to Fu, Junwei, Jiewei Qian, Hu, Ningxin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

lisha guo added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
Gerrit-Change-Number: 7509907
Gerrit-PatchSet: 5
Gerrit-Owner: lisha guo <guol...@kylinos.cn>
Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-Comment-Date: Thu, 29 Jan 2026 02:29:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

lisha guo (Gerrit)

unread,
Jan 28, 2026, 9:58:06 PMJan 28
to Dai, Feng, Fu, Junwei, Jiewei Qian, Hu, Ningxin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Fu, Junwei

lisha guo added 1 comment

Patchset-level comments
lisha guo . resolved

@feng...@intel.com Please help to review WPT. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Fu, Junwei
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
Gerrit-Change-Number: 7509907
Gerrit-PatchSet: 5
Gerrit-Owner: lisha guo <guol...@kylinos.cn>
Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
Gerrit-CC: Dai, Feng <feng...@intel.com>
Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-Attention: Fu, Junwei <junw...@intel.com>
Gerrit-Comment-Date: Thu, 29 Jan 2026 02:57:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dai, Feng (Gerrit)

unread,
Jan 28, 2026, 10:56:26 PMJan 28
to lisha guo, Fu, Junwei, Jiewei Qian, Hu, Ningxin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Fu, Junwei and lisha guo

Dai, Feng added 1 comment

Patchset-level comments
lisha guo . resolved

@feng...@intel.com Please help to review WPT. Thanks!

Dai, Feng

Thanks Lisha!👍
LGTM!

Open in Gerrit

Related details

Attention is currently required from:
  • Fu, Junwei
  • lisha guo
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
Gerrit-Change-Number: 7509907
Gerrit-PatchSet: 7
Gerrit-Owner: lisha guo <guol...@kylinos.cn>
Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
Gerrit-CC: Dai, Feng <feng...@intel.com>
Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-Attention: lisha guo <guol...@kylinos.cn>
Gerrit-Attention: Fu, Junwei <junw...@intel.com>
Gerrit-Comment-Date: Thu, 29 Jan 2026 03:56:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: lisha guo <guol...@kylinos.cn>
satisfied_requirement
unsatisfied_requirement
open
diffy

Fu, Junwei (Gerrit)

unread,
Jan 29, 2026, 12:57:57 AMJan 29
to lisha guo, Dai, Feng, Jiewei Qian, Hu, Ningxin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from lisha guo

Fu, Junwei added 2 comments

File services/webnn/tflite/graph_builder_tflite.cc
Line 5051, Patchset 8: if (gemm.c_operand_id && gemm.beta != 0.0f) {
Fu, Junwei . unresolved

Can we refine `SerializeLinearOperation` to avoid mul operation, that can be reused here and L.5105.

Line 5068, Patchset 8: return SerializeBinaryOperation(::tflite::BuiltinOperator_ADD,
Fu, Junwei . unresolved

Maybe `BROADCAST_TO` operator that fills the output with zeros better than add operation.

Open in Gerrit

Related details

Attention is currently required from:
  • lisha guo
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 8
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: lisha guo <guol...@kylinos.cn>
    Gerrit-Comment-Date: Thu, 29 Jan 2026 05:57:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    lisha guo (Gerrit)

    unread,
    Jan 29, 2026, 2:12:58 AMJan 29
    to Dai, Feng, Fu, Junwei, Jiewei Qian, Hu, Ningxin, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei

    lisha guo added 3 comments

    Patchset-level comments
    File-level comment, Patchset 11 (Latest):
    lisha guo . resolved

    Uploaded PS11 to address the comments. Please take another look. Thanks!

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 5051, Patchset 8: if (gemm.c_operand_id && gemm.beta != 0.0f) {
    Fu, Junwei . unresolved

    Can we refine `SerializeLinearOperation` to avoid mul operation, that can be reused here and L.5105.

    lisha guo

    Good suggestion! Refined `SerializeLinearOperation` in latest PS11.

    Line 5068, Patchset 8: return SerializeBinaryOperation(::tflite::BuiltinOperator_ADD,
    Fu, Junwei . unresolved

    Maybe `BROADCAST_TO` operator that fills the output with zeros better than add operation.

    lisha guo

    Added a new method `SerializeBroadcastToOperation` to use `BROADCAST_TO`. Meanwhile, Refactor the `SerializeExpand` function to reuse the `SerializeBroadcastToOperation` function.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 11
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Hu, Ningxin <ningx...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Comment-Date: Thu, 29 Jan 2026 07:12:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Fu, Junwei <junw...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    lisha guo (Gerrit)

    unread,
    Jan 29, 2026, 9:37:12 PMJan 29
    to Hu, Ningxin, Dai, Feng, Fu, Junwei, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei and Hu, Ningxin

    lisha guo added 1 comment

    Patchset-level comments
    lisha guo . resolved

    PTAL.Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • Hu, Ningxin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 11
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Fri, 30 Jan 2026 02:36:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hu, Ningxin (Gerrit)

    unread,
    Jan 30, 2026, 1:50:04 AMJan 30
    to lisha guo, Dai, Feng, Fu, Junwei, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei and lisha guo

    Hu, Ningxin added 10 comments

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 3270, Patchset 11 (Latest): ASSIGN_OR_RETURN(const TensorIndex constant_tensor_index,
    Hu, Ningxin . unresolved
    Nit: keep naming consistent
    ```suggestion
    ASSIGN_OR_RETURN(const TensorIndex beta_tensor_index,
    ```
    Line 3279, Patchset 11 (Latest): return SerializeBroadcastToOperation(input_tensor_index, input_dimensions,
    output_tensor_index);
    Hu, Ningxin . unresolved

    Broadcasting seems to be unnecessary, using Identity instead?

    Line 3269, Patchset 11 (Latest): if (alpha == 0.0f) {
    ASSIGN_OR_RETURN(const TensorIndex constant_tensor_index,
    SerializeTensorWithBuffer<float>(
    /*buffer=*/std::array<float, 1>{beta},
    /*dimensions=*/{}));
    return SerializeBroadcastToOperation(constant_tensor_index,
    input_dimensions, output_tensor_index);
    }
    if (alpha == 1.0f) {
    if (beta == 0.0f) {
    return SerializeBroadcastToOperation(input_tensor_index, input_dimensions,
    output_tensor_index);
    }
    ASSIGN_OR_RETURN(const TensorIndex beta_tensor_index,
    SerializeTensorWithBuffer<float>(
    /*buffer=*/std::array<float, 1>{beta},
    /*dimensions=*/{}));
    return SerializeBinaryOperation(::tflite::BuiltinOperator_ADD,
    input_tensor_index, beta_tensor_index,
    output_tensor_index);
    }
    if (beta == 0.0f) {
    ASSIGN_OR_RETURN(const TensorIndex alpha_tensor_index,
    SerializeTensorWithBuffer<float>(
    /*buffer=*/std::array<float, 1>{alpha},
    /*dimensions=*/{}));
    return SerializeBinaryOperation(::tflite::BuiltinOperator_MUL,
    input_tensor_index, alpha_tensor_index,
    output_tensor_index);
    }
    Hu, Ningxin . unresolved

    I feel the optimization of linear operator could be in a separate CL.

    Line 5051, Patchset 8: if (gemm.c_operand_id && gemm.beta != 0.0f) {
    Fu, Junwei . unresolved

    Can we refine `SerializeLinearOperation` to avoid mul operation, that can be reused here and L.5105.

    lisha guo

    Good suggestion! Refined `SerializeLinearOperation` in latest PS11.

    Hu, Ningxin

    I don't see much benefit by using Linear operator here, because when calling Linear(input, alpha, 0), it is just a Mul operator? Or did I miss anything?

    Line 5068, Patchset 8: return SerializeBinaryOperation(::tflite::BuiltinOperator_ADD,
    Fu, Junwei . unresolved

    Maybe `BROADCAST_TO` operator that fills the output with zeros better than add operation.

    lisha guo

    Added a new method `SerializeBroadcastToOperation` to use `BROADCAST_TO`. Meanwhile, Refactor the `SerializeExpand` function to reuse the `SerializeBroadcastToOperation` function.

    Hu, Ningxin

    Consider using Broadcast(C, output_dimensions) instead?

    Line 5071, Patchset 11 (Latest): output_tensor_type = quantized_output->data_type;
    Hu, Ningxin . unresolved

    Was this case missed before? Do we have test coverage for it? @junw...@intel.com @feng...@intel.com

    Line 5083, Patchset 11 (Latest): // When alpha is 0, the alpha * A * B term is 0, so skip the matrix
    // multiplication computation.
    Hu, Ningxin . unresolved

    This comment seems to be duplicate with the previous one?

    Line 5090, Patchset 11 (Latest): // If there's a C term (beta * C), we need to add it to the zero tensor.
    Hu, Ningxin . unresolved

    This comment is confusing, the latest code doesn't add it to the zero tensor. The following condition statement is clear, consider removing this comment.

    Line 5096, Patchset 11 (Latest): return SerializeLinearOperation(
    c_tensor_info->dimensions, c_tensor_info->data_type,
    c_tensor_info->index, output_tensor_index, gemm.beta, 0.0f);
    Hu, Ningxin . unresolved

    If C is a scalar, you may want to broadcast the result of `beta * C` to 2D. Do we have a test case covering it?

    Line 5136, Patchset 11 (Latest): ASSIGN_OR_RETURN(const OperatorOffset op_offset,
    SerializeLinearOperation(
    c_tensor_info->dimensions, c_tensor_info->data_type,
    c_tensor_info->index, output_tensor_index_of_beta_c,
    gemm.beta, 0.0f));
    Hu, Ningxin . unresolved

    The previous code using Mul operator seems more straightforward? What's the benefit of using Linear operator?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • lisha guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 11
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: lisha guo <guol...@kylinos.cn>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Comment-Date: Fri, 30 Jan 2026 06:49:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: lisha guo <guol...@kylinos.cn>
    Comment-In-Reply-To: Fu, Junwei <junw...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    lisha guo (Gerrit)

    unread,
    Jan 30, 2026, 4:13:07 AMJan 30
    to Hu, Ningxin, Dai, Feng, Fu, Junwei, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei and Hu, Ningxin

    lisha guo added 10 comments

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    lisha guo . resolved

    Uploaded PS12 to address the comments. Please take another look. Thanks! @ningx...@intel.com

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 3270, Patchset 11: ASSIGN_OR_RETURN(const TensorIndex constant_tensor_index,
    Hu, Ningxin . resolved
    Nit: keep naming consistent
    ```suggestion
    ASSIGN_OR_RETURN(const TensorIndex beta_tensor_index,
    ```
    lisha guo

    Done

    Line 3279, Patchset 11: return SerializeBroadcastToOperation(input_tensor_index, input_dimensions,
    output_tensor_index);
    Hu, Ningxin . resolved

    Broadcasting seems to be unnecessary, using Identity instead?

    lisha guo

    Done

    Line 3269, Patchset 11: if (alpha == 0.0f) {
    lisha guo

    Agree. I will create another CL to optimize of linear operator separately.

    Line 5051, Patchset 8: if (gemm.c_operand_id && gemm.beta != 0.0f) {
    Fu, Junwei . resolved

    Can we refine `SerializeLinearOperation` to avoid mul operation, that can be reused here and L.5105.

    lisha guo

    Good suggestion! Refined `SerializeLinearOperation` in latest PS11.

    Hu, Ningxin

    I don't see much benefit by using Linear operator here, because when calling Linear(input, alpha, 0), it is just a Mul operator? Or did I miss anything?

    lisha guo

    Done

    Line 5068, Patchset 8: return SerializeBinaryOperation(::tflite::BuiltinOperator_ADD,
    Fu, Junwei . resolved

    Maybe `BROADCAST_TO` operator that fills the output with zeros better than add operation.

    lisha guo

    Added a new method `SerializeBroadcastToOperation` to use `BROADCAST_TO`. Meanwhile, Refactor the `SerializeExpand` function to reuse the `SerializeBroadcastToOperation` function.

    Hu, Ningxin

    Consider using Broadcast(C, output_dimensions) instead?

    lisha guo

    Done

    Line 5083, Patchset 11: // When alpha is 0, the alpha * A * B term is 0, so skip the matrix
    // multiplication computation.
    Hu, Ningxin . resolved

    This comment seems to be duplicate with the previous one?

    lisha guo

    Done

    Line 5090, Patchset 11: // If there's a C term (beta * C), we need to add it to the zero tensor.
    Hu, Ningxin . resolved

    This comment is confusing, the latest code doesn't add it to the zero tensor. The following condition statement is clear, consider removing this comment.

    lisha guo

    Done

    Line 5096, Patchset 11: return SerializeLinearOperation(

    c_tensor_info->dimensions, c_tensor_info->data_type,
    c_tensor_info->index, output_tensor_index, gemm.beta, 0.0f);
    Hu, Ningxin . resolved

    If C is a scalar, you may want to broadcast the result of `beta * C` to 2D. Do we have a test case covering it?

    lisha guo

    Added another two test cases to cover scalar C and 1D C.

    Line 5136, Patchset 11: ASSIGN_OR_RETURN(const OperatorOffset op_offset,

    SerializeLinearOperation(
    c_tensor_info->dimensions, c_tensor_info->data_type,
    c_tensor_info->index, output_tensor_index_of_beta_c,
    gemm.beta, 0.0f));
    Hu, Ningxin . resolved

    The previous code using Mul operator seems more straightforward? What's the benefit of using Linear operator?

    lisha guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • Hu, Ningxin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 12
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Fri, 30 Jan 2026 09:12:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: lisha guo <guol...@kylinos.cn>
    Comment-In-Reply-To: Fu, Junwei <junw...@intel.com>
    Comment-In-Reply-To: Hu, Ningxin <ningx...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fu, Junwei (Gerrit)

    unread,
    Feb 2, 2026, 1:41:30 AMFeb 2
    to lisha guo, Hu, Ningxin, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Hu, Ningxin and lisha guo

    Fu, Junwei added 2 comments

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 5027, Patchset 14 (Latest): ASSIGN_OR_RETURN(c_tensor_info, SerializeInputTensorInfo(
    Fu, Junwei . unresolved

    Move `beta * c` expression here, and define variable `std::optional<TensorIndex> c_expression_index` that can be used in L.5057 and L.5106

    Line 5071, Patchset 11: output_tensor_type = quantized_output->data_type;
    Hu, Ningxin . unresolved

    Was this case missed before? Do we have test coverage for it? @junw...@intel.com @feng...@intel.com

    Fu, Junwei

    `output_tensor_dimensions` and `output_tensor_type` are used when [is_emulated_c_expression](https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/tflite/graph_builder_tflite.cc;l=5081?q=GraphBuilderTflite::SerializeGemm&ss=chromium%2Fchromium%2Fsrc) is true, please removed the definition of them and use `output_tensor_info.dimensions` and `output_tensor_info.data_type` directly.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hu, Ningxin
    • lisha guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 14
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: lisha guo <guol...@kylinos.cn>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Mon, 02 Feb 2026 06:41:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Hu, Ningxin <ningx...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    lisha guo (Gerrit)

    unread,
    Feb 2, 2026, 2:53:33 AMFeb 2
    to Hu, Ningxin, Dai, Feng, Fu, Junwei, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei and Hu, Ningxin

    lisha guo added 3 comments

    Patchset-level comments
    File-level comment, Patchset 15 (Latest):
    lisha guo . resolved

    @junw...@intel.com Uploaded PS15 to address the comments. Please take another look. Thanks!

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 5027, Patchset 14: ASSIGN_OR_RETURN(c_tensor_info, SerializeInputTensorInfo(
    Fu, Junwei . unresolved

    Move `beta * c` expression here, and define variable `std::optional<TensorIndex> c_expression_index` that can be used in L.5057 and L.5106

    lisha guo

    Sounds good. Moved `beta * c` here in PS15.

    Line 5071, Patchset 11: output_tensor_type = quantized_output->data_type;
    Hu, Ningxin . unresolved

    Was this case missed before? Do we have test coverage for it? @junw...@intel.com @feng...@intel.com

    Fu, Junwei

    `output_tensor_dimensions` and `output_tensor_type` are used when [is_emulated_c_expression](https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/tflite/graph_builder_tflite.cc;l=5081?q=GraphBuilderTflite::SerializeGemm&ss=chromium%2Fchromium%2Fsrc) is true, please removed the definition of them and use `output_tensor_info.dimensions` and `output_tensor_info.data_type` directly.

    lisha guo

    Removed these two line:
    ```
    output_tensor_dimensions = quantized_output->dimensions;
    output_tensor_type = quantized_output->data_type;
    ```

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • Hu, Ningxin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 15
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Mon, 02 Feb 2026 07:53:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fu, Junwei (Gerrit)

    unread,
    Feb 2, 2026, 8:02:27 PMFeb 2
    to lisha guo, Hu, Ningxin, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Hu, Ningxin and lisha guo

    Fu, Junwei voted and added 3 comments

    Votes added by Fu, Junwei

    Code-Review+1

    3 comments

    Patchset-level comments
    File services/webnn/tflite/graph_builder_tflite.cc
    Line 5027, Patchset 14: ASSIGN_OR_RETURN(c_tensor_info, SerializeInputTensorInfo(
    Fu, Junwei . resolved

    Move `beta * c` expression here, and define variable `std::optional<TensorIndex> c_expression_index` that can be used in L.5057 and L.5106

    lisha guo

    Sounds good. Moved `beta * c` here in PS15.

    Fu, Junwei

    Done

    Line 5106, Patchset 16 (Latest): if (c_expression_index) {
    Fu, Junwei . unresolved

    nit: `if (c_expression_index && !is_emulated_c_expression)`

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hu, Ningxin
    • lisha guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 16
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: lisha guo <guol...@kylinos.cn>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Tue, 03 Feb 2026 01:02:17 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fu, Junwei (Gerrit)

    unread,
    Feb 2, 2026, 8:06:20 PMFeb 2
    to lisha guo, Hu, Ningxin, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Hu, Ningxin and lisha guo

    Fu, Junwei added 1 comment

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 5026, Patchset 16 (Latest): if (gemm.c_operand_id) {
    Fu, Junwei . unresolved

    Move L.5033 here. `if (gemm.c_operand_id && gemm.beta != 0.0f)`

    Gerrit-Comment-Date: Tue, 03 Feb 2026 01:06:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    lisha guo (Gerrit)

    unread,
    Feb 2, 2026, 8:18:39 PMFeb 2
    to Fu, Junwei, Hu, Ningxin, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei and Hu, Ningxin

    lisha guo added 3 comments

    Patchset-level comments
    File-level comment, Patchset 18 (Latest):
    lisha guo . resolved

    Uploaded PS18 to fix these two nits. `+1` lost due to uploading new CL. Please take another look. @junw...@intel.com

    File services/webnn/tflite/graph_builder_tflite.cc
    Line 5026, Patchset 16: if (gemm.c_operand_id) {
    Fu, Junwei . resolved

    Move L.5033 here. `if (gemm.c_operand_id && gemm.beta != 0.0f)`

    lisha guo

    Done

    Line 5106, Patchset 16: if (c_expression_index) {
    Fu, Junwei . resolved

    nit: `if (c_expression_index && !is_emulated_c_expression)`

    lisha guo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • Hu, Ningxin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 18
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Tue, 03 Feb 2026 01:18:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Fu, Junwei <junw...@intel.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Junwei (Gerrit)

    unread,
    Feb 2, 2026, 8:22:37 PMFeb 2
    to lisha guo, Fu, Junwei, Hu, Ningxin, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei, Hu, Ningxin and lisha guo

    Junwei added 1 comment

    Patchset-level comments
    Junwei . resolved

    LGTM.
    @ningx...@intel.com PTAL.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • Hu, Ningxin
    • lisha guo
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 18
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei <fujunw...@gmail.com>
    Gerrit-Attention: lisha guo <guol...@kylinos.cn>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Tue, 03 Feb 2026 01:22:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    lisha guo (Gerrit)

    unread,
    Feb 3, 2026, 8:03:55 PMFeb 3
    to Junwei, Fu, Junwei, Hu, Ningxin, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei and Hu, Ningxin

    lisha guo added 1 comment

    Patchset-level comments
    lisha guo . resolved

    Soft ping @ningx...@intel.com. Please take another look. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • Hu, Ningxin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
    Gerrit-Change-Number: 7509907
    Gerrit-PatchSet: 18
    Gerrit-Owner: lisha guo <guol...@kylinos.cn>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
    Gerrit-CC: Dai, Feng <feng...@intel.com>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-CC: Junwei <fujunw...@gmail.com>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Wed, 04 Feb 2026 01:03:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Hu, Ningxin (Gerrit)

    unread,
    Feb 3, 2026, 8:26:29 PMFeb 3
    to lisha guo, Junwei, Fu, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fu, Junwei and lisha guo

    Hu, Ningxin added 3 comments

    Patchset-level comments
    Hu, Ningxin . resolved

    Looks good, thanks @guol...@kylinos.cn! We plan to only land critical issue fix before 146 branch cut (Feb 9th). Could we hold this CL landing after that?

    File services/webnn/tflite/graph_builder_tflite.cc
    Hu, Ningxin . resolved

    I feel the optimization of linear operator could be in a separate CL.

    lisha guo

    Agree. I will create another CL to optimize of linear operator separately.

    Hu, Ningxin

    Acknowledged

    Line 5071, Patchset 11: output_tensor_type = quantized_output->data_type;
    Hu, Ningxin . resolved

    Was this case missed before? Do we have test coverage for it? @junw...@intel.com @feng...@intel.com

    Fu, Junwei

    `output_tensor_dimensions` and `output_tensor_type` are used when [is_emulated_c_expression](https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/tflite/graph_builder_tflite.cc;l=5081?q=GraphBuilderTflite::SerializeGemm&ss=chromium%2Fchromium%2Fsrc) is true, please removed the definition of them and use `output_tensor_info.dimensions` and `output_tensor_info.data_type` directly.

    lisha guo

    Removed these two line:
    ```
    output_tensor_dimensions = quantized_output->dimensions;
    output_tensor_type = quantized_output->data_type;
    ```

    Hu, Ningxin

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fu, Junwei
    • lisha guo
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
      Gerrit-Change-Number: 7509907
      Gerrit-PatchSet: 18
      Gerrit-Owner: lisha guo <guol...@kylinos.cn>
      Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
      Gerrit-CC: Dai, Feng <feng...@intel.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Junwei <fujunw...@gmail.com>
      Gerrit-Attention: lisha guo <guol...@kylinos.cn>
      Gerrit-Attention: Fu, Junwei <junw...@intel.com>
      Gerrit-Comment-Date: Wed, 04 Feb 2026 01:26:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: lisha guo <guol...@kylinos.cn>
      Comment-In-Reply-To: Fu, Junwei <junw...@intel.com>
      Comment-In-Reply-To: Hu, Ningxin <ningx...@intel.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      lisha guo (Gerrit)

      unread,
      Feb 3, 2026, 8:39:24 PMFeb 3
      to Junwei, Fu, Junwei, Hu, Ningxin, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from Fu, Junwei and Hu, Ningxin

      lisha guo added 1 comment

      Patchset-level comments
      Hu, Ningxin . resolved

      Looks good, thanks @guol...@kylinos.cn! We plan to only land critical issue fix before 146 branch cut (Feb 9th). Could we hold this CL landing after that?

      lisha guo

      Sure. Please holding as your plan. Wishing you everything goes smoothly!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fu, Junwei
      • Hu, Ningxin
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
      Gerrit-Change-Number: 7509907
      Gerrit-PatchSet: 18
      Gerrit-Owner: lisha guo <guol...@kylinos.cn>
      Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
      Gerrit-CC: Dai, Feng <feng...@intel.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Junwei <fujunw...@gmail.com>
      Gerrit-Attention: Fu, Junwei <junw...@intel.com>
      Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Comment-Date: Wed, 04 Feb 2026 01:38:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Hu, Ningxin <ningx...@intel.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Hu, Ningxin (Gerrit)

      unread,
      Feb 23, 2026, 8:44:32 PM (4 days ago) Feb 23
      to lisha guo, Junwei, Fu, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from Fu, Junwei and lisha guo

      Hu, Ningxin voted and added 1 comment

      Votes added by Hu, Ningxin

      Code-Review+1

      1 comment

      Patchset-level comments
      Hu, Ningxin . resolved

      LGTM

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fu, Junwei
      • lisha guo
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
      Gerrit-Change-Number: 7509907
      Gerrit-PatchSet: 18
      Gerrit-Owner: lisha guo <guol...@kylinos.cn>
      Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
      Gerrit-CC: Dai, Feng <feng...@intel.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Junwei <fujunw...@gmail.com>
      Gerrit-Attention: lisha guo <guol...@kylinos.cn>
      Gerrit-Attention: Fu, Junwei <junw...@intel.com>
      Gerrit-Comment-Date: Tue, 24 Feb 2026 01:44:27 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      lisha guo (Gerrit)

      unread,
      Feb 25, 2026, 8:15:44 PM (2 days ago) Feb 25
      to Reilly Grant, Hu, Ningxin, Junwei, Fu, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from Fu, Junwei

      lisha guo added 1 comment

      Patchset-level comments
      lisha guo . resolved

      @rei...@chromium.org PTAL. Thanks!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fu, Junwei
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
      Gerrit-Change-Number: 7509907
      Gerrit-PatchSet: 18
      Gerrit-Owner: lisha guo <guol...@kylinos.cn>
      Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
      Gerrit-CC: Dai, Feng <feng...@intel.com>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-CC: Junwei <fujunw...@gmail.com>
      Gerrit-CC: Reilly Grant <rei...@chromium.org>
      Gerrit-Attention: Fu, Junwei <junw...@intel.com>
      Gerrit-Comment-Date: Thu, 26 Feb 2026 01:15:21 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Reilly Grant (Gerrit)

      unread,
      Feb 25, 2026, 9:07:46 PM (2 days ago) Feb 25
      to lisha guo, Reilly Grant, Hu, Ningxin, Junwei, Fu, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from Fu, Junwei and lisha guo

      Reilly Grant added 3 comments

      File services/webnn/tflite/graph_builder_tflite.cc
      Line 4999, Patchset 18 (Latest): ASSIGN_OR_RETURN(const TensorInfo& a_tensor_info,
      SerializeInputTensorInfo(
      gemm.a_operand_id,
      /*quantize_params=*/0,
      /*operation_supports_float16=*/false, fuse_dequantize));
      TensorIndex a_tensor_index = a_tensor_info.index;
      // The permutation transpose first or second 2-D tensor.
      static constexpr std::array<uint32_t, 2> permutation = {1u, 0u};
      if (gemm.a_transpose) {
      ASSIGN_OR_RETURN(a_tensor_index,
      InsertTransposeOperation(a_tensor_info, permutation));
      }
      Reilly Grant . unresolved

      Move this down to where it is first needed so we don't serialize an unused tensor.

      Line 5018, Patchset 18 (Latest): ASSIGN_OR_RETURN(const TensorInfo& b_tensor_info,
      SerializeInputTensorInfo(
      gemm.b_operand_id,
      /*quantize_params=*/0,
      /*operation_supports_float16=*/false, fuse_dequantize));
      TensorIndex b_tensor_index = b_tensor_info.index;
      Reilly Grant . unresolved

      Move this down to where it is first needed so we don't serialize an unused tensor.

      Line 5066, Patchset 18 (Latest): ASSIGN_OR_RETURN(const TensorIndex zero_tensor_index,
      SerializeTensorWithBuffer<float>(
      /*buffer=*/std::array<float, 1>{0.0f},
      /*dimensions=*/{}));
      Reilly Grant . unresolved

      Move this after the check below so that we only serialize a zero tensor when we actually need it.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fu, Junwei
      • lisha guo
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
        Gerrit-Change-Number: 7509907
        Gerrit-PatchSet: 18
        Gerrit-Owner: lisha guo <guol...@kylinos.cn>
        Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
        Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
        Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
        Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
        Gerrit-CC: Dai, Feng <feng...@intel.com>
        Gerrit-CC: Jiewei Qian <q...@chromium.org>
        Gerrit-CC: Junwei <fujunw...@gmail.com>
        Gerrit-Attention: lisha guo <guol...@kylinos.cn>
        Gerrit-Attention: Fu, Junwei <junw...@intel.com>
        Gerrit-Comment-Date: Thu, 26 Feb 2026 02:07:40 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Fu, Junwei (Gerrit)

        unread,
        Feb 27, 2026, 9:57:40 PM (4 hours ago) Feb 27
        to lisha guo, Reilly Grant, Hu, Ningxin, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from lisha guo

        Fu, Junwei added 1 comment

        File services/webnn/tflite/graph_builder_tflite.cc
        Line 5018, Patchset 18: ASSIGN_OR_RETURN(const TensorInfo& b_tensor_info,

        SerializeInputTensorInfo(
        gemm.b_operand_id,
        /*quantize_params=*/0,
        /*operation_supports_float16=*/false, fuse_dequantize));
        TensorIndex b_tensor_index = b_tensor_info.index;
        Reilly Grant . unresolved

        Move this down to where it is first needed so we don't serialize an unused tensor.

        Fu, Junwei
        From Lisha’s patchset21, all operands must be serialized. If there is no this step:
        For input operands, a crash may occur at the [FinishAndTakeResult](https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/tflite/graph_builder_tflite.cc;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=2911) stage;
        ```
        auto get_name_and_index = [&](OperandId operand_id) {
        const TensorInfo& info = operand_to_tensor_info_map_.at(operand_id);
        ```
        For output operands, other operators in a graph may still reference this operand.
        @lisha please make sure the `C` operand also be serialized, thanks.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • lisha guo
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
        Gerrit-Change-Number: 7509907
        Gerrit-PatchSet: 21
        Gerrit-Owner: lisha guo <guol...@kylinos.cn>
        Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
        Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
        Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
        Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
        Gerrit-CC: Dai, Feng <feng...@intel.com>
        Gerrit-CC: Jiewei Qian <q...@chromium.org>
        Gerrit-CC: Junwei <fujunw...@gmail.com>
        Gerrit-Attention: lisha guo <guol...@kylinos.cn>
        Gerrit-Comment-Date: Sat, 28 Feb 2026 02:57:34 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Reilly Grant <rei...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Reilly Grant (Gerrit)

        unread,
        1:08 AM (1 hour ago) 1:08 AM
        to lisha guo, Fu, Junwei, Reilly Grant, Hu, Ningxin, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from lisha guo

        Reilly Grant added 1 comment

        File services/webnn/tflite/graph_builder_tflite.cc
        Line 5018, Patchset 18: ASSIGN_OR_RETURN(const TensorInfo& b_tensor_info,
        SerializeInputTensorInfo(
        gemm.b_operand_id,
        /*quantize_params=*/0,
        /*operation_supports_float16=*/false, fuse_dequantize));
        TensorIndex b_tensor_index = b_tensor_info.index;
        Reilly Grant . unresolved

        Move this down to where it is first needed so we don't serialize an unused tensor.

        Fu, Junwei
        From Lisha’s patchset21, all operands must be serialized. If there is no this step:
        For input operands, a crash may occur at the [FinishAndTakeResult](https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/tflite/graph_builder_tflite.cc;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=2911) stage;
        ```
        auto get_name_and_index = [&](OperandId operand_id) {
        const TensorInfo& info = operand_to_tensor_info_map_.at(operand_id);
        ```
        For output operands, other operators in a graph may still reference this operand.
        @lisha please make sure the `C` operand also be serialized, thanks.
        Reilly Grant

        Good catch. Make sure to serialize A, B and C early and add a one-line comment explaining why.

        Gerrit-Comment-Date: Sat, 28 Feb 2026 06:08:44 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Fu, Junwei <junw...@intel.com>
        Comment-In-Reply-To: Reilly Grant <rei...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Reilly Grant (Gerrit)

        unread,
        1:28 AM (1 hour ago) 1:28 AM
        to lisha guo, Reilly Grant, Fu, Junwei, Hu, Ningxin, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Fu, Junwei and lisha guo

        Reilly Grant voted and added 4 comments

        Votes added by Reilly Grant

        Code-Review+1

        4 comments

        Patchset-level comments
        File services/webnn/tflite/graph_builder_tflite.cc
        Line 4999, Patchset 18: ASSIGN_OR_RETURN(const TensorInfo& a_tensor_info,

        SerializeInputTensorInfo(
        gemm.a_operand_id,
        /*quantize_params=*/0,
        /*operation_supports_float16=*/false, fuse_dequantize));
        TensorIndex a_tensor_index = a_tensor_info.index;
        // The permutation transpose first or second 2-D tensor.
        static constexpr std::array<uint32_t, 2> permutation = {1u, 0u};
        if (gemm.a_transpose) {
        ASSIGN_OR_RETURN(a_tensor_index,
        InsertTransposeOperation(a_tensor_info, permutation));
        }
        Reilly Grant . resolved

        Move this down to where it is first needed so we don't serialize an unused tensor.

        Reilly Grant

        Acknowledged

        Line 5018, Patchset 18: ASSIGN_OR_RETURN(const TensorInfo& b_tensor_info,
        SerializeInputTensorInfo(
        gemm.b_operand_id,
        /*quantize_params=*/0,
        /*operation_supports_float16=*/false, fuse_dequantize));
        TensorIndex b_tensor_index = b_tensor_info.index;
        Reilly Grant . resolved

        Move this down to where it is first needed so we don't serialize an unused tensor.

        Fu, Junwei
        From Lisha’s patchset21, all operands must be serialized. If there is no this step:
        For input operands, a crash may occur at the [FinishAndTakeResult](https://source.chromium.org/chromium/chromium/src/+/main:services/webnn/tflite/graph_builder_tflite.cc;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=2911) stage;
        ```
        auto get_name_and_index = [&](OperandId operand_id) {
        const TensorInfo& info = operand_to_tensor_info_map_.at(operand_id);
        ```
        For output operands, other operators in a graph may still reference this operand.
        @lisha please make sure the `C` operand also be serialized, thanks.
        Reilly Grant

        Good catch. Make sure to serialize A, B and C early and add a one-line comment explaining why.

        Reilly Grant

        Acknowledged

        Line 5066, Patchset 18: ASSIGN_OR_RETURN(const TensorIndex zero_tensor_index,

        SerializeTensorWithBuffer<float>(
        /*buffer=*/std::array<float, 1>{0.0f},
        /*dimensions=*/{}));
        Reilly Grant . resolved

        Move this after the check below so that we only serialize a zero tensor when we actually need it.

        Reilly Grant

        Acknowledged

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Fu, Junwei
        • lisha guo
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
          Gerrit-Change-Number: 7509907
          Gerrit-PatchSet: 22
          Gerrit-Owner: lisha guo <guol...@kylinos.cn>
          Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
          Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
          Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
          Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
          Gerrit-CC: Dai, Feng <feng...@intel.com>
          Gerrit-CC: Jiewei Qian <q...@chromium.org>
          Gerrit-CC: Junwei <fujunw...@gmail.com>
          Gerrit-Attention: lisha guo <guol...@kylinos.cn>
          Gerrit-Attention: Fu, Junwei <junw...@intel.com>
          Gerrit-Comment-Date: Sat, 28 Feb 2026 06:28:10 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          lisha guo (Gerrit)

          unread,
          1:47 AM (13 minutes ago) 1:47 AM
          to Reilly Grant, Fu, Junwei, Hu, Ningxin, Junwei, Dai, Feng, Jiewei Qian, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Fu, Junwei and Reilly Grant

          lisha guo added 1 comment

          Patchset-level comments
          File-level comment, Patchset 21:
          lisha guo . resolved

          @rei...@chromium.org. Added a new comment as your suggestion. Please take another look. Thanks!

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Fu, Junwei
          • Reilly Grant
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ifaee7908b057017f39236e64436707db8a04551e
          Gerrit-Change-Number: 7509907
          Gerrit-PatchSet: 23
          Gerrit-Owner: lisha guo <guol...@kylinos.cn>
          Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
          Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
          Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
          Gerrit-Reviewer: lisha guo <guol...@kylinos.cn>
          Gerrit-CC: Dai, Feng <feng...@intel.com>
          Gerrit-CC: Jiewei Qian <q...@chromium.org>
          Gerrit-CC: Junwei <fujunw...@gmail.com>
          Gerrit-Attention: Fu, Junwei <junw...@intel.com>
          Gerrit-Attention: Reilly Grant <rei...@chromium.org>
          Gerrit-Comment-Date: Sat, 28 Feb 2026 06:47:04 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages