2

While conda does a great job of installing a maximally performant NumPy, pip leaves me with a 6x performance reduction by comparison. How can I get pip to install NumPy, such that it yields the same performance as when installed via conda?

dbanas
  • 1,707
  • 14
  • 24
  • @mozway: the linked dupe explains why there is a performance difference (probably). But I don't see how it answers this question. (The linked question sought an explanation; this question seeks a fix.) – rici Dec 06 '22 at 15:19
  • Well, there's a [MKL version of numpy](https://pypi.org/project/intel-numpy/) available at PyPi. – Abraham Tugalov Dec 06 '22 at 15:20
  • @rici fair enough I'll reopen, here is the [duplicate link](https://stackoverflow.com/questions/53197337/running-quicker-for-numpy-and-pandas-installed-via-conda-than-via-pip) for reference – mozway Dec 06 '22 at 15:23

1 Answers1

1

You should install intel-numpy package via pip, in order to get the same performance.
Read more about why this happens here.

In short, conda version was built with MKL.
And the PyPi numpy package was build using BLAS and LAPACK.

p.s. Also that's the reason why Numpy sucks so much with the famous Ryzen Threadripper by default.
But I must say there was a workaround to make MKL work on AMD processors, but intel fixed and removed this possibility.

Abraham Tugalov
  • 1,902
  • 18
  • 25
  • Thanks @Abraham! How about for the new Macs w/ Apple silicon? – dbanas Dec 07 '22 at 13:58
  • @dbanas Currently I own macbook with Intel processor, so I don't face this issue. But, there was a discussion on Stackoverflow about installing Numpy with Apple's vecLib, [check out this question](https://stackoverflow.com/questions/70240506/why-python-native-on-m1-max-is-greatly-slower-than-python-on-old-intel-i5). – Abraham Tugalov Dec 07 '22 at 15:37