tensorflow: Build on PPC fails due to import of `__subpackages__`

Click to expand!

Issue Type

Build/Install

Source

source

Tensorflow Version

TF since 2.8

Custom Code

No

OS Platform and Distribution

Linux RHEL 7

Mobile device

No response

Python version

3.10

Bazel version

4.2.2

GCC/Compiler version

11.2

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

The build on POWER/PPC machine fails with e.g. 

/XNNPACK/BUILD.bazel:7746:26: Configurable attribute "deps" doesn't match this con
figuration (would a default condition help?).
Conditions checked:
 @XNNPACK//:linux_k8
 @XNNPACK//:linux_arm
 @XNNPACK//:linux_armeabi
 @XNNPACK//:linux_armhf
 @XNNPACK//:linux_armv7a
 @XNNPACK//:linux_arm64
 @XNNPACK//:macos_x86_64
 @XNNPACK//:macos_arm64
 @XNNPACK//:windows_x86_64_clang
 @XNNPACK//:windows_x86_64_mingw
 @XNNPACK//:windows_x86_64_msys
 @XNNPACK//:windows_x86_64
 @XNNPACK//:android_armv7
 @XNNPACK//:android_arm64
 @XNNPACK//:android_x86
 @XNNPACK//:android_x86_64
 @XNNPACK//:ios_armv7
 @XNNPACK//:ios_arm64
 @XNNPACK//:ios_arm64e
 @XNNPACK//:ios_x86
 @XNNPACK//:ios_x86_64
 @XNNPACK//:watchos_armv7k
 @XNNPACK//:watchos_arm64_32
 @XNNPACK//:watchos_x86
 @XNNPACK//:watchos_x86_64
 @XNNPACK//:tvos_arm64
 @XNNPACK//:tvos_x86_64
 @XNNPACK//:emscripten_wasm
 @XNNPACK//:emscripten_wasmsimd

I don’t think that blindly importing/depending on everything is a good idea. Besides that issues like that should likely be fixed in the other repos (see the link below).

Standalone code to reproduce the issue

Simply build the PIP package per the instructions.

Reason is https://github.com/tensorflow/tensorflow/commit/754b33d9526ac4ed9d4900ffea1a35107037b37f which makes a target depend on @XNNPACK//:__subpackages__ (and also e.g. @cpuinfo//:__subpackages__) but those are not (correctly?) define for PPC. See e.g. https://github.com/google/XNNPACK/issues/3950

When removing the XNNPACK dependency then I get a similar issue for CPUINFO:

ERROR: /dev/shm/s3248973-EasyBuild/TensorFlow/2.8.2/foss-2021b/TensorFlow/bazel-root/366a3a873d5422e1454f21ea2c9f7525/external/cpuinfo/BUILD.bazel:100:11: Configurable attribute "srcs" doesn't match this configuration (would a default condition help?).

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Did you try to add --define=tflite_with_xnnpack=false to your Bazel command?

My issue in the XNNPACK repo was closed with the comment

PowerPC is not supported in XNNPACK.

So I guess it is an error of TensorFlow to import XNNPACK unconditionally.

However a recent commit introduced the missing default case .

Anyway I don’t think that importing basically everything from everywhere as a dependency is correct. Aren’t you supposed to be explicit on what you use?