News for hackers. Stuff that matters.
Re:WebGPU GPT Model Demo by b_mc2 on Thursday April 20, 2023 @08:54PM (#35648545)
Re:WebGPU GPT Model Demo by doodlesdev on Thursday April 20, 2023 @10:08PM (#35649019)

   > WebGPU is supported in your browser!

   > Uncaught (in promise) DOMException: WebGPU is not yet available in Release or Beta builds.
Anyone using Chromium care to chime in?

If no one chimes in I might set up a Chromium browser up just to take a look at this, seems pretty cool.

Re:WebGPU GPT Model Demo by EMM_386 on Thursday April 20, 2023 @10:28PM (#35649125)
I'm on the latest Brave (Chromium 112.0.5615.165) and it tells me it is not supported.
Re:WebGPU GPT Model Demo by adamkochanowicz on Thursday April 20, 2023 @10:36PM (#35649179)
Try chrome canary
Re:WebGPU GPT Model Demo by zamadatix on Thursday April 20, 2023 @11:42PM (#35649607)
Chrome Beta works as well.
Re:WebGPU GPT Model Demo by doodlesdev on Thursday April 20, 2023 @10:57PM (#35649305)
It needs to be Chromium 113+, otherwise you'll have to enable webGPU in the browser flags like I have for Firefox.
Re:WebGPU GPT Model Demo by brucethemoose2 on Friday April 21, 2023 @01:48AM (#35650165)
Thorium 111 is working with the WebGPU flags enabled.
Re:WebGPU GPT Model Demo by DustinBrett on Thursday April 20, 2023 @10:26PM (#35649120)
It indeed works and loads quick. I am more interested currently in the Vicuna 7B example from https://mlc.ai/web-llm/

Also instead of just "Update Chrome to v113" the domain owner could sign up for an origin trial https://developer.chrome.com/origintrials/#/view_trial/11821...

Re:WebGPU GPT Model Demo by fredrickd on Thursday April 20, 2023 @11:00PM (#35649332)
Thanks for the tip!
Re:WebGPU GPT Model Demo by DustinBrett on Friday April 21, 2023 @12:36AM (#35649847)
Np! Although there may still be some special WebGPU features in v113 that make v94-112 less ideal.
Re:WebGPU GPT Model Demo by DustinBrett on Saturday April 22, 2023 @03:05AM (#35664081)
I actually just tried this on my own domain and although it enabled WebGPU it had another error, which was:

"Find an error initializing the WebGPU device Error: Cannot initialize runtime because of requested maxBufferSize exceeds limit. requested=1024MB, limit=256MB. This error may be caused by an older version of the browser (e.g. Chrome 112). You can try to upgrade your browser to Chrome 113 or later."

Re:WebGPU GPT Model Demo by MuffinFlavored on Thursday April 20, 2023 @11:35PM (#35649573)
> At the moment, WebGPT averages ~300ms per token on GPT-2 124M running on a 2020 M1 Mac with Chrome Canary.

How do ChatGPT on GPT-3.5 / GPT-4 compare?

Re:WebGPU GPT Model Demo by zamadatix on Thursday April 20, 2023 @11:47PM (#35649638)
I don't have exact numbers but trying all 3 out: on a local 4090 this seems mildly slower than GPT-4 and ridiculously slower than GPT 3.5 (both via cloud GPUs of course). That said all are within the realm of usability in terms of speed though GPT 3.5 is really in a whole different class of being able to be used nearly interactively without delay.
Re:WebGPU GPT Model Demo by lxe on Friday April 21, 2023 @01:08AM (#35650000)
Interesting, I'm getting 100ms/token on plain old wasm with 4 threads via ggml, using a 1.7B quantized cerebras model.
Re:WebGPU GPT Model Demo by brucethemoose2 on Friday April 21, 2023 @01:42AM (#35650138)
I can do 60 tokens in 24s on my 2020 ASUS G14, Thorium 111 + Windows 10. Nvidia-smi says my RTX 2060 is 24% loaded and has ~1.1G eaten up.

Thats slower than Vicuna 7B (aka LLaMa 7000M, GPT 3ish? model) on linux on the same machine, where I get about 3.5 tokens/sec and 97% usage. So... yeah, performance is not so great yet.

Re:WebGPU GPT Model Demo by junrushao1994 on Friday April 21, 2023 @12:03AM (#35649718)
Is there any plan to support larger models than GPT-2?
Re:WebGPU GPT Model Demo by FL33TW00D on Friday April 21, 2023 @03:29AM (#35650757)
My 250M parameter model runs in 50ms/token ;)

Releasing April 26th when Chrome 113 hits stable. Open source NPM library you can add to any project.

Preview here: https://twitter.com/fleetwood___/status/1646608499126816799?...

Re:WebGPU GPT Model Demo by lxe on Friday April 21, 2023 @03:34AM (#35650796)
That's pretty impressive. What model are you using?
Re:WebGPU GPT Model Demo by FL33TW00D on Friday April 21, 2023 @05:00AM (#35651321)
FLAN-T5 Base currently, 780M parameter variant coming shortly!
Re:WebGPU GPT Model Demo by VierScar on Friday April 21, 2023 @09:43AM (#35653616)
What kind of model? Question-Answering? I imagine it must be quite specialised at <1b Params when many are 7b, 13b, or more?
Re:WebGPU GPT Model Demo by ianpurton on Friday April 21, 2023 @05:04AM (#35651337)
Question. I can see in the code the WGSL that's needed to implement inference on the GPU. https://github.com/0hq/WebGPT/blob/main/kernels.js

Could this code also be used to train models or only for inference?

What I'm getting at, is could I take the WGSL and using rust wgpu create a mini ChatGPT that runs on all GPU's?

Re:WebGPU GPT Model Demo by HopenHeyHi on Friday April 21, 2023 @05:42AM (#35651578)
No, that is not how that works, sadly you cannot.
Re:WebGPU GPT Model Demo by FL33TW00D on Friday April 21, 2023 @07:59AM (#35652453)
Why not? You could absolutely write the training code in WGSL.
Re:WebGPU GPT Model Demo by spencerchubb on Friday April 21, 2023 @10:17AM (#35654118)
This repo only does inference but it should be possible to write training code that runs on WebGPU.
Re:WebGPU GPT Model Demo by tormeh on Friday April 21, 2023 @06:31AM (#35651862)
Any way to run this kind of thing outside the browser? Chrome hasn't enabled WebGPU on Linux yet.
Re:WebGPU GPT Model Demo by b_mc2 on Friday April 21, 2023 @07:26AM (#35652219)
I've got it running on Chrome v113 beta on Ubuntu with an older AMD RX 580. The feature flags don't seem to be taking for me in chrome GUI but if you start chrome from terminal like this it works.

google-chrome --enable-unsafe-webgpu --enable-features=Vulkan,UseSkiaRenderer --enable-dawn-features=disable_robustness

GPU doesn't work in --headless though.

Re:WebGPU GPT Model Demo by eurekin on Friday April 21, 2023 @09:57AM (#35653819)
Omg, no pytorch/wsl/conda hiccups... This could save me some sleepless nights
Re:WebGPU GPT Model Demo by luizfelberti on Friday April 21, 2023 @11:20AM (#35655090)
It's really a shame that there is no 8-bit float support in the WebGPU spec. Even though few cards support it natively, it'd still massively benefit ML workloads.

Another annoying constraint but specific to wgpu (Rust's implementation of WebGPU) is that it does not support f16 yet (which IS in the spec), only through SPIR-V passthrough...

Re:WebGPU GPT Model Demo by kristianp on Friday April 21, 2023 @09:01PM (#35662242)
Re:WebGPU GPT Model Demo by samueldurante on Saturday April 22, 2023 @01:52AM (#35663755)
I didn't understand why I need WebGPU to use WebGPT...