Live data from Hacker News

MNIST training: Showdown between JavaScript and WebAssembly

ai.danruta.co.uk

31–34 of 34 posts

Re: MNIST training: Showdown between JavaScript and WebAssembly

#32
post #26

PLEASE NOTE This is NOT a fair and honest comparison. The WebAssembly implementation pegs 100% of one CPU core (as monitored in htop) on my system until it is completed. The JS button sits between 66.2%-66.8% and 19-26% of one core depending on whether the tab is focused or not. The JS version does not use Web Workers. I can, however, see two references to setTimeout(). This leads me to assume that the JS version is…

I'm currently re-writing the JS version to not use the setTimeout functions, in favour of just running the whole thing in a WebWorker, to still maintain browser usability.

I'm focusing more on a WebGL version, but once that's done, it should be a fairer comparison.

Re: MNIST training: Showdown between JavaScript and WebAssembly

#33
woah, I never expected this much traffic! Thank you for all the suggestions, don't worry, I am still hard at work on this.

I'm currently most focused on designing and implementing a WebGL version (partially working FC forward shader, so far), between uni assignments, trying to see if I can get it working nicely together with WebAssembly (need to figure out the best way to create the contexts with an off-screen canvas).

The JS version uses setTimeout to stop locking up the browser, and is something old, which I'm about to change, in favour of using WebWorkers, and (optionally) collecting error data in an array, for displaying charts at the end of training, instead of during. That should come out in version 3.3, unless the GPU stuff comes out first, in v4.0.

I didn't expect the link would get posted somewhere, so the library versions used were pretty old, haha, but I'll update them now. I've also added a note about the setTimeout thing, which, again, will be removed soon.

The repo is here, if anyone was interested: https://github.com/DanRuta/jsNet

Post reply on HN