JS can be a serious language in the data science and scientific computation fields, but one of the biggest ecosystem weaknesses is the lack of numeric libraries. This library is very promising!
I assume you're talking about in the web browser/pure js? Because otherwise you can just bind to the native CUDA etc. libraries like most other languages do.
And even on the browser side SIMD is being implemented in WebAssembly and (limited) GPGPU will be possible via WebGL 2.0 compute shaders. So as such I don't see any reason why JavaScript couldn't at the very least match python/numpy in performance if someone put their mind to it.
About 5 years ago, SIMD.js has been announced, was implemented and then scrapped in favor of SIMD in WebAssembly, which does not exist until today. It has been announced, but I would not hold my breath for it. Presumably we'll only get 128-bit wide SIMD anyway, so another 2x to 4x waste of computing power there.
Additionally, 4 years ago, WebCL was announced and implemented in some browsers, but then it was scrapped in favor of compute shaders in WebGL 2.0. When WebGL 2.0 finally arrived, it did not have compute shaders. Instead, they have been delayed to be implemented as an extension at some indefinite point in the future.
Sorry if this sounds a bit grumpy, but I have been disappointed too often to be enthusiastic about this.
There are also issues like floating point rounding modes in JS and floating point precision in WebGL that have to be addressed. Should not be too hard, but who knows.
Hi, I am owner of libRmath.js and porting BLAS at the moment,
Python and R cant use SIMD either (out of the box), infact no compiler can use SIMD efficiently, therefore gotoBlAS is directly written in assembler for this reason.
Secondly WebGL2 as a vast array of new texture types and Mozilla is implementing the ARB shader. But this has nothing to do with JS perse, because shader langauge is not JS, (its more C like).
This is basically Tensorflow enabled to run in browser and server environments. And it does have GPGPU support via Tensorflow bindings and WebGL. Yes, really.
(To prevent confusion I should mention that I am only talking about JS in the browser.)
WebGL without compute shaders it anything but general compute. There have been some attempts at shoehorning matrix multiplication and other functions required for neural networks into WebGL, but the performance is abysmal due to API limitations.
The actual math in propel seems to be based on https://github.com/PAIR-code/deeplearnjs which has a benchmark website https://deeplearnjs.org/demos/benchmarks/ but the results for the GPU implementation are meaningless because they measure CPU execution time instead of GPU execution time. That's like benchmarking a server by measuring how long it takes to send an http request without waiting for the response.
With proper benchmarking I get about 500 milliseconds for a 1024x1024-by-1024x1024 matrix multiplication, or 4 GFLOPS. CUDA can do 500 GFLOPS on my GPU, so the WebGL implementation is 125 times slower.
Something fishy seems to be going on with their CPU benchmark as well, since it is 2500 times slower than Intel MKL on this machine.