6

I love being able to use Christoph Gohlke's numpy-MKL version of NumPy linked to Intel's Math Kernel Library on Windows. However, I have been unable to find a similar version for OS X, preferably NumPy 1.7 linked for Python 3.3 on Mountain Lion. Does anyone know where this might be obtained?

EDIT:

So after a bit of hunting I found this link to evaluate Intel's Composer XE2013 studios for C++ and Fortran (both of which contain the MKL), as well as a tutorial on building NumPy and SciPy with it, so this will serve for the present. However, the question remains - is there a frequently-updated archive for OS X similar to Christoph Gohlke's? If not, why not? :)

7
  • 2
    I'd recommend linking it yourself, but unfortunately, MKL isn't available for free noncommercial use on OSX (it is on Linux and Windows). Intel says this is because "The Intel compilers deliver superb capabilities and performance leading to a very large majority of our customers choosing to purchase the Intel® C++ Composer XE 2011." The cheapest Composer variant is $129 for an academic single-user license. Thanks, Intel... Commented Mar 27, 2013 at 17:33
  • 1
    That said, EPD includes a numpy linked to MKL and has free academic licenses. It uses python 2.7, but you might be able to rip out just the MKL parts and link a numpy for 3.3 to it. I just use the system Accelerate framework, but I also run my big problems on Linux servers and use MKL there. Commented Mar 27, 2013 at 17:34
  • @Dougal - unfortunately, the 30-day free evaluation link is a 404. Any specific ideas on how to reverse-engineer EPD? I'd rather have 64-bit support if I can... Commented Mar 27, 2013 at 17:36
  • 1
    @Dougal: the free version of EPD does not include MKL: stackoverflow.com/questions/14946512/… Commented Mar 27, 2013 at 17:49
  • @WarrenWeckesser No, but for those of us in academia (read: have a .edu email address), there are free academic licenses for the full version of EPD. Commented Mar 27, 2013 at 18:07

3 Answers 3

4

Intel has release their MKL under a community license, which is free, with limited technical support. Currently MKL under the Community License is available for Linux and Windows, and it is expected they will provide a version for Mac OS X soon.

https://software.intel.com/en-us/comment/1839012

In one of their recent webinars, I asked for their plans for a Mac OS X MKL under the community license. They say it is coming soon.

Update 2:

Continuum provides Anaconda Python with Intel MKL included for all platforms.

https://www.anaconda.com/blog/developer-blog/anaconda-25-release-now-mkl-optimizations/

Intel even makes it easy to compile and link against the MKL from the Anaconda Python distribution.

https://software.intel.com/en-us/articles/using-intel-distribution-for-python-with-anaconda

Update:

It now appears that Intel has their own version of Python that they are providing to beta testers.

https://software.intel.com/en-us/forums/intel-distribution-for-python/topic/581593

Sign up to request clarification or add additional context in comments.

Comments

3

I know that this is an older question, but in case it comes up for someone who is searching: I would recommend trying out anaconda. For $29.00 they have an add-on that includes mkl optimized numpy + scipy.

Comments

2

MacPorts seems to have recently added an MKL variant to their NumPy port (as well as to SciPy and PyTorch). Tested on my 16” MacBook Pro 2019 with 2.4GHz 8-core Intel Core i9 and macOS Ventura 13.0.1, Numpy with MKL is significantly faster than Numpy with the Accelerate framework, which is another fast replacement for OpenBLAS that is built into macOS. I tested using this code which I got from Puget Systems:

import numpy as np
import time
n = 20000
A = np.random.randn(n,n).astype('float64')
B = np.random.randn(n,n).astype('float64')
start_time = time.time()
nrm = np.linalg.norm(A@B)
print(" took {} seconds ".format(time.time() - start_time))
print(" norm = ",nrm)

The result of my testing is that Numpy with mkl took ~47 seconds while Numpy with accelerate took ~66 seconds. Accelerate also used more threads.

To install this with MacPorts you first have to install MacPorts, then run sudo port install py310-numpy -openblas +mkl in the terminal.

1 Comment

Thanks for this, I'm actually going to accept this as the answer after all these years. This is exactly what I was looking for back then - a way to install MKL-accelerated NumPy without having to build it myself, which I had to do after downloading the MKL itself from Intel. I use MacPorts for a lot of software, and I don't like the Anaconda model or distribution, so this is perfect. Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.