Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.
424 Discussions

Intel® Optimization for TensorFlow* Wheel Now Available

Christophe_H_Intel2
2,118 Views

Intel® Optimization for TensorFlow* is now available for Linux* as a wheel installable through pip.

For more information on the optimizations as well as performance data, see this blog post.

To install the wheel into an existing Python* installation, simply run

# Python 2.7
pip install https://anaconda.org/intel/tensorflow/1.2.1/download/tensorflow-1.2.1-cp27-cp27mu-linux_x86_64.whl

# Python 3.5
pip install https://anaconda.org/intel/tensorflow/1.2.1/download/tensorflow-1.2.1-cp35-cp35m-linux_x86_64.whl

# Python 3.6
pip install https://anaconda.org/intel/tensorflow/1.2.1/download/tensorflow-1.2.1-cp36-cp36m-linux_x86_64.whl

To create a conda environment with Intel Tensorflow that also takes advantage of the Intel Distribution for Python’s optimized numpy, run

conda create -n tf -c intel python=<2|3> pip numpy
. activate tf
# Python 3.5
pip install https://anaconda.org/intel/tensorflow/1.2.1/download/tensorflow-1.2.1-cp35-cp35m-linux_x86_64.whl
# Python 2.7
pip install https://anaconda.org/intel/tensorflow/1.2.1/download/tensorflow-1.2.1-cp27-cp27mu-linux_x86_64.whl

Chris

0 Kudos
7 Replies
Randy_M_1
Beginner
2,118 Views

 

Thank you so much for this Chris!

Is there any plan to release optimized PyTorch as well?  I am switching from TensorFlow to PyTorch and I am aware of many other researchers who are switching as well.

 

 

0 Kudos
Corrado_A_
Beginner
2,118 Views

No SSE4/AVX instructions.

Whatever installation method I choose, I keep getting the message "The TensorFlow library wasn't compiled to use SSE4.1/SSE4.2/AVX instructions".

Methods I tried:

$ conda create -n intel_tf -c intel --override-channels python=3 tensorflow
$ conda create -n intel_tf -c intel --override-channels python=2.7 tensorflow
$ conda create -n tf -c intel python=2 pip numpy && . activate tf && pip install https://anaconda.org/intel/tensorflow/1.2.1/download/tensorflow-1.2.1-cp27-cp27mu-linux_x86_64.whl

The code to test it simply was:

$ python -c 'import tensorflow as tf; tf.Session()'

All the previous commands have been tried with and without setting PYTHONNOUSERSITE=1.
Just to be explicit, none of the listed commands raised error, only the Session instantiation printed out the reported warnings.

My configuration:

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                12
On-line CPU(s) list:   0-11
Thread(s) per core:    2
Core(s) per socket:    6
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Model name:            Intel(R) Xeon(R) CPU E5-1650 v2 @ 3.50GHz
Stepping:              4
CPU MHz:               1678.222
CPU max MHz:           3900,0000
CPU min MHz:           1200,0000
BogoMIPS:              6982.94
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              12288K
NUMA node0 CPU(s):     0-11
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts

$ uname -a
Linux pc107 4.4.0-92-generic #115-Ubuntu SMP Thu Aug 10 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial

$ conda info
Current conda install:

               platform : linux-64
          conda version : 4.3.25
       conda is private : False
      conda-env version : 4.3.25
    conda-build version : not installed
         python version : 2.7.13.final.0
       requests version : 2.13.0
       root environment : ~/miniconda2  (writable)
    default environment : ~/miniconda2
       envs directories : ~/miniconda2/envs
                          ~/.conda/envs
          package cache : ~/miniconda2/pkgs
                          ~/.conda/pkgs
           channel URLs : https://conda.anaconda.org/intel/linux-64
                          https://conda.anaconda.org/intel/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : ~/.condarc
             netrc file : ~/.netrc
           offline mode : False
             user-agent : conda/4.3.25 requests/2.13.0 CPython/2.7.13 Linux/4.4.0-92-generic debian/stretch/sid glibc/2.23    
                UID:GID : 1000:1000

$ cat ~/.condarc
channels:
  - intel
  - defaults

 

0 Kudos
Yong_J_Intel
Employee
2,118 Views

I get the same message. Is that normal?

0 Kudos
Robert_C_Intel
Employee
2,118 Views

The message is normal. Intel has implemented TF primitives with MKL-DNN, which takes advantage of the AVX2, AVX512, etc. The warning is coming from a part of the code that is not performance sensitive when MKL-DNN is used. It would make sense to disable the warning when KL-DNN is used, but that has not happened.

0 Kudos
Skala__Mike
Beginner
2,118 Views

Are there plans to release an optimized version of TensorFlow for Windows? 

The latest TF I could find in CONDA in the intel channel is "1.1.0-np112py36_0" which is quite old...

Mike

0 Kudos
prelovac__vladimir
2,118 Views

What is the timeline for MacOS wheel?

0 Kudos
Minh_H_
Beginner
2,118 Views

Hi,

It seems that this version does not use Xeon Phi Knight Corners cards plugging  to host. I try to run some tests. It only use CPU  and does not any Xeon Phi Cards. Are there any way to use  Xeon Phi Cards as Automatic Offload for MKL as in  Fortran/C/C++?

 Thanks,

  Minh

0 Kudos
Reply