Python can be accelerated by having the numerical libraries, NumPy and SciPy, use the Intel® Math Kernel Library (Intel® MKL). This requires no change to your Python application, and instantly optimizes performance on Intel processors, including Intel® Xeon® processors and Intel® Xeon Phi™ processors (codenamed Knights Landing). Note: Intel MKL is supported as part of several Intel products, and is also is available free to anyone, under a community license.
There are several ways to do this, the easiest being simply to use a distribution which already optimizes Python libraries with Intel MKL.
Here is a list of distributions, which are available for free, which offer accelerated Python performance:
- Optimized Intel® Distribution for Python: https://software.intel.com/python-distribution
- Continuum Analytics, Anaconda Innovation Combines Intel MKL to Enhance Analytics Performance: https://www.continuum.io/blog/news/latest-anaconda-innovation-combines-intel-mkl-enhance-analytics-performance-7x
You can also build the libraries yourself to use Intel MKL. Instructions for doing so, along with other performance oriented tuning advice/tips, can be found at https://software.intel.com/runtimes/python. For offloading to Intel Xeon Phi coprocessors, you may be interested in pyMIC - read about it at https://software.intel.com/en-us/articles/pymic-a-python-offload-module-for-the-intelr-xeon-phitm-coprocessor.