I've managed to compile tensorflow with MKL on Mac OS X. The ingredients were roughly:
1. Download MKL from Intel's website, install to /usr/local/lib/
2. Change tensorflow's configure script to look for the downloaded library on OS X instead of just aborting.
3. Possibly change some other bazel build files to look for .dylib instead of .so files.
4. Build with extra flags to look for the appropriate libraries.
I'm not sure if all these steps are necessary but they were sufficient.
The reason I had install to /usr/local/lib/ instead of Intel's suggestion of /opt/intel/something was that, with the latter, even though I passed the appropriate directory to the linker, I think there was still some intermediate binary that wasn't seeing that path. Putting the dylibs in the default directory solved that.
I can't contribute my patch because I did this on my employer's computer and it'd be an enormous hassle to work out the licensing stuff.
Are there any comparisons of MKL to the GPU versions? Because this appears to be an attempt by Intel to stay relevant in the field, and I'm sceptical when the hardware vendors are creating implementations that they couldn't get projects to do themselves.
If you're working on Mac without an NVIDIA GPU, the best bet may be openCL. I've seen a lot of commits for that, and when it's ready I'd be surprised if even MacBook GPUs didn't run laps around CPUs.
1. Download MKL from Intel's website, install to /usr/local/lib/
2. Change tensorflow's configure script to look for the downloaded library on OS X instead of just aborting.
3. Possibly change some other bazel build files to look for .dylib instead of .so files.
4. Build with extra flags to look for the appropriate libraries.
I'm not sure if all these steps are necessary but they were sufficient.
The reason I had install to /usr/local/lib/ instead of Intel's suggestion of /opt/intel/something was that, with the latter, even though I passed the appropriate directory to the linker, I think there was still some intermediate binary that wasn't seeing that path. Putting the dylibs in the default directory solved that.
I can't contribute my patch because I did this on my employer's computer and it'd be an enormous hassle to work out the licensing stuff.