intel平台优化

TensorFlow *是深度学习领域中主要使用的机器学习框架,要求高效利用计算资源。 为了充分利用英特尔架构和提高性能,TensorFlow *库已经使用英特尔MKL-DNN原语进行了优化,该原语是深度学习应用的流行性能库。

已进行优化的平台

有三种安装方式。

1. 使用pip

pip install -i https://pypi.anaconda.org/intel/simple tensorflow

2. anaconda 安装

video

3.  自己编译

前两种方式可能不支持最新的指令集。

首先安装 dnf Bazel

安装 Bazel

pushd /var/tmp

URL=https://github.com/bazelbuild/bazel/releases/latest
LASTURL=$(curl $URL -s -L -I -o /dev/null -w '%{url_effective}')
BZ_VERSION=${LASTURL##*/}
wget https://github.com/bazelbuild/bazel/releases/download/$BZ_VERSION/bazel-$BZ_VERSION-installer-linux-x86_64.sh chmod +x bazel-*
./bazel-*
export PATH=/usr/local/bin:$PATH popd

centos 7.4 can not install `dnf`from epel

WARNING: EPEL 7 DNF is very old and has issues to include security flaws. This appears to be the reason it was removed. That said here is the work around to get it working on Centos 7.

cat  >  /etc/yum.repos.d/dnf-stack-el7.repo << EOF
[dnf-stack-el7]
name=Copr repo for dnf-stack-el7 owned by @rpm-software-management
baseurl=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-stack-el7/epel-7-\$basearch/
skip_if_unavailable=True
gpgcheck=
gpgkey=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-stack-el7/pubkey.gpg
enabled=
enabled_metadata=
EOF yum install dnf

centos 7会出现这个bug:

dnf copr plugin not present in dnf-plugins-core

因为EPEL 7 DNF 已经被移除了centos 7 install dn,还需要:

wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/dnf-plugins-core-0.1.5-3.sdl7.noarch.rpm

dnf install copr-cli

sudo dnf update

dnf copr enable vbatts/bazel

centos 可以直接安装bazel下:

wget https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo -P /etc/yum.repos.d/
yum install dnf-plugins-core-0.1.-.sdl7.noarch.rpm
yum install bazel

install tf:

git clone https://github.com/tensorflow/tensorflow tensorflow
cd tensorflow

Compiling TensorFlow with Intel C Compiler

CC=icc bazel build --verbose_failures --config=mkl --copt=-msse4.2 --copt="-DEIGEN_USE_VML" -c opt //tensorflow/tools/pip_package:build_pip_package

bazel build --config=mkl -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mavx512f --copt=-mavx512dq --copt=-mavx512cd --copt=-mavx512bw --copt=-mavx512vl --copt="-DEIGEN_USE_VML" //tensorflow/tools/pip_package:build_pip_package

Build and Install TensorFlow* on Intel® Architecture

build tensorflow container:

more @ github

ref build-dev-container.sh  @github tensorflow docker

# source tf-docker.evn

# cat tf-docker.evn

# The script set the following environment variables for tf docker:
export TF_DOCKER_BUILD_TYPE=mkl
# export TF_DOCKER_BUILD_TYPE=CPU
# CPU or GPU image export TF_DOCKER_BUILD_IS_DEVEL=YES
# Is this developer image export TF_DOCKER_BUILD_DEVEL_BRANCH=r1.
# export TF_DOCKER_BUILD_DEVEL_BRANCH=master
# (Required if TF_DOCKER_BUILD_IS_DEVEL is YES)
# Specifies the branch to checkout for devel docker images # export TF_DOCKER_BUILD_CENTRAL_PIP
# (Optional)
# If set to a non-empty string, will use it as the URL from which the
# pip wheel file will be downloaded (instead of building the pip locally). # export TF_DOCKER_BUILD_CENTRAL_PIP_IS_LOCAL
# (Optional)
# If set to a non-empty string, we will treat TF_DOCKER_BUILD_CENTRAL_PIP
# as a path rather than a url. export TF_DOCKER_BUILD_IMAGE_NAME=native-mkl-tf
# (Optional)
# If set to any non-empty value, will use it as the image of the
# newly-built image. If not set, the tag prefix tensorflow/tensorflow
# will be used. # export TF_DOCKER_BUILD_VERSION:
# (Optinal)
# If set to any non-empty value, will use the version (e.g., 0.8.) as the
# tag prefix of the image. Additional strings, e.g., "-devel-gpu", will be
# appended to the tag. If not set, the default tag prefix "latest" will be
# used. # export TF_DOCKER_BUILD_PORT
# (Optional)
# If set to any non-empty and valid port number, will use that port number
# during basic checks on the newly-built docker image. # export TF_DOCKER_BUILD_PUSH_CMD
# (Optional)
# If set to a valid binary/script path, will call the script with the final
# tagged image name with an argument, to push the image to a central repo
# such as gcr.io or Docker Hub. # export TF_DOCKER_BUILD_PUSH_WITH_CREDENTIALS
# (Optional)
# Do not set this along with TF_DOCKER_BUILD_PUSH_CMD. We will push with the
# direct commands as opposed to a script. # export TF_DOCKER_USERNAME
# (Optional)
# Dockerhub username for pushing a package. # export TF_DOCKER_EMAIL
# (Optional)
# Dockerhub email for pushing a package. # export TF_DOCKER_PASSWORD
# (Optional)
# Dockerhub password for pushing a package. # export TF_DOCKER_BUILD_PYTHON_VERSION
# (Optional)
# Specifies the desired Python version. Defaults to PYTHON2. # export TF_DOCKER_BUILD_OPTIONS
# (Optional)
# Specifies the desired build options. Defaults to OPT.

参考:

MPI教程

tensorflow MPI

build tensorflow

build

install 中文版

pip install mock

REF:

学习课程

more info

conda install for TensorFlow and Intel Distribution for Python upgrade from 2017 to 2018

DNF (Dandified Yum)

Intel® Computer Vision(CV) SDK

Intel's Deep Learning Inference Engine Developer Guide

inference-engine-devguide-introduction

Configuring Model Optimizer for TensorFlow* Prerequisites

Configuring Caffe*

Converting Your TensorFlow* Model

Configuring Model Optimizer for TensorFlow* Prerequisites

What is Intel® DAAL?

应用相关的论文

Pedestrian Detection Using TensorFlow* on Intel® Architecture

tensorflow 监测交通灯

CIFAR-10 分类-tensorflow

构建安装TensorFlow* Serving on Intel® Architecture

Train and Use a TensorFlow* Model on Intel® Architecture

Using the Model Optimizer to Convert TensorFlow* Models

视频 Performance Optimization of Deep Learning Frameworks Caffe* and TensorFlow* for the Intel® Xeon Phi™ Product Family

单节点完整使用教程

tensorflow intel platform 优化的更多相关文章

  1. TensorFlow实现与优化深度神经网络

    TensorFlow实现与优化深度神经网络 转载请注明作者:梦里风林Github工程地址:https://github.com/ahangchen/GDLnotes欢迎star,有问题可以到Issue ...

  2. 好用的函数,assert,random.sample,seaborn tsplot, tensorflow.python.platform flags 等,持续更新

    python 中好用的函数,random.sample等,持续更新 random.sample random.sample的函数原型为:random.sample(sequence, k),从指定序列 ...

  3. 编译TensorFlow CPU指令集优化版

    编译TensorFlow CPU指令集优化版 如题,CPU指令集优化版,说的是针对某种特定的CPU型号进行过优化的版本.通常官方给的版本是没有针对特定CPU进行过优化的,有网友称,优化过的版本相比优化 ...

  4. TensorFlow 学习(十五)—— tensorflow.python.platform

    tensorflow.python.platform 下的常用工具类和工具函数:tensorflow/tensorflow/python/platform at master · tensorflow ...

  5. 2019-09-16 16:42:03.621946: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA Traceback (most recent cal

    -- ::] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA ...

  6. W tensorflow/core/platform/cpu_feature_guard.cc:45]

    W tensorflow/core/platform/cpu_feature_guard.cc:] The TensorFlow library wasn't compiled to use SSE3 ...

  7. TensorFlow 深度学习笔记 TensorFlow实现与优化深度神经网络

    转载请注明作者:梦里风林 Github工程地址:https://github.com/ahangchen/GDLnotes 欢迎star,有问题可以到Issue区讨论 官方教程地址 视频/字幕下载 全 ...

  8. Tensorflow 中的优化器解析

    Tensorflow:1.6.0 优化器(reference:https://blog.csdn.net/weixin_40170902/article/details/80092628) I:  t ...

  9. 『TensorFlow』梯度优化相关

    tf.trainable_variables可以得到整个模型中所有trainable=True的Variable,也是自由处理梯度的基础 基础梯度操作方法: tf.gradients 用来计算导数.该 ...

随机推荐

  1. 监督学习之knn算法

    1.1  KNN(K-Nearest Neighbor)工作原理: 存在一个样本数据集合,也称为训练样本集,并且样本集中每个数据都存在标签,即我们知道样本集中每一数据与所属分类对应的关系.输入没有标签 ...

  2. linux安装svn客户端rabbitvcs

    我们都知道,自从svn出道以来,很多人都预言,cvs将会被其取代.就如同他们预言maven要取代ant一样.可见,svn的流行.在Windows中,最常用到的开源免费的svn客户端就是Tortoise ...

  3. JQuery 获取页面某一元素在屏幕上的位置

    获取页面某一元素的绝对X,Y坐标 var X = $('#ElementID').offset().top;//元素在当前视窗距离顶部的位置 var Y = $('#ElementID').offse ...

  4. Ubuntu下orbbec mini 无法正常显示图像问题

    最近用orbbec的深度摄像头采集RGBD图像,Windows下一切OK.但是Ubuntu下出现了不少问题.总结一下 1.将设备插到USB,先确定电脑能否正常识别设备 Ubuntu下是不需要安装驱动的 ...

  5. 连接mysql && ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

    上一篇:mysql服务正在启动 mysql服务无法启动 && mysql启动脚本 mysql关闭脚本 此篇目编写一个核心目的: 1.mysql连接 先抛出一个问题 这是因为mysql服 ...

  6. Install the mongdb

    #!/bin/bash#Function: Install the mongdb#Author: WangDonghui#Date: 20180124 #Installing mongdbecho & ...

  7. MYSQLi数据访问修改数据

    <link href="../bootstrap.min.css" rel="stylesheet" type="text/css" ...

  8. Rpgmakermv(30) GameQuest任务插件

    插件简介: 很牛X的任务插件(个人目前用过中的) 插件用法说明 Report any bugs, editor or plugin related here: http://forums.rpgmak ...

  9. 20165305 苏振龙《Java程序设计》第一周学习总结

    20165305 <Java程序设计>第一周学习总结 教材学习内容总结 我重点学习了jdk安装后面的第一章内容,算是更进一步的的了解了一些Java方面的基础知识. Java平台概论 Jav ...

  10. Git相关整理以及学习

    1.取消还未进入暂存区的修改 git checkout + 文件名 2.取消已经进入暂存区但是还未提交的修改 git reset HEAD + 文件名 3.清理在远程仓库已经被删除的本地分支 git ...