signal.

Introducing @huggingface/kernels: 200+ WebGPU Kernels for Local AI

Hugging Face has released @huggingface/kernels, a minimal library providing over 200 optimized WebGPU kernels hosted on the Hugging Face Hub to accelerate browser-based machine learning. Alongside the library, the company launched Fleet, an in-browser benchmarking suite designed to test kernel performance and correctness across diverse user hardware.

Hugging Face has announced the release of @huggingface/kernels, a library designed to load and run optimized WebGPU kernels from the Hugging Face Hub to improve browser-based machine learning inference. The initial release includes 207 versioned kernels covering various machine learning architectures and workloads, such as matrix multiplications, convolutions, and attention primitives. Each kernel is published as a complete package featuring its interface, shader templates, correctness cases, and benchmark instructions. To evaluate performance across real-world hardware, Hugging Face also introduced Fleet, an in-browser testing suite that collects private performance and correctness evidence with user consent. According to Hugging Face, testing against ORT WebGPU on an Apple M4 GPU showed their kernels achieved a geometric mean speedup of 2.57x across matching test cases, with some specialized operations yielding significantly larger gains. Hugging Face states it is collaborating with the ONNX Runtime team to upstream these improvements into the broader ONNX Runtime Web ecosystem.

Why it matters

Optimized WebGPU kernels bridge the gap between browser portability and hardware performance, enabling faster and more efficient local AI inference directly within web applications.

Topic dossiers Hugging Face