webnn: Route CPU/NPU requests to in-renderer TFLite backend [chromium/src : main]

0 views
Skip to first unread message

Fu, Junwei (Gerrit)

unread,
May 5, 2026, 11:46:17 PM (5 days ago) May 5
to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
Attention needed from Hu, Ningxin and Reilly Grant

Fu, Junwei added 1 comment

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Fu, Junwei . resolved

PTAL, thanks.

Open in Gerrit

Related details

Attention is currently required from:
  • Hu, Ningxin
  • Reilly Grant
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: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
Gerrit-Change-Number: 7785089
Gerrit-PatchSet: 11
Gerrit-Owner: Fu, Junwei <junw...@intel.com>
Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
Gerrit-CC: Jiewei Qian <q...@chromium.org>
Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
Gerrit-Attention: Reilly Grant <rei...@chromium.org>
Gerrit-Comment-Date: Wed, 06 May 2026 03:45:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Reilly Grant (Gerrit)

unread,
May 6, 2026, 9:17:20 PM (4 days ago) May 6
to Fu, Junwei, Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
Attention needed from Fu, Junwei and Hu, Ningxin

Reilly Grant added 1 comment

File services/webnn/webnn_test_environment.cc
Line 26, Patchset 11 (Latest):// Wraps the GPU-process `WebNNContextProvider`. When the in-process TFLite
// backend is compiled in, falls back to it on GPU-process error.
Reilly Grant . unresolved

This is confusing because in unit tests there is no GPU process. This should be more explicit that is mimicking the behavior of the renderer process and that `WebNNContextProviderImpl` is expected to reject requests which wouldn't be handled by the GPU process.

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: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
    Gerrit-Change-Number: 7785089
    Gerrit-PatchSet: 11
    Gerrit-Owner: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
    Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
    Gerrit-CC: Jiewei Qian <q...@chromium.org>
    Gerrit-Attention: Fu, Junwei <junw...@intel.com>
    Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
    Gerrit-Comment-Date: Thu, 07 May 2026 01:17:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fu, Junwei (Gerrit)

    unread,
    May 6, 2026, 9:40:33 PM (4 days ago) May 6
    to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
    Attention needed from Hu, Ningxin and Reilly Grant

    Fu, Junwei added 2 comments

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    Fu, Junwei . resolved

    Thanks for review, done the comments.

    File services/webnn/webnn_test_environment.cc
    Line 26, Patchset 11:// Wraps the GPU-process `WebNNContextProvider`. When the in-process TFLite

    // backend is compiled in, falls back to it on GPU-process error.
    Reilly Grant . resolved

    This is confusing because in unit tests there is no GPU process. This should be more explicit that is mimicking the behavior of the renderer process and that `WebNNContextProviderImpl` is expected to reject requests which wouldn't be handled by the GPU process.

    Fu, Junwei

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Hu, Ningxin
    • Reilly Grant
    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: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
      Gerrit-Change-Number: 7785089
      Gerrit-PatchSet: 12
      Gerrit-Owner: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-Attention: Reilly Grant <rei...@chromium.org>
      Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Comment-Date: Thu, 07 May 2026 01:40:20 +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,
      May 7, 2026, 4:19:39 PM (3 days ago) May 7
      to Fu, Junwei, Reilly Grant, Hu, Ningxin, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
      Attention needed from Fu, Junwei and Hu, Ningxin

      Reilly Grant voted and added 1 comment

      Votes added by Reilly Grant

      Code-Review+1

      1 comment

      Patchset-level comments
      Reilly Grant . resolved

      LGTM

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fu, Junwei
      • Hu, Ningxin
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement 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: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
      Gerrit-Change-Number: 7785089
      Gerrit-PatchSet: 12
      Gerrit-Owner: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
      Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
      Gerrit-CC: Jiewei Qian <q...@chromium.org>
      Gerrit-Attention: Fu, Junwei <junw...@intel.com>
      Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
      Gerrit-Comment-Date: Thu, 07 May 2026 20:19:22 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Hu, Ningxin (Gerrit)

      unread,
      May 8, 2026, 12:28:30 AM (3 days ago) May 8
      to Fu, Junwei, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
      Attention needed from Fu, Junwei

      Hu, Ningxin added 2 comments

      File services/webnn/tflite/context_provider_tflite.cc
      Line 31, Patchset 12 (Latest):#if BUILDFLAG(WEBNN_USE_CHROME_ML_API)
      Hu, Ningxin . unresolved

      Nit: If `WEBNN_USE_CHROME_ML_API` is not defined, there will be an empty if statement body which is confusing. Would it be better to move `#if BUILDFLAG(WEBNN_USE_CHROME_ML_API)` out and guard the entire if statement?

      File services/webnn/webnn_context_provider_impl.cc
      Line 591, Patchset 12 (Parent):#else
      WebNNContextImplPtr context_impl(nullptr, OnTaskRunnerDeleter(task_runner));

      OnCreateWebNNContextImpl(
      std::move(callback), std::move(remote), std::move(write_tensor_producer),
      std::move(read_tensor_consumer), std::move(context_impl));
      Hu, Ningxin . unresolved

      Should we keep this #else code path? May its removal leave a code path that never reports an error if tflite is disabled and ORT is not available?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fu, Junwei
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement 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: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
        Gerrit-Change-Number: 7785089
        Gerrit-PatchSet: 12
        Gerrit-Owner: Fu, Junwei <junw...@intel.com>
        Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
        Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
        Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
        Gerrit-CC: Jiewei Qian <q...@chromium.org>
        Gerrit-Attention: Fu, Junwei <junw...@intel.com>
        Gerrit-Comment-Date: Fri, 08 May 2026 04:28:19 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Fu, Junwei (Gerrit)

        unread,
        May 8, 2026, 3:02:22 AM (2 days ago) May 8
        to Reilly Grant, Hu, Ningxin, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
        Attention needed from Hu, Ningxin

        Fu, Junwei added 3 comments

        Fu, Junwei . resolved

        Thanks for review, done the comments.

        File services/webnn/tflite/context_provider_tflite.cc
        Line 31, Patchset 12:#if BUILDFLAG(WEBNN_USE_CHROME_ML_API)
        Hu, Ningxin . resolved

        Nit: If `WEBNN_USE_CHROME_ML_API` is not defined, there will be an empty if statement body which is confusing. Would it be better to move `#if BUILDFLAG(WEBNN_USE_CHROME_ML_API)` out and guard the entire if statement?

        Fu, Junwei

        Done

        File services/webnn/webnn_context_provider_impl.cc
        Line 591, Patchset 12 (Parent):#else
        WebNNContextImplPtr context_impl(nullptr, OnTaskRunnerDeleter(task_runner));

        OnCreateWebNNContextImpl(
        std::move(callback), std::move(remote), std::move(write_tensor_producer),
        std::move(read_tensor_consumer), std::move(context_impl));
        Hu, Ningxin . resolved

        Should we keep this #else code path? May its removal leave a code path that never reports an error if tflite is disabled and ORT is not available?

        Fu, Junwei

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Hu, Ningxin
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement 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: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
          Gerrit-Change-Number: 7785089
          Gerrit-PatchSet: 13
          Gerrit-Owner: Fu, Junwei <junw...@intel.com>
          Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
          Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
          Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
          Gerrit-CC: Jiewei Qian <q...@chromium.org>
          Gerrit-Attention: Hu, Ningxin <ningx...@intel.com>
          Gerrit-Comment-Date: Fri, 08 May 2026 07:02:08 +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,
          May 8, 2026, 5:49:13 PM (2 days ago) May 8
          to Fu, Junwei, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
          Attention needed from Fu, Junwei

          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
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
            Gerrit-Change-Number: 7785089
            Gerrit-PatchSet: 13
            Gerrit-Owner: Fu, Junwei <junw...@intel.com>
            Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
            Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
            Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
            Gerrit-CC: Jiewei Qian <q...@chromium.org>
            Gerrit-Attention: Fu, Junwei <junw...@intel.com>
            Gerrit-Comment-Date: Fri, 08 May 2026 21:49:04 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Fu, Junwei (Gerrit)

            unread,
            May 9, 2026, 4:49:06 AM (yesterday) May 9
            to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org

            Fu, Junwei voted Commit-Queue+2

            Commit-Queue+2
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: Ice8dcec56c9038b7f8926efc6d9bb4c903ed455d
            Gerrit-Change-Number: 7785089
            Gerrit-PatchSet: 13
            Gerrit-Owner: Fu, Junwei <junw...@intel.com>
            Gerrit-Reviewer: Fu, Junwei <junw...@intel.com>
            Gerrit-Reviewer: Hu, Ningxin <ningx...@intel.com>
            Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
            Gerrit-CC: Jiewei Qian <q...@chromium.org>
            Gerrit-Comment-Date: Sat, 09 May 2026 08:48:56 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Fu, Junwei (Gerrit)

            unread,
            May 9, 2026, 5:09:08 AM (yesterday) May 9
            to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
            Gerrit-Comment-Date: Sat, 09 May 2026 09:08:54 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Fu, Junwei (Gerrit)

            unread,
            May 9, 2026, 7:56:52 AM (yesterday) May 9
            to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
            Gerrit-Comment-Date: Sat, 09 May 2026 11:56:38 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Fu, Junwei (Gerrit)

            unread,
            May 9, 2026, 8:05:41 PM (17 hours ago) May 9
            to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
            Gerrit-Comment-Date: Sun, 10 May 2026 00:05:27 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Fu, Junwei (Gerrit)

            unread,
            12:35 AM (12 hours ago) 12:35 AM
            to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
            Gerrit-Comment-Date: Sun, 10 May 2026 04:34:56 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Fu, Junwei (Gerrit)

            unread,
            1:57 AM (11 hours ago) 1:57 AM
            to Hu, Ningxin, Reilly Grant, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Jiewei Qian, blink-...@chromium.org
            Gerrit-Comment-Date: Sun, 10 May 2026 05:56:56 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages