Revert "[ios blink] Make webnn work on the device"
This reverts commit cd5897004c
.
Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/mac14-arm64-rel-tests/23238/overview
Bug: 40254930
Original change's description:
> [ios blink] Make webnn work on the device
>
> tflite as a fallback works correctly on iOS in the GPU process.
> CoreML model requires file system access to compile a model
> and the GPU process is restricted from having file access. We've
> asked Apple to provide an update how CoreML can be used in the
> sandboxed rendering process.
>
> Bug: 40254930
> Change-Id: I72598db882db38fa43d5d04f4c6055cbafb33a87
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6543648
> Reviewed-by: Reilly Grant <reillyg@chromium.org>
> Reviewed-by: Joe Mason <joenotcharles@google.com>
> Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1460093}
Bug: 40254930
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I898a1e35dd74d9413cbdc2a88cef9214708fabab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6547278
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Owners-Override: Matt Reichhoff <mreichhoff@chromium.org>
Reviewed-by: Matt Reichhoff <mreichhoff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1460154}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
60ff6b07ca
commit
f60dc7bcff
services/webnn
@ -106,7 +106,7 @@ component("webnn_service") {
|
||||
libs = [ "dxgi.lib" ]
|
||||
}
|
||||
|
||||
if (is_apple) {
|
||||
if (is_mac) {
|
||||
sources += [
|
||||
"coreml/buffer_content_coreml.h",
|
||||
"coreml/buffer_content_coreml.mm",
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "base/task/bind_post_task.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "base/types/expected_macros.h"
|
||||
#include "build/build_config.h"
|
||||
#include "mojo/public/cpp/base/big_buffer.h"
|
||||
#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
|
||||
#include "services/webnn/coreml/buffer_content_coreml.h"
|
||||
@ -80,7 +79,6 @@ namespace {
|
||||
// compilation process.
|
||||
struct ScopedModelPaths {
|
||||
~ScopedModelPaths() {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kWebNNCoreMlDumpModel)) {
|
||||
const auto dump_directory =
|
||||
@ -102,7 +100,6 @@ struct ScopedModelPaths {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Though the destructors of ScopedTempDir will delete these directories.
|
||||
// Explicitly delete them here to check for success.
|
||||
if (model_file_dir.IsValid()) {
|
||||
|
@ -5,11 +5,9 @@
|
||||
import("//build/config/features.gni")
|
||||
import("//services/on_device_model/on_device_model.gni")
|
||||
|
||||
assert(use_blink)
|
||||
|
||||
declare_args() {
|
||||
# TFLite is used as a fallback option on Apple and Windows.
|
||||
webnn_use_tflite = is_android || is_chromeos || is_linux || is_apple || is_win
|
||||
# TFLite is used as a fallback option on macOS and Windows.
|
||||
webnn_use_tflite = is_android || is_chromeos || is_linux || is_mac || is_win
|
||||
|
||||
# Enable the GPU delegate provided by the Optimization Guide library.
|
||||
webnn_use_chrome_ml_api = enable_ml_internal
|
||||
|
@ -18,19 +18,10 @@ feature kExperimentalWebMachineLearningNeuralNetwork {
|
||||
};
|
||||
|
||||
// Enables the Core ML backend for WebNN.
|
||||
[EnableIf=is_apple]
|
||||
[EnableIf=is_mac]
|
||||
feature kWebNNCoreML {
|
||||
const string name = "WebNNCoreML";
|
||||
|
||||
// macOS default state is enabled.
|
||||
[EnableIf=is_macos]
|
||||
const bool default_state = true;
|
||||
|
||||
// iOS default state is disabled since there are sandbox issues
|
||||
// with using CoreML in the GPU process, we are waiting to hear back
|
||||
// from Apple. https://crbug.com/417496826
|
||||
[EnableIf=is_ios]
|
||||
const bool default_state = false;
|
||||
};
|
||||
|
||||
// Enables the DirectML backend for WebNN.
|
||||
|
@ -24,9 +24,6 @@
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
#include "base/mac/mac_util.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_APPLE)
|
||||
#include "services/webnn/coreml/context_impl_coreml.h"
|
||||
#endif
|
||||
|
||||
@ -190,18 +187,15 @@ void WebNNContextProviderImpl::CreateWebNNContext(
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
#if BUILDFLAG(IS_APPLE)
|
||||
if (__builtin_available(macOS 14, *)) {
|
||||
if (base::FeatureList::IsEnabled(mojom::features::kWebNNCoreML)
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
&& base::mac::GetCPUType() == base::mac::CPUType::kArm
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
) {
|
||||
if (__builtin_available(macOS 14, *)) {
|
||||
if (base::FeatureList::IsEnabled(mojom::features::kWebNNCoreML) &&
|
||||
base::mac::GetCPUType() == base::mac::CPUType::kArm) {
|
||||
context_impl = std::make_unique<coreml::ContextImplCoreml>(
|
||||
std::move(receiver), this, std::move(options));
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(IS_APPLE)
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
#if BUILDFLAG(WEBNN_USE_TFLITE)
|
||||
if (!context_impl) {
|
||||
|
Reference in New Issue
Block a user