Hacker News new | ask | show | jobs
by raphaelrk 1355 days ago
You're right, it's not a fair comparison -- I think it's still interesting though, since numpy is the standard people would reach for, which made me think it would be the fastest / use the GPU. I expect a python library that uses the GPU would be just as fast as the others.
3 comments

For that, you can use cupy[0], PyTorch[1] or Tensorflow[2]. They all mimic the numpy's API with the possibility to use your GPU.

[0] https://cupy.dev/ [1] https://pytorch.org/ [2] https://www.tensorflow.org/

It adds a great deal of complexity (and often user frustration) for a Python package to support both CPU and GPGPU.
People don’t reach for numpy because it’s the absolute fastest…
What I meant was I expected numpy to be faster than the js libraries I was testing, simply because people use it so much more, for real "scientific computing" work. And indeed it is very fast given it only uses the CPU, but that still leaves its matrix multiplication as ~100x slower than what my mac is capable of.