Re:MatX: Efficient C++17 GPU numerical computing library wit...
by cburdick13 on Wednesday October 04, 2023 @01:00AM
(#37761015)
I agree we should update it given that it's also a very old comparison (2 years now). The cuPy comparison should be fair since it was the same GPU.
I addressed it more here: https://news.ycombinator.com/item?id=37760120
Re:MatX: Efficient C++17 GPU numerical computing library wit...
by KeplerBoy on Wednesday October 04, 2023 @02:54AM
(#37761723)
It's very much an apples to oranges comparison, but nevertheless relevant, since NumPy is the defacto baseline for anything numeric in Python.
Re:MatX: Efficient C++17 GPU numerical computing library wit...
by albertzeyer on Wednesday October 04, 2023 @03:05AM
(#37761795)
Not really, for GPU computation, PyTorch, TensorFlow or JAX are the baselines (they are not just for ML stuff). Even for CPU, that's a more relevant comparison.
Re:MatX: Efficient C++17 GPU numerical computing library wit...
by KeplerBoy on Wednesday October 04, 2023 @03:19AM
(#37761904)
I agree in principle, but my experience is that researchers writing code just default to NumPy.
Re:MatX: Efficient C++17 GPU numerical computing library wit...
by zzbn00 on Wednesday October 04, 2023 @05:44AM
(#37762899)
This seems like an FFT based benchmark.... I believe NumPy for licensing reasons includes a port of old FFTPACK which is only single threaded. (Py)FFTW or others are surely much faster.
So the test seems to compare one thread of a CPU launched in 2016 running a port of 40year old fortran code to a optimised FFT library on a GPU launched in 2020.
Re:MatX: Efficient C++17 GPU numerical computing library wit...
by cburdick13 on Thursday October 05, 2023 @01:55PM
(#37781758)
The sample is really designed to show the simplicity of the syntax, and the performance is just a side effect. Where you'll see a bigger performance difference with numPy/cuPy is when kernel fusion happens where MatX is typically able to fuse many things into a single kernel at compile-time and cuPy launches many kernels. If you have a specific type of expression you'd like to compare please let us know.
Re:MatX: Efficient C++17 GPU numerical computing library wit...
by Night_Thastus on Wednesday October 04, 2023 @06:08AM
(#37763037)
I would be curious how it compares to the big names in the field, Eigen, OpenBLAS, Boost, etc.
Re:MatX: Efficient C++17 GPU numerical computing library wit...
by cburdick13 on Wednesday October 04, 2023 @09:19AM
(#37764700)
Hi, those libraries don't have a GPU counterpart, and for matrix multiplication we only support GPU right now.
Are they even comparing apples to apples to claim that they see these improvements over NumPy?
> While the code complexity and length are roughly the same, the MatX version shows a 2100x over the Numpy version, and over 4x faster than the CuPy version on the same GPU.
NumPy doesn't use GPU by default unless you use something like Jax [1] to compile NumPy code to run on GPUs. I think more honest comparison will mainly compare MatX running on same CPU like NumPy and for GPU comparison focus to compare vs CuPy.
[1] https://github.com/google/jax