Live data from Hacker News

WebLLM: high-performance in-browser LLM inference engine

github.com

11–20 of 32 posts

Re: WebLLM: high-performance in-browser LLM inference engine

#14
post #3

Earlier quoted context omitted.

What did you switch to?

We use the ONNX runtime for small models in the browser https://github.com/microsoft/onnxruntime

Yeah ONNX runtime or Burn-rs are great because they compile to wasm

Re: WebLLM: high-performance in-browser LLM inference engine

#17
post #8
post #6

This seems to be the demo: https://chat.webllm.ai/ I am getting: WebGPUNotAvailableError: WebGPU is not supported in your current environment, but it is necessary to run the WebLLM engine. On both, FireFox and Chromium on Linux.

You can enable WebGPU support in Google Chrome by turning on hardware acceleration and activating the WebGPU flag. It Works.

I tried it and the experience was not great. I first enabled chrome://flags/#force-enable-webgpu-interop which did nothing. Next, I enabled chrome://flags/#enable-unsafe-webgpu which made some WebGPU demos work, but they all use my CPU's integrated GPU, which is worse than using no GPU acceleration at all. Next, I found out that there is a powerPreference: 'high-performance' option. It can be enabled with chrome://flags/#enable-webgpu-developer-features and I can now request a GPU with 'high-performance' power preference, although there is no way to check whether this actually selected the correct GPU, and it is useless to do it like that anyway, since no website actually sets this (experimental) option. Fortunately, there is the flag chrome://flags/#force-high-performance-gpu which should solve this, but it is not available for my platform. I have a fairly standard RTX 3060, but apparently, the most common GPU (according to the steam hardware survey) is not supported.

Unfortunately, Firefox does not work any better. After setting the flag dom.webgpu.enabled to true in about:config, a few WebGPU examples (e.g. https://webgpu.github.io/webgpu-samples/?sample=helloTriangl...) work, but many other examples crash the browser. And of course, Firefox can't select the correct GPU either.

Re: WebLLM: high-performance in-browser LLM inference engine

#19
post #17
post #8

Earlier quoted context omitted.

You can enable WebGPU support in Google Chrome by turning on hardware acceleration and activating the WebGPU flag. It Works.

I tried it and the experience was not great. I first enabled chrome://flags/#force-enable-webgpu-interop which did nothing. Next, I enabled chrome://flags/#enable-unsafe-webgpu which made some WebGPU demos work, but they all use my CPU's integrated GPU, which is worse than using no GPU acceleration at all. Next, I found out that there is a powerPreference: 'high-performance' option. It can be enabled with chrome://fl…

Pretty much the same here with Edge,#enable-unsafe-webgpu got me the emulated swiftshader adapter, but only #force-high-performance-gpu made the dGPU appear in the adapter list of https://webgpureport.org/.

Re: WebLLM: high-performance in-browser LLM inference engine

#20
post #6

This seems to be the demo: https://chat.webllm.ai/ I am getting: WebGPUNotAvailableError: WebGPU is not supported in your current environment, but it is necessary to run the WebLLM engine. On both, FireFox and Chromium on Linux.

For firefox you may need to enable `dom.webgpu.enabled` in `about:config`

It's on by default on Windows iirc - it's considered a potential security risk on Linux by Mozilla, so they ship it but it's turned off and it's up to the user to decide.

I think the reasoning is just because of how varied graphics drivers/stacks are on Linux compared to Windows/OSX and the attack surface been larger.

Post reply on HN