My browser at least seems to struggle to download the file at https://ai.danruta.co.uk/webassembly/mnist.js - how big is this file in total?
MNIST training: Showdown between JavaScript and WebAssembly
11–20 of 34 posts
Re: MNIST training: Showdown between JavaScript and WebAssembly
#12It would be a more fair comparison to https://deeplearnjs.org/ , since CPU training is not standard practice for neural nets these days.
We've done some initial tests ourselves. WASM doesn't yet support SIMD so WebGL tends to be 5-10x faster. SIMD is actively being worked on by many smart people in Chromium / other browsers, so I would expect to see huge wins in the near term future. When that happens, deeplearn.js will have a WASM backend. WASM has a much better memory management story (destructors on the C++ side) so I'm super excited about its futu…
Re: MNIST training: Showdown between JavaScript and WebAssembly
#13Re: MNIST training: Showdown between JavaScript and WebAssembly
#14Re: MNIST training: Showdown between JavaScript and WebAssembly
#15Re: MNIST training: Showdown between JavaScript and WebAssembly
#16Re: MNIST training: Showdown between JavaScript and WebAssembly
#17Earlier quoted context omitted.
We've done some initial tests ourselves. WASM doesn't yet support SIMD so WebGL tends to be 5-10x faster. SIMD is actively being worked on by many smart people in Chromium / other browsers, so I would expect to see huge wins in the near term future. When that happens, deeplearn.js will have a WASM backend. WASM has a much better memory management story (destructors on the C++ side) so I'm super excited about its futu…
Is SIMD going to close that performance gap for a problem that otherwise fits well on a GPU? Wouldn't the ideal by WASM support for GPU access?
Though compiling WebAssembly to GPU code would be a very interesting thing to explore, too.
Re: MNIST training: Showdown between JavaScript and WebAssembly
#18edit: seems the JS is written in the straightforward, idiomatic JS way without employing speed hacks or typed arrays. So that I guess explains some of it.
Re: MNIST training: Showdown between JavaScript and WebAssembly
#19So what's the explanation for the 20x difference? Is the JS implementation untuned? edit: seems the JS is written in the straightforward, idiomatic JS way without employing speed hacks or typed arrays. So that I guess explains some of it.
Ran in Chrome profiler, spent most time in these forward/backward functions https://github.com/DanRuta/jsNet/blob/master/dev/js/ConvLaye...
Re: MNIST training: Showdown between JavaScript and WebAssembly
#20Earlier quoted context omitted.
Is SIMD going to close that performance gap for a problem that otherwise fits well on a GPU? Wouldn't the ideal by WASM support for GPU access?
Indeed WASM supports GPU access through the normal JS WebGL API. Many asm.js/WebAssembly apps use the GPU in this way. Though compiling WebAssembly to GPU code would be a very interesting thing to explore, too.