For GPU you could subscribe also to:

  

      github.com/tensorflow/tensorflow
  

  
    
  
	  
  

  
    
      Error when building tflite 2.3.0-rc0 metal delegate on macOS 3
    

    
      
        opened 
        
          
        
        Jul 3, 2020
      
      


      
        
          
          nkjassal
        
      
    

    
        type:build/install
        comp:lite
    
  


  
    <em>Please make sure that this is a build/installation issue. As per our [GitHub… Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template</em>

**System information**
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 10.15.2
- TensorFlow installed from (source or binary): source
- TensorFlow version: 2.3.0-rc0
- Python version: 3.6.4
- Installed using virtualenv? pip? conda?: virtualenv
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version: 3.1.0
- GPU model and memory: AMD Radeon R9 M370X 2 GB



**Describe the problem**
The metal delegate dylib for macOS fails to build using the recommended command from the BUILD file (`tensorflow/lite/delegates/gpu/BUILD:L181`).

**Provide the exact sequence of commands / steps that you executed before running into the problem**
From `tensorflow-2.3.0-rc0/`:
```
bazel build -c opt --copt -Os --copt -DTFLITE_GPU_BINARY_RELEASE --copt -fvisibility=default --linkopt -s --strip always --cxxopt=-std=c++14 --apple_platform_type=macos //tensorflow/lite/delegates/gpu:tensorflow_lite_gpu_dylib
```

**Any other info / logs**
Running the above command produces error log:
```
bazel build -c opt --copt -Os --copt -DTFLITE_GPU_BINARY_RELEASE --copt -fvisibility=default --linkopt -s --strip always --cxxopt=-std=c++14 --apple_platform_type=macos //tensorflow/lite/delegates/gpu:tensorflow_lite_gpu_dylib
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=174
INFO: Reading rc options for 'build' from /Users/njassal/dev/tensorflow/tensorflow-2.3.0-rc0/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/njassal/dev/tensorflow/tensorflow-2.3.0-rc0/.bazelrc:
  'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --java_toolchain=//third_party/toolchains/java:tf_java_toolchain --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --noincompatible_prohibit_aapt1 --enable_platform_specific_config --config=v2
INFO: Reading rc options for 'build' from /Users/njassal/dev/tensorflow/tensorflow-2.3.0-rc0/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Users/njassal/.virtualenvs/tensorflow-2.2.0/bin/python3 --action_env PYTHON_LIB_PATH=/Users/njassal/.virtualenvs/tensorflow-2.2.0/lib/python3.6/site-packages --python_path=/Users/njassal/.virtualenvs/tensorflow-2.2.0/bin/python3 --config=xla --action_env TF_CONFIGURE_IOS=1
INFO: Found applicable config definition build:v2 in file /Users/njassal/dev/tensorflow/tensorflow-2.3.0-rc0/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:xla in file /Users/njassal/dev/tensorflow/tensorflow-2.3.0-rc0/.bazelrc: --action_env=TF_ENABLE_XLA=1 --define=with_xla_support=true
INFO: Found applicable config definition build:macos in file /Users/njassal/dev/tensorflow/tensorflow-2.3.0-rc0/.bazelrc: --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
DEBUG: Rule 'io_bazel_rules_docker' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1556410077 -0400"
DEBUG: Repository io_bazel_rules_docker instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule git_repository defined at:
  /private/var/tmp/_bazel_njassal/c07bdfc7f101779d38a8eaaebedd6122/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18: in <toplevel>
INFO: Repository eigen_archive instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule tf_http_archive defined at:
  /Users/njassal/dev/tensorflow/tensorflow-2.3.0-rc0/third_party/repo.bzl:134:19: in <toplevel>
ERROR: /private/var/tmp/_bazel_njassal/c07bdfc7f101779d38a8eaaebedd6122/external/cpuinfo/BUILD.bazel:96:1: Configurable attribute "srcs" doesn't match this configuration (would a default condition help?).
Conditions checked:
 @cpuinfo//:linux_x86_64
 @cpuinfo//:linux_arm
 @cpuinfo//:linux_armhf
 @cpuinfo//:linux_armv7a
 @cpuinfo//:linux_armeabi
 @cpuinfo//:linux_aarch64
 @cpuinfo//:macos_x86_64
 @cpuinfo//:windows_x86_64
 @cpuinfo//:android_armv7
 @cpuinfo//:android_arm64
 @cpuinfo//:android_x86
 @cpuinfo//:android_x86_64
 @cpuinfo//:ios_x86_64
 @cpuinfo//:ios_x86
 @cpuinfo//:ios_armv7
 @cpuinfo//:ios_arm64
 @cpuinfo//:ios_arm64e
 @cpuinfo//:watchos_x86_64
 @cpuinfo//:watchos_x86
 @cpuinfo//:watchos_armv7k
 @cpuinfo//:watchos_arm64_32
 @cpuinfo//:tvos_x86_64
 @cpuinfo//:tvos_arm64
WARNING: Download from https://mirror.bazel.build/github.com/Maratyszcza/FP16/archive/4dfe081cf6bcd15db339cf2680b9281b8451eeb3.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
ERROR: Analysis of target '//tensorflow/lite/delegates/gpu:tensorflow_lite_gpu_dylib' failed; build aborted: 

/private/var/tmp/_bazel_njassal/c07bdfc7f101779d38a8eaaebedd6122/external/cpuinfo/BUILD.bazel:96:1: Configurable attribute "srcs" doesn't match this configuration (would a default condition help?).
Conditions checked:
 @cpuinfo//:linux_x86_64
 @cpuinfo//:linux_arm
 @cpuinfo//:linux_armhf
 @cpuinfo//:linux_armv7a
 @cpuinfo//:linux_armeabi
 @cpuinfo//:linux_aarch64
 @cpuinfo//:macos_x86_64
 @cpuinfo//:windows_x86_64
 @cpuinfo//:android_armv7
 @cpuinfo//:android_arm64
 @cpuinfo//:android_x86
 @cpuinfo//:android_x86_64
 @cpuinfo//:ios_x86_64
 @cpuinfo//:ios_x86
 @cpuinfo//:ios_armv7
 @cpuinfo//:ios_arm64
 @cpuinfo//:ios_arm64e
 @cpuinfo//:watchos_x86_64
 @cpuinfo//:watchos_x86
 @cpuinfo//:watchos_armv7k
 @cpuinfo//:watchos_arm64_32
 @cpuinfo//:tvos_x86_64
 @cpuinfo//:tvos_arm64
INFO: Elapsed time: 0.123s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
```