<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-07-16T17:42:49.780763Z",
     "start_time": "2018-07-16T17:42:49.775392Z"
    }
   },
   "source": [
    "- title: Using High Performance Libraries with Python\n",
    "- author: <NAME>\n",
    "- date: 2018-07-16\n",
    "- category: Setup\n",
    "- tags: mkl"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Using High Performance Libraries with Python\n",
    "\n",
    "## Compiling Tensorflow with Intel MKL support for Mac\n",
    "\n",
    "The simplest and fastest way to get Intel MKL support in tensorflow is by using [Intel Distribution for Python](https://software.intel.com/en-us/articles/using-intel-distribution-for-python-with-anaconda) with the conda package manager.\n",
    "\n",
    "By using the `intelpython3_full` (providing Python 3.6.3 at the moment), you get `numpy` and `scipy` MKL-accelerated libraries out of the box. Unfortunately, there is not an easy way to install Tensorflow compiled with MKL support *on Mac OS X* at this moment. We must compile the library from source to get MKL support.\n",
    "\n",
    "Here are the steps *I* followed:\n",
    "\n",
    "*1*. Get [Intel Distribution for Python](https://software.intel.com/en-us/articles/using-intel-distribution-for-python-with-anaconda).\n",
    "\n",
    "```\n",
    "$ conda create -n idp intelpython3_full python=3\n",
    "$ conda activate idp\n",
    "$ conda env list                                                                                                       \n",
    "# conda environments:\n",
    "#\n",
    "base                     /usr/local/anaconda3\n",
    "idp                   *  /usr/local/anaconda3/envs/idp\n",
    "```\n",
    "\n",
    "We will need to know where to find MKL libraries to be able to compile tensorflow. For my particular case, I will need to use `MKLROOT=/usr/local/anaconda3/envs/idp`\n",
    "\n",
    "*2*. Install `tensorflow=1.9.0` from [here](https://github.com/aaronzs/conda-tensorflow)\n",
    "\n",
    "```\n",
    "# TensorFlow CPU only\n",<commit_msg>Updating title<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-07-16T17:42:49.780763Z",
     "start_time": "2018-07-16T17:42:49.775392Z"
    }
   },
   "source": [
    "- title: Using High Performance Libraries with Python\n",
    "- author: <NAME>\n",
    "- date: 2018-07-16\n",
    "- category: Setup\n",
    "- tags: mkl"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Compiling Tensorflow with Intel MKL support for Mac\n",
    "\n",
    "The simplest and fastest way to get Intel MKL support in tensorflow is by using [Intel Distribution for Python](https://software.intel.com/en-us/articles/using-intel-distribution-for-python-with-anaconda) with the conda package manager.\n",
    "\n",
    "By using the `intelpython3_full` (providing Python 3.6.3 at the moment), you get `numpy` and `scipy` MKL-accelerated libraries out of the box. Unfortunately, there is not an easy way to install Tensorflow compiled with MKL support *on Mac OS X* at this moment. We must compile the library from source to get MKL support.\n",
    "\n",
    "Here are the steps *I* followed:\n",
    "\n",
    "*1*. Get [Intel Distribution for Python](https://software.intel.com/en-us/articles/using-intel-distribution-for-python-with-anaconda).\n",
    "\n",
    "```\n",
    "$ conda create -n idp intelpython3_full python=3\n",
    "$ conda activate idp\n",
    "$ conda env list                                                                                                       \n",
    "# conda environments:\n",
    "#\n",
    "base                     /usr/local/anaconda3\n",
    "idp                   *  /usr/local/anaconda3/envs/idp\n",
    "```\n",
    "\n",
    "We will need to know where to find MKL libraries to be able to compile tensorflow. For my particular case, I will need to use `MKLROOT=/usr/local/anaconda3/envs/idp`\n",
    "\n",
    "*2*. Install `tensorflow=1.9.0` from [here](https://github.com/aaronzs/conda-tensorflow)\n",
    "\n",
    "```\n",
    "# TensorFlow CPU only\n",
{'fraction_non_alphanumeric': 0.15619136960600374, 'fraction_numerical': 0.029080675422138838, 'mean_word_length': 2.3164852255054433, 'pattern_counts': {'":': 20, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3626386', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1409, 'n_words': 391}