News for hackers. Stuff that matters.
Re:Use.GPU by carpenecopinum on Friday September 09, 2022 @09:28AM (#32778949)
In principle, yes. With webGPU (but also WebGL2) we get access to compute shaders, which makes it feasible/easier to evaluate a model like Stable Diffusion.

The biggest issue I see is that those models (or rather their trained parameters) are usually pretty large (several GiB). So it'll take a while to set up in the browser before the evaluation can actually start. It'll also require a lot of bandwidth on both ends.

A lot of those things should already be doable with the fragment shaders we get from WebGL and a lot of hackery, like clever (ab)use of textures. So the actual issue that we're not seeing a lot of this is probably not due to it being impossible right now...

Re:Use.GPU by capableweb on Friday September 09, 2022 @09:40AM (#32779093)
> The biggest issue I see is that those models (or rather their trained parameters) are usually pretty large (several GiB). So it'll take a while to set up in the browser before the evaluation can actually start. It'll also require a lot of bandwidth on both ends.

Might not be feasible due to memory constraints (I'm not sure), but browsers can load data from disk into memory without having to touch the network. So you could in theory ask the users to download the model separately, then ask them to select it from a file picker, and the browser can have access to it that way.

Re:Use.GPU by lmeyerov on Friday September 09, 2022 @11:01AM (#32780075)
Next step: browser JS VMs need to allow you access gigs of RAM in-memory, it's surprisingly locked down
Re:Use.GPU by flyteuk on Friday September 09, 2022 @10:51AM (#32779962)
It'd be nice if the models could be loaded via WebTorrent[1], which would significantly reduce the bandwidth requirement for whomever releases it.

[1] https://github.com/webtorrent/webtorrent

Re:Use.GPU by tough on Friday September 09, 2022 @11:13AM (#32780204)
The models are certainly available on torrent though
Re:Use.GPU by jakogut on Friday September 09, 2022 @11:35AM (#32780495)
Right. Another option is running the model locally from a web page, served from the project source directory, which is still a lot easier than setting up a platform specific GPU accelerated ML dev environment.
Re:Use.GPU by krona on Friday September 09, 2022 @12:14PM (#32781059)
WebGL2 doesn't support compute shaders.
Re:Use.GPU by pjmlp on Friday September 09, 2022 @01:09PM (#32781988)
It did for a short while as an extension, then Google decided to throw away Intel's work and only support compute in WebGPU.