linux_compiler_tensorflow_avec_bazel
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
linux_compiler_tensorflow_avec_bazel [2021/12/16 15:33] – serge | linux_compiler_tensorflow_avec_bazel [2021/12/20 11:13] (Version actuelle) – [La version Intel de Tensorflow] serge | ||
---|---|---|---|
Ligne 12: | Ligne 12: | ||
</ | </ | ||
- | Donne toujours le message AVX2 et FMA, et ça ne va pas plus vite ! | + | Donne toujours le message AVX2 et FMA. Mais c'est normal.\\ |
+ | Bienvenue dans le monde de Tensoflow: c'est un Warning, mais ce n' | ||
+ | Mon FPS a augmenté de 10 à 20 % :-P | ||
+ | **Il est inutile de compiler** 8-) | ||
=====Ressources===== | =====Ressources===== | ||
* **[[https:// | * **[[https:// | ||
- | * **[[https:// | + | * **[[https:// |
- | * **[[https://technofob.com/2019/06/14/how-to-compile-tensorflow-2-0-with-avx2-fma-instructions-on-mac/ | + | |
+ | Sur les internets, ça en cause: | ||
+ | * https:// | ||
+ | * https:// | ||
* https:// | * https:// | ||
- | * https:// | ||
* https:// | * https:// | ||
* https:// | * https:// | ||
- | * https:// | ||
- | * https:// | ||
=====Installation de Bazel===== | =====Installation de Bazel===== | ||
Ligne 39: | Ligne 41: | ||
=====Sans GPU sur Debian===== | =====Sans GPU sur Debian===== | ||
- | Désinstaller les packages python | + | Désinstaller les packages python tensorflow si ils sont installés. |
+ | <code bash> | ||
+ | pip3 list | ||
+ | # Dans la list, chercher ce qu'il faut désinstaller ... | ||
+ | python3 -m pip uninstall tensorflow intel-tensorflow | ||
+ | ... | ||
+ | </ | ||
+ | Installation du nécessaire: | ||
+ | <code bash> | ||
+ | python3 -m pip install numpy wheel protobuf | ||
+ | python3 -m pip install keras_preprocessing --no-deps | ||
+ | </ | ||
- | Installation du nécessaire: | ||
- | python3 -m pip install numpy wheel | ||
- | python3 -m pip install keras_preprocessing --no-deps | ||
- | | ||
Récupération des sources de tensorflow: | Récupération des sources de tensorflow: | ||
- | | + | <code bash> |
- | git clone https:// | + | cd / |
- | ./configure | + | git clone https:// |
+ | ./configure | ||
+ | </ | ||
Cela génère un fichier .tf_configure.bazelrc dans le dossier tensorflow (c'est un fichier caché: Ctrl+h).\\ | Cela génère un fichier .tf_configure.bazelrc dans le dossier tensorflow (c'est un fichier caché: Ctrl+h).\\ | ||
Ligne 69: | Ligne 80: | ||
====Compilation de tensorflow==== | ====Compilation de tensorflow==== | ||
- | sudo ln -s / | ||
- | bazel build -j 4 // | ||
- | ./ | ||
- | |||
- | INFO: Elapsed time: 11341.078s, Critical Path: 1101.95s\\ | ||
- | INFO: 11460 processes: 1325 internal, 10135 local.\\ | ||
- | INFO: Build completed successfully, | ||
- | soit 3.1 heures ! | ||
- | |||
- | ====Nettoyage pour recommencer==== | ||
- | bazel clean | ||
- | | ||
- | =====Test spécial===== | ||
<code bash> | <code bash> | ||
- | build --action_env PYTHON_BIN_PATH=" | + | sudo ln -s / |
- | build --action_env PYTHON_LIB_PATH=" | + | bazel build -j 4 |
- | build --python_path="/ | + | ./bazel-bin/ |
- | build: | + | |
- | build: | + | |
- | test --flaky_test_attempts=3 | + | |
- | test --test_size_filters=small, | + | |
- | test:v1 --test_tag_filters=-benchmark-test, | + | |
- | test: | + | |
- | test:v2 --test_tag_filters=-benchmark-test, | + | |
- | test:v2 --build_tag_filters=-benchmark-test, | + | |
</ | </ | ||
- | bazel build -j 4 --copt=-mavx2 --copt=-mfma // | + | ===Consommation mémoire=== |
+ | Sur un i5 à 8 threads et 8 Go de Ram: -j 2 pour limiter la consommation de mémoire, sinon Swap de 8 Go insuffisante. | ||
+ | ===Stop et reprise=== | ||
+ | Bazel reprend là où il s'est arrêté. | ||
- | ===Consommation mémoire=== | + | ===Success=== |
- | Sur un i5 à 8 threads et 8 Go de Ram: -j 4 pour limiter la consommation de mémoire | + | <code bash> |
+ | INFO: Elapsed time: 19106.040s, Critical Path: 196.86s | ||
+ | soit 5.3 heures, perso je trouve 7 heures! | ||
+ | INFO: 11460 processes: 1325 internal, 10135 local. | ||
+ | INFO: Build completed successfully, | ||
+ | </ | ||
- | ====Conseils Geek==== | + | ====Nettoyage pour recommencer==== |
- | Au lieu de répondre aux questions de ./ | + | |
<code bash> | <code bash> | ||
- | build --action_env PYTHON_BIN_PATH="/ | + | bazel clean |
- | build --action_env PYTHON_LIB_PATH="/ | + | |
- | build --python_path="/ | + | |
- | build:opt --copt=-march=native | + | |
- | build:opt --copt=-Wno-sign-compare | + | |
- | build:opt --copt=-mavx | + | |
- | build:opt --copt=-mavx2 | + | |
- | build:opt --copt=-mfma | + | |
- | build:opt --host_copt=-march=native | + | |
- | build:opt --define with_default_optimizations=true | + | |
- | test --flaky_test_attempts=3 | + | |
- | test --test_size_filters=small, | + | |
- | test:v1 --test_tag_filters=-benchmark-test, | + | |
- | test:v1 --build_tag_filters=-benchmark-test, | + | |
- | test:v2 --test_tag_filters=-benchmark-test, | + | |
- | test:v2 --build_tag_filters=-benchmark-test, | + | |
</ | </ | ||
- | |||
====Installation==== | ====Installation==== | ||
- | | + | <code bash> |
- | source mon_env/ | + | cd / |
- | python3 -m pip uninstall tensorflow | + | source mon_env/ |
- | python3 -m pip install / | + | python3 -m pip uninstall tensorflow |
- | + | python3 -m pip install / | |
+ | </ | ||
+ | |||
+ | ====Utilisation==== | ||
+ | Le message d'info AVX2 et FMA est toujours là ! | ||
{{tag>ia linux python sb tensorflow}} | {{tag>ia linux python sb tensorflow}} |
linux_compiler_tensorflow_avec_bazel.1639668789.txt.gz · Dernière modification : 2021/12/16 15:33 de serge