Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow-cpu-aws prevents building ARM/multi-arch containers from a x86 machine #60751

Closed
celeste-zeng opened this issue Jun 1, 2023 · 6 comments
Assignees
Labels
stat:awaiting response Status - Awaiting response from author TF 2.12 For issues related to Tensorflow 2.12 type:bug Bug type:build/install Build and install issues

Comments

@celeste-zeng
Copy link

celeste-zeng commented Jun 1, 2023

Click to expand!

Issue Type

Bug

Have you reproduced the bug with TF nightly?

No

Source

source

Tensorflow Version

2.12

Custom Code

Yes

OS Platform and Distribution

Linux Debian 6.1.20-2rodete1

Mobile device

No response

Python version

Python 3.8.9

Bazel version

No response

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

On a x86 machine, I tried to build Beam Python multi-arch containers whose base image requirement include tensorflow2.12. The x86 components were built successfully but encountered the following error while building the ARM components:

#39 [linux/arm64 beam 11/16] RUN pip check || (echo "Container does not include required Beam dependencies or has conflicting dependencies. If Beam dependencies have changed, you need to regenerate base_image_requirements.txt files. See: https://s.apache.org/beam-python-requirements-generate" && exit 1) #39 20.81 tensorflow 2.12.0 requires tensorflow-cpu-aws, which is not installed.

I also tried to install tensorflow-cpu-aws manually by running pip install tensorflow-cpu-aws on the x86 machine and got the following error: ERROR: Could not find a version that satisfies the requirement tensorflow-cpu-aws (from versions: none) ERROR: No matching distribution found for tensorflow-cpu-aws

An ARM container image required tensorflow can't be built from a x86 machine because it will try to install tensorflow-cpu-aws, which can't be installed from a x86 machine.

I wonder if it is there anything we can do to resolve this? Otherwise for all ARM containers which are built from a x86 machine, their base image requirements can't contain tensorflow.

Thanks!

Standalone code to reproduce the issue

On terminal:
1. Clone the Beam repository: git clone https://github.com/apache/beam.git
2. Build the multi-arch image by running: ./gradlew -Pcontainer-architecture-list=arm64,amd64 :sdks:python:container:py310:docker

Relevant log output

No response

@celeste-zeng
Copy link
Author

@elfringham

@SuryanarayanaY SuryanarayanaY added TF 2.12 For issues related to Tensorflow 2.12 type:build/install Build and install issues labels Jun 2, 2023
@SuryanarayanaY
Copy link
Collaborator

Hi @celeste-zeng ,

The package tensorflow-cpu-aws is meant for Arm/AArch64 processors and it can't be downloadable into X86_64 architectures through pip. Pip will try to resolve the wheels suitable for that particular host platform and if it is not found then it raises the error like no matching distribution found. I am not sure whether there is a way and i doubt whether there is a universal wheel common for both architecture.

The pre built pip wheels for X86_64 built and maintained by tensorflow itself which you can install through pip install tensorflow-cpu and this can be installed on x86_64 machines only.

Please refer the documentation source for more details.

May be @elfringham can add some more valuable points here.

Thanks!

@elfringham
Copy link
Contributor

This does not look like a problem that is specific to TensorFlow. I think your problem is all about creating a docker container for a foreign architecture from your x86 machine. In order to do that you need to add qemu to the mix so that there is an environment that allows the docker container to execute.
See https://www.docker.com/blog/multi-platform-docker-builds/

@SuryanarayanaY
Copy link
Collaborator

@celeste-zeng ,

Referring to above comment have you made any progress ? I too of the opinion that this is not a Tensorflow relevant issue if you are looking for what mentioned in above comment. WDYT ?

@SuryanarayanaY SuryanarayanaY added the stat:awaiting response Status - Awaiting response from author label Jun 26, 2023
@celeste-zeng
Copy link
Author

Hi @SuryanarayanaY ,

Thanks for following up!

And yes I don't think it is a Tensorflow relevant issue.The fix is that when building an ARM container with tensorflow from an x86 machine, tensorflow-cpu-aws needs to be explicitly added to the requirements as well.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author TF 2.12 For issues related to Tensorflow 2.12 type:bug Bug type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants