AI NewsDev toolsAnnouncement

Hugging Face released 207 WebGPU kernels for running models in the browser

Hugging Face has released @huggingface/kernels, a JavaScript library that downloads and runs 207 optimised WebGPU compute kernels straight from the Hub, benchmarked at 2.57 times faster than ONNX Runtime Web by geometric mean.

AI News

Editorial2 min read

LinkedInX

Why it mattersBrowser inference is now a discoverable, versioned, per-operation layer that any web app can download kernels from, so an update on the Hub can improve a runtime's speed without releasing a new bundle.

Hugging Face published @huggingface/kernels on 1 September 2026, a JavaScript library that downloads and runs WebGPU compute kernels directly from a new collection on the Hub. The initial collection has 207 kernels, and the whole library is Apache-2.0 licensed. The authors are Nico Martin and Joshua from Hugging Face.

The install line is npm install @huggingface/kernels@preview, so the package is on npm as a preview release. Kernels need a browser with WebGPU support, which is checked in JavaScript with "gpu" in navigator.

What it changes

Until now, running a model in a browser meant relying on whatever kernels the runtime you picked included in its bundle. If ONNX Runtime Web's Softmax was slow on your device, you waited for the runtime team to release a new version. @huggingface/kernels splits that up: each operation is its own asset on the Hub, discoverable, testable, benchmarkable and versioned on its own.

The Hugging Face post frames it this way: "By making those operations individually discoverable, testable, benchmarkable, and versioned, we can improve the foundation independently while keeping a stable contract for the layers above it."

The measured comparison

Hugging Face ran their kernels against ONNX Runtime Web 1.30.0-dev.20260826-b1f76d586a on an Apple M4 GPU, across 1,756 test cases spanning all 207 operations, and kept the 809 cases where both sides produced matching outputs and reliable timings. Their kernels won 629, lost 176, and tied 4, and were 2.57 times faster by geometric mean and 1.90 times faster at the median.

The per-operation numbers vary a lot. Add came in 3.52 times faster, MatMul 1.14 times faster, Softmax 2.11 times faster, LayerNormalization 2.22 times faster. Two outliers sit at the top: row-wise CumSum on a [256, 4096] tensor ran 301 times faster (0.016 milliseconds versus 4.784 milliseconds), and a bilinear Einsum on a size-4096 input ran more than 10,000 times faster (0.136 milliseconds versus 1,396 milliseconds). The vendor is quoting its own benchmark against a specific version of one competing runtime, so treat the numbers as a starting point and re-run them for the operations your model actually uses.

Hugging Face says it is working with the ONNX Runtime team to add the improvements to ONNX Runtime Web itself, so users of that runtime should benefit without switching libraries.

The design matters more than the speedup. A browser app can now download the exact operations it needs from a shared registry, pin a version, and upgrade a single kernel without releasing a new runtime bundle. That is how Python-side kernel libraries have worked for a while, and it treats browser inference as separate layers rather than one large block.

Two caveats. WebGPU is not universally available yet: it depends on the browser, operating system, GPU and driver combination, so a real app needs a fallback path. And the library is a preview release, so the API may still change before it is stable. If you already run models client-side and Softmax or LayerNorm is where your model spends its time, the numbers are large enough to justify a benchmark on your own device.

Source

Primary source: Introducing @huggingface/kernels: 200+ WebGPU Kernels for Local AI, Hugging Face, 1 September 2026.

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project