Hugging Face launched @huggingface/kernels on September 1, 2026, publishing an initial collection of 207 open-source WebGPU kernels designed for browser-based machine learning inference. The kernels are released under the Apache-2.0 license and hosted as individual repositories on the Hugging Face Hub.
The company's WebAI team built the companion JavaScript loader to download, prepare, and execute kernel operations directly from the Hub. The loader is available on npm under a preview tag. Running the operations requires a browser with WebGPU support, which varies according to the operating system, device GPU, browser build, and graphics drivers.
Each kernel repository contains a standardized set of contract files and shader templates. A manifest file defines the operation inputs, outputs, attributes, and tensor shape derivation rules, while metadata files record identifiers and provenance. Repositories also bundle correctness test cases, benchmark definitions, and parameterized WGSL shader files used to generate device-specific shaders.
Benchmark results
Engineers tested the 207 operations against ONNX Runtime Web version 1.30.0-dev.20260826-b1f76d586a on an Apple M4 GPU. From an initial pool of 1,756 test cases, Hugging Face isolated 809 cases where both runtimes yielded matching outputs and reliable execution timings.
Across those 809 test cases, the new kernels were 2.57 times faster by geometric mean and 1.90 times faster at the median compared to ORT WebGPU. The test suite recorded 629 wins, 176 losses, and 4 ties. The reported metrics measured active GPU execution time, excluding initial session creation, kernel downloads, shader compilation, and tensor data transfers.
Specific operations exhibited larger timing gaps under test conditions. A bilinear Einsum test case completed in 0.136 milliseconds using the new kernel compared to 1,396 milliseconds with ORT WebGPU. A row-wise CumSum operation across dimensions of 256 by 4096 ran in 0.016 milliseconds versus 4.784 milliseconds.
Crowdsourced testing
Alongside the library, Hugging Face released Fleet, a browser-based benchmarking and testing tool. Fleet runs kernel suites locally on connected hardware to collect consent-based correctness and performance data across diverse consumer graphics processors.
Collaboration is underway with the ONNX Runtime team to upstream the kernel improvements into the broader ONNX Runtime Web project. On the Hugging Face Hub, the new WebGPU collection sits alongside existing kernel repositories built for CUDA, ROCm, and Metal architectures.
