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 2.13.0, CPU, Linux, py3.10, SSE4.1 #223

Open
tomeeeS opened this issue Sep 7, 2023 · 6 comments
Open

TensorFlow 2.13.0, CPU, Linux, py3.10, SSE4.1 #223

tomeeeS opened this issue Sep 7, 2023 · 6 comments

Comments

@tomeeeS
Copy link

tomeeeS commented Sep 7, 2023

https://github.com/tomeeeS/tf_builds/blob/main/tensorflow-2.13.0-cp310-cp310-linux_x86_64.whl
"Download raw file" button, or from cmd wget https://github.com/tomeeeS/tf_builds/raw/main/tensorflow-2.13.0-cp310-cp310-linux_x86_64.whl?download=
untar (tar -xf tensorflow*), use the .whl. You don't need the other folders it extracts.

Commands used for build:

git config --global core.autocrlf input  # very important!!!  otherwise your bazel build will fail, because an invoked shell script will have Windows line endings.
git config --global core.eol lf
git clone https://github.com/tensorflow/tensorflow.git &
cd tensorflow
git checkout -b r2.13 origin/r2.13
apt install python3.10-venv
cd ..

python3 -m venv tf_venv
tf_venv/bin/pip install -U pip numpy wheel packaging requests opt_einsum
tf_venv/bin/pip install -U keras_preprocessing --no-deps

wget https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-amd64
mv bazelisk-linux-amd64 bazel
chmod +x bazel
mv -v bazel /usr/local/bin

installing clang-16 is not necessary! bazel will dl and use one. 

cd tensorflow
../tf_venv/bin/python3 configure.py 
(dl clang: N (! No!, yet bazel will dl and use one), opti flag: -msse4.1)
bazel build  --local_ram_resources=2048 --jobs=4 --verbose_failures  //tensorflow/tools/pip_package:build_pip_package   # adds up to max 8GB RAM usage (local_ram_resources in MB * jobs)
@Cthuulhaa
Copy link

Hi, sorry, this may be a newbie question, but in which directory is the compiled Tensorflow wheel?

Cheers!

@tomeeeS
Copy link
Author

tomeeeS commented Dec 11, 2023

@Cthuulhaa Hi, no worries, after you open the link, you just have to click the download button at the top right. It's to the right of "Raw". It only downloads the .whl (the wheel).
If however you have cloned the repo, you would need to install git lfs and pull it with that (much more complicated).

@FrankyDBravo
Copy link

Amazing thanks! I am trying to do the same for a Python 3.11.5 with tensorflow 2.14 (CPU) ( that would work on a docker amd64 ubuntu that is running on a MAC M1).
I fail to create the wheel.. Do you know where I could find it ?

Best!

@Cthuulhaa
Copy link

Amazing thanks! I am trying to do the same for a Python 3.11.5 with tensorflow 2.14 (CPU) ( that would work on a docker amd64 ubuntu that is running on a MAC M1). I fail to create the wheel.. Do you know where I could find it ?

Best!

If building the package builder was sucessful, you will then have to run the executable build_pip_package in the bazel-bin/tensorflow/tools/pip_package directory to create the .whl:

./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

An then install the Tensorflow wheel:

pip install -U /tmp/tensorflow_pkg/tensorflow-version-tags.whl

@FrankyDBravo
Copy link

Great thanks.. I am still struggling to create a version that would work on a docker ( x86_64), the container running on a mac M1. Specifically for a python 3.11 and tf 2.14 ... ? anyone can help ?

@FrankyDBravo
Copy link

i am really struggling and would gift anyone that could provide me the wheel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants