Introducing @huggingface/kernels: 200+ WebGPU Kernels for Local AI
huggingface ·
Hugging Face introduced @huggingface/kernels, a minimal JavaScript library for loading and running optimized WebGPU kernels from the Hugging Face Hub, along with an initial collection of 207 kernels published as versioned repositories. The kernels cover common machine learning operations such as matrix multiplication, addition, softmax, and layer normalization, with each repository including manifests, shader templates, correctness tests, and benchmark cases. In benchmarks against ORT WebGPU on an Apple M4 GPU, the kernels were 2.57x faster by geometric mean and 1.90x faster at the median across 809 comparable cases. The article also launches Fleet, a browser-based tool that crowdsources correctness and performance evidence from users' devices to improve kernel variants and selection. The project aims to build a shared, low-level foundation for faster and more reliable browser-based AI inference, and the team is working with the ONNX Runtime team to upstream improvements.
huggingface