tensorflow: TFLite delegates/gpu/libmetal_delegate.a is missing

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Mojave (10.14.1)
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
  • TensorFlow installed from (source or binary): Not installed.
  • TensorFlow version: master branch (latest commit 6353d940289a225cfbc104cc647b3c6970077faa)
  • Python version: 3.7.2
  • Installed using virtualenv? pip? conda?: Not installed, just calling shell scripts from repo
  • Bazel version (if compiling from source): 0.18.0
  • GCC/Compiler version (if compiling from source): N/A
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

Describe the problem Attempting to build iOS Metal TFLite Delegate with create_ios_frameworks.sh yields the following error:

$ tensorflow/lite/lib_package/create_ios_frameworks.sh -g
Starting
File /path/to/tensorflow/tensorflow/lite/lib_package/../delegates/gpu/libmetal_delegate.a doesn't exist.
It's requried for building TFLite Framework with GPU. Aborting.

Provide the exact sequence of commands / steps that you executed before running into the problem

This is how I am attempting to create the iOS framework:

$ tensorflow/lite/tools/make/download_dependencies.sh
$ tensorflow/lite/tools/make/build_ios_universal_lib.sh
$ tensorflow/lite/lib_package/create_ios_frameworks.sh -g

I saw that the -g flag got added to create_ios_frameworks.sh in 59d535a0df17eaf3033bbff73ef4e1e1988c454e. Without the flag, I am able to successfully build the framework but, as expected, the GPU is not utilized.

I know the GPU delegates only got open-sourced a couple of days ago, and before that I had unsurprisingly been getting the same error but with metal_delegate.h, which was added in fb772b781b011471dec443e1f3cd6b664958b767. Is libmetal_delegate.a supposed to be present or is it still pending open-sourcing?

Any other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

N/A

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

With one line modification to

diff --git a/tensorflow/lite/delegates/gpu/metal_delegate.mm b/tensorflow/lite/delegates/gpu/metal_delegate.mm
index 66bfb043e5..b71881b73f 100644
--- a/tensorflow/lite/delegates/gpu/metal_delegate.mm
+++ b/tensorflow/lite/delegates/gpu/metal_delegate.mm
@@ -23,7 +23,7 @@
 #include <string>
 #include <vector>
 
-#include "third_party/absl/types/span.h"
+#include "absl/types/span.h"
 #include "tensorflow/lite/builtin_ops.h"
 #include "tensorflow/lite/c/c_api_internal.h"
 #include "tensorflow/lite/delegates/gpu/common/convert.h"

With something like

bazel build --apple_platform_type ios --ios_multi_cpus=arm64 \
tensorflow/lite/delegates/gpu:metal_delegate

you can get arm64 bazel-tensorflow/bazel-out/apl-ios_arm64-opt/bin/tensorflow/lite/delegates/gpu/libmetal_delegate.a.