当前位置: 首页 > 编程日记 > 正文

tensorflow intel platform 优化

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/tmpURL=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.shchmod +x bazel-*
./bazel-*
export PATH=/usr/local/bin:$PATHpopd

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=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-stack-el7/pubkey.gpg
enabled=1
enabled_metadata=1
EOFyum 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.5-3.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 imageexport TF_DOCKER_BUILD_IS_DEVEL=YES
# Is this developer imageexport TF_DOCKER_BUILD_DEVEL_BRANCH=r1.99
# 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.0) 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.
View Code

参考:

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

单节点完整使用教程

转载于:https://www.cnblogs.com/shaohef/p/8968283.html

相关文章:

basePath = request.getScheme()+://+request.getServerName()+:+r

basePath request.getScheme()"://"request.getServerName()":"r (2014-06-30 18:29:54) 转载▼标签&#xff1a; 宠物 分类&#xff1a; JavaString path request.getContextPath();String basePath request.getScheme()"://"request.getSe…

python dump函数_python中实现php的var_dump函数功能

最近在做python的web开发(原谅我的多变&#xff0c;好东西总想都学着。。。node.js也是)&#xff0c;不过过程中总遇到些问题&#xff0c;不管是web.py还是django&#xff0c;开发起来确实没用php方便&#xff0c;毕竟存在的时间比较短&#xff0c;很多不完善的地方。比如我在调…

Go语言的Channel文章,整个人都感觉不好了

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 Go的Channel是一个很强大的并发数据模型&#xff0c;在一个发送者和多个消费者情况下工作得最好&#xff0c;但是如果是多个发送者&#xff0c;那么…

图书管理系统(源码)

本文demo下载地址&#xff1a;http://www.wisdomdd.cn/Wisdom/resource/articleDetail.htm?resourceId1070 实例使用java语言实现了一个网页版的图片管理系统, 系统前端使用bootstrap技术&#xff0c;可以进行浏览器适配, 实现功能: 管理图书管书, 管理图书借还信息&#xff0…

linux 如何禁用账号和解除禁用账号

把账号禁用可以有几个方法&#xff1a;1. # usermod -L <username> # usermod -U <username> // 解除禁用2. 修改/etc/passwd文件&#xff0c;可以有几个地方1&#xff09;把第二个字段中的"x"变成其它的字符&#xff0c;该账号就不能…

maya批量命名插件_教你玩转MAYA的四十二精华造诣(第一期)

最近在整理文档时发现我收藏了一篇关于MAYA应用技巧的文章&#xff0c;突然有兴趣看了看&#xff0c;结果发现老版本MAYA中的某些内容很多已经无法应用于新版本。我又上网查了一下&#xff0c;结果发现网上好多帖子和我收藏的这篇内容基本一致&#xff0c;看来好多都是转载和抄…

Go语言开发常见陷阱,你遇到过几个?

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 Go作为一种简便灵巧的语言&#xff0c;深受开发者的喜爱。但对于初学者来说&#xff0c;要想轻松驾驭它&#xff0c;还得做好细节学习工作。 初学者…

sxoi爆炸祭

好吧&#xff0c;纯粹是去玩玩的&#xff0c;我这么一个弱省的蒟蒻&#xff0c;进队纯粹是开玩笑。。。。 Day0 去五中试机&#xff0c;感觉电脑手感不错&#xff0c;打了半个线段树的板子才发现试机要在自己的电脑上试&#xff0c;然后我无奈的搬东西&#xff08;从26号搬到2号…

wiki多个文件一起导入_mac文件信息管理工具EagleFiler for Mac分享给大家

EagleFiler for mac使得管理您的信息方便。它可以让你存档和搜索邮件&#xff0c;网页&#xff0c;PDF文件&#xff0c;字处理文档&#xff0c;图像&#xff0c;等等。使用它可以从不同的来源收集信息。浏览不同类型的文件采用标准的三窗格界面。组织他们到文件夹中&#xff0c…

【bzoj1951】 Sdoi2010—古代猪文

http://www.lydsy.com/JudgeOnline/problem.php?id1951 (题目链接) 题意 废话一堆。。求解&#xff1a;$$g^{\sum_{d|n} C_n^d}~mod~p$$ Solution 真的是数论经典题&#xff0c;什么都用上了。 因为费马小定理&#xff0c;每$p-1$个$g$相乘会得到$1$&#xff0c;那么容易得到&…

区块链之智能合约详解

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 什么是智能合约&#xff1f; 智能合约又称智能合同&#xff0c;是由事件驱动的、具有状态的、获得多方承认的、运行在区块链之上的、且能够根据预设…

子类化内置类型

Python 2.2之后内置类型开始可以子类化了 但是&#xff0c;CPython中的内置类型不会调用用户重写的类的特殊方法。 PyPy的文档中描述了这个问题。subclasses-of-built-in-types 正式情况下&#xff0c;CPython 并没有官方规定内置类型的子类中重写的方法是否会被隐式调用。基本…

网上商城系统源代码_多用户系统商城授权有几种方式?

网上商城系统一般都需要获取正规授权才可以投入商业使用范围&#xff0c;许多系统开发商为了适应不同企业的需求提供了几种不同的授权方式&#xff0c;企业可以选择合适的方式获得系统的使用权。下面HiShop小编就来为大家介绍一下多用户商城系统的授权方式。一、多用户系统商城…

java学习:对synchronized的测试

平时对synchronized这个关键字没有太在意&#xff0c;对它的认识停留在粗略翻了一下百度百科的状态&#xff0c;百度百科对它的解释是&#xff1a; “Java语言的关键字&#xff0c;可用来给对象和方法或者代码块加锁&#xff0c;当它锁定一个方法或者一个代码块的时候&#xff…

Selenium(3)

练习1&#xff1a;Ecshop  录制登录后退出业务  打开系统  存储页面的标题     a.点击"登录"按钮     b.输入用户名&#xff1a;testing      存储输入的用户名     c.输入密码&#xff1a;123456     d.点击"立即登录"按钮 …

php 爬虫_Rad爬虫结合W13Scan扫描器挖掘漏洞

一、背景这几天一直在研究W13Scan漏洞扫描器&#xff0c;因为对Python不是太熟悉&#xff0c;所以进度有点慢&#xff0c;一直没看懂怎么将代理请求的数据转发到扫描队列中去&#xff0c;决定先熟悉熟悉这个功能再说&#xff1b;Rad爬虫最近比较火&#xff0c;于是就是就选择它…

Python 爬取网页HTML代码

#/usr/bin/env python #-*- coding:utf-8 -*-import urllib2 import sys import chardetreq urllib2.Request("http://tycool.top/") content urllib2.urlopen(req).read() typeEncode sys.getfilesystemencoding()##系统默认编码 infoencode chardet.detect(con…

区块链兼容以太坊智能合约

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 引言 随着区块链技术以及应用的普及&#xff0c;越来越多的区块链出现在大众视野中。由于区块链技术的开源特性&#xff0c;任何公司和个人都可以…

Linux常用命令--网终设置

1、把自己&#xff08;sa&#xff09;添加到sudoers配置文件中&#xff0c;以便于获取权限 vim /etc/sudoers 编辑文件&#xff08;部分centOS版本没有vim命令&#xff0c;则用vi即可&#xff09; 找到【root ALL(ALL) ALL】语句&#xff0c;在下面添加&#xff1a; sa ALL…

python示例异常处理与程序调试_笔记:Python异常处理与程序调试

Python异常处理与程序调试Python提供了强大的异常处理机制&#xff0c;通过捕获异常可以提高程序的健壮性。异常处理还具有释放对象&#xff0c;中止循环的运行等作用。在程序运行的过程中&#xff0c;如果发生了错误&#xff0c;可以返回事先约定的一个错误代码。"try...…

js传入参数为字符串问题

示例&#xff1a; var device_mac"11qweq234ert";//第一种方式会报错&#xff1a;Onclick SyntaxError: identifier starts immediately after numeric literal&#xff0c;数字后面紧跟着字符这种写法只有device_mac是数字的时候是正确的。传入的为字符串则应该使用…

区块链热度背后的资本市场

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 进入2018年之后大家对于加密数字货币以及区块链等话题都各自有各自的意见和想法&#xff0c;很多人觉得区块链技术和加密数字货币是泡沫&#xff…

袋鼠过河(动态规划)

题目描述 一只袋鼠要从河这边跳到河对岸&#xff0c;河很宽&#xff0c;但是河中间打了很多桩子&#xff0c;每隔一米就有一个&#xff0c;每个桩子上都有一个弹簧&#xff0c;袋鼠跳到弹簧上就可以跳的更远。每个弹簧力量不同&#xff0c;用一个数字代表它的力量&#xff0c;如…

jenkins-svn配置

转载于:https://www.cnblogs.com/caer/p/5924337.html

python查看所有异常_如何获取python异常发生的实际行号?

如果你想按你描述的那样做from functools import wrapsimport sys, os, tracebackdef catch_exceptions(function):wraps(function)def decorator(*args, **kwargs):try:return function(*args, **kwargs)except Exception as e:exc_type, exc_obj, exc_tb sys.exc_info()prin…

区块链从一夜暴富到一夜暴“负”的辛酸史

3.15打假日&#xff0c;打假虽然年年有&#xff0c;但与往年有别的是&#xff0c;今年区块连技术得到了诸多重视以及初步发展&#xff0c;一些带有诈骗性质的数字资产交易所在用血腥的方式不断收割着更低层级的用户&#xff0c;而这些平台的受害者&#xff0c;却往往得不到任何…

iOS消息转发

消息转发是一种功能强大的技术&#xff0c;可以大大增加Objective-C的表现力。什么是消息转发&#xff1f;简而言之&#xff0c;它允许未知的消息被困住并作出反应。换句话说&#xff0c;无论何时发送未知消息&#xff0c;它​​都会以一个很好的包发送到您的代码中&#xff0c…

python参数类型限定_python限定方法参数类型、返回值类型、变量类型等|python3教程|python入门|python教程...

https://www.xin3721.com/eschool/python.htmltyping模块的作用自python3.5开始&#xff0c;PEP484为python引入了类型注解(type hints)类型检查&#xff0c;防止运行时出现参数和返回值类型、变量类型不符合。作为开发文档附加说明&#xff0c;方便使用者调用时传入和返回参数…

CentOS VMware 配置IP小结 静态 配置 桥接 NAT

系统启动后可先ping下外网或局域网内其它机器。如果配置虚拟机时选择的NAT上网方式&#xff0c;后面需要配置固定IP&#xff0c;请先参见VMware NAT方式下设置静态IP获得可用的IP范围和网关等信息。先将ifcfg-eth0备份到home目录下&#xff0c;不要放在与它同一目录下&#xff…

区块链简史:解读这场技术革命的前世今生

链客&#xff0c;专为开发者而生&#xff0c;有问必答&#xff01; 此文章来自区块链技术社区&#xff0c;未经允许拒绝转载。 真格基金徐小平的一个“内部讲话”被泄露&#xff0c;揭开了创投圈对区块链的新一轮热衷。 在这份微信群的“内部讲话”中&#xff0c;徐小平把区块…