Compile TensorFlow from Source, rebuild TensorFlow with compiler flags, a tutorial

Publicado em: 29 Julho 2023
no canal de: Overthinking Tech
2,558
50

In this video I'm showing how to compile TensorFlow from source. This resolves the warning "rebuild TensorFlow with the appropriate compiler flags"
I also discuss CPU instructions and how they can make our computers faster.
Finally I compare speed to see if it is "worth" compiling from source.

Here is the python file I ran: https://cloud.overthinking.tech/s/LfR...

TensorFlow's Instructions: https://www.tensorflow.org/install/so...

Here are all the commands, copy pasta to your hearts content:
curl https://repo.anaconda.com/miniconda/M... -o Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
conda create --name pythontemp python=3.10
conda activate pythontemp
pip install -U --user pip numpy wheel packaging requests opt_einsum
pip install -U --user keras_preprocessing --no-deps
sudo apt install gcc g++ patchelf
git clone https://github.com/tensorflow/tensorf...
cd tensorflow
python3 configure.py
cd ..
sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel
sudo chmod +x /usr/local/bin/bazel
cd tensorflow
sudo bazel build -j 12 --local_ram_resources=8192 --config=opt //tensorflow/tools/pip_package:build_pip_package
sudo ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-....whl
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /home/jtrev/miniconda3/envs/pythontemp/bin/../lib/libstdc++.so.6

Google Doc with the commands: https://docs.google.com/document/d/1G...



0:00 Intro
0:37 Why Do This
1:15 CPU Instructions
3:34 Speed with no AVX nor SSE
4:10 Speed with all instructions
4:47 Speed with some instructions
5:44 Compile TensorFlow From Source, My Setup
7:05 Copy Pasta Time
14:29 Wait for Build
14:55 Finish Install
17:39 Up and Running!
18:29 The Speed?
19:43 Outro


Nesta página do site você pode assistir ao vídeo on-line Compile TensorFlow from Source, rebuild TensorFlow with compiler flags, a tutorial duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Overthinking Tech 29 Julho 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 2,558 vezes e gostou 50 espectadores. Boa visualização!