This fork of Theano/Theano is dedicated to improve its performance on CPU device, in particular Intel® Xeon® processors and Intel® Xeon Phi™ processors.
Clone or download
Pull request Compare This branch is 61 commits ahead, 4352 commits behind Theano:master.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.jenkins remove nose testsuite prefix option Oct 7, 2016
benchmark removed duplicates Mar 23, 2016
bin fixed nosetest doc, who put this anyway? Mar 25, 2016
democase/alexnet change ignore_border to False for MKL pool Feb 6, 2017
doc Merge pull request Theano#4039 from Sentient07/gpu_optimization Sep 30, 2016
theano add default env setting for Xeon Jun 15, 2017
.gitignore Fix typos and other doc/comment issues, add .idea to .gitignore, and … Aug 1, 2016
.mailmap Add email mapping Sep 23, 2016
.travis.yml Revert a change to try to fix travis on master. It is the only think … Sep 20, 2016
CONTRIBUTING.md Adding issue and PR template to Theano repo (Theano#4952) Sep 12, 2016
DESCRIPTION.txt Minor cosmetic change in doc Dec 7, 2011
EMAIL.txt Small update to the email annonce template. Oct 3, 2012
HISTORY.txt Chagne CuDNN to cuDNN at all other places Apr 12, 2016
ISSUE_TEMPLATE.md Add information in the issue template Sep 19, 2016
Install_Guide.pdf update document and unit test of lrn Jan 24, 2017
LICENSE.txt added many stubs to the advanced section of the docs Feb 26, 2009
MANIFEST.in Fix doc inclusion in `sdist`s. Sep 20, 2016
NEWS.txt Update news and add new article May 10, 2016
NEWS_DEV.txt Update news in the dev version Sep 27, 2016
README.md Remove KNL special setting Jul 27, 2017
README.txt Update README.txt Jun 9, 2016
Theano.pyproj Removed downsample.py Aug 18, 2016
Theano.sln Created Visual Studio Python project Nov 29, 2011
get_self_contained_mkl.sh Delete trailing whitespace in get_self_contained_mkl.sh. Jan 23, 2017
requirement-rtd.txt Added dependencies in requirement-rtd.txt and travis Apr 7, 2016
setup.cfg Added the ingored errors to setup.cfg file Mar 23, 2016
setup.py 1. Add support to self-contained mkldnn lib. 2. Update nnet/corr.py a… Jan 23, 2017
theanorc_gcc_mkl Add mklml flag Apr 18, 2017
theanorc_icc_mkl Add MKLML flags Apr 18, 2017

README.md

Intel Software Optimization for Theano*


This repo is dedicated to improving Theano performance on CPU, especially in Intel® Xeon® and Intel® Xeon Phi™ processors.

Key Features

  • New backend of Intel® MKL (version >= 2017.0 which includes neural network primitives)
  • Advanced graph optimizations
  • CPU friendly OPs
  • Switch to Intel® MKL backend automatically in Intel® Architecture
  • Out-of-box performance improvements for legacy models
  • Transparently supports for Keras (Lasagne, etc.) workloads

Benchmark

  • Hardwares
    • Intel® Xeon® CPU E5-2699 v4 @ 2.20GHz, 128GB RAM
    • Intel® Xeon Phi™ CPU 7250F @ 1.40GHz, 98G RAM
  • Softwares
  • Terminologies
    • FWD, forward for inference
    • FWD+BWD, forward and backward for training
  • Results
FWD:sec/batch Stock Theano/Xeon Intel Theano/Xeon Intel Theano/Xeon Phi
AlexNet 1.045 0.077 0.054
GoogLeNet 2.228 0.280 0.169
VGG 5.089 0.836 0.570
OverFeat 6.105 0.273 0.185

--

FWD+BWD: sec/batch Stock Theano/Xeon Intel Theano/Xeon Intel Theano/Xeon Phi
AlexNet 2.333 0.239 0.186
GoogLeNet 5.866 0.860 0.568
VGG 12.783 2.699 1.902
OverFeat 13.202 0.865 0.636

Performance Tips

  • Add bias after convolution to archieve high performance since this sub-graph can be replaced with MKL Op
  • Use group convolution OP, AbstractConvGroup
  • Use New MKL OP: LRN

Branch Information

  • master, stable and fully tested version based on 0.9dev2 with Intel® MKL backend
  • nomkl-optimized, based on 0.9.0dev1 with generic optimizations
  • others, experimental codes for different applications which may be merged into master and/or deleted soon

Installation

  • Environment Setting

    Set Intel MKL library path into both LD_LIBRARY_PATH and LIBRARY_PATH

  • Quick Commands

    git clone https://github.com/intel/theano.git intel-theano
    cd intel-theano
    python setup.py build
    python setup.py install --user [--mkl]   # Note: using 'mkl' option will check and download MKL if it is not available
    cp intel-theano/theanorc_icc_mkl ~/.theanorc
    
  • Check Intel MKL

```
python theano/theano/sandbox/mkl/tests/test_mkl.py
     WARNING (theano.gof.cmodule): WARNING: your Theano flags `gcc.cxxflags` specify an `-march=X` flags.
     It is better to let Theano/g++ find it automatically, but we don't do it now
     mkl_available: True
     mkl_version: 20170209
     .
     ----------------------------------------------------------------------
     Ran 1 test in 2.213s

     OK
```
  • Run Benchmark
```
python democase/alexnet/benchmark.py
```

Other Optimized Software

  • Self-contained MKL in here
  • Optimized Numpy in here

* Other names and trademarks may be claimed as the property of others.