Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 9 min read Announcement mediumAdept

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

Hugging Face released @huggingface/kernels, a JavaScript loader for 207 Apache-2.0 WebGPU kernels published as versioned Hub repositories. Each repository bundles a manifest contract, correctness and benchmark cases, and Jinja-templated WGSL shaders with multiple variants per shape and device. On an Apple M4, 809 comparable cases ran 2.57x faster by geometric mean (1.90x median) than ONNX Runtime Web's WebGPU backend, with some outliers in Einsum and CumSum exceeding 300x. Those figures measure GPU time per operation, not full models. Fleet, an in-browser benchmarking tool, crowdsources correctness and performance results across real devices to improve variant selection.

Assumes: WebGPU basicsGPU compute shadersONNX operators

Related posts

  • Transformers.js v3: WebGPU Support, New Models & Tasks, and More…

    Hugging Face mediumAdept

    Transformers.js v3 adds WebGPU acceleration via ONNX Runtime Web, claimed up to 100x faster than WASM and enabled by passing `device: 'webgpu'` when loading a pipeline. A new `dtype` option replaces the old boolean `quantized` flag and supports fp32, fp16, 8-bit and 4-bit variants, including per-module dtypes for quantization-sensitive encoder-decoder models like Whisper and Florence-2. The release also expands support to 120 architectures and over 1200 pre-converted Hub models, and adds Node.js, Deno and Bun compatibility under the new @huggingface/transformers npm package. WebGPU reaches only about 70% of browsers, so some users need feature flags.

  • Transformers.js v4: Now Available on NPM!

    Hugging Face mediumAdept

    Transformers.js v4 ships on NPM with a new C++ WebGPU runtime built with the ONNX Runtime team, enabling WebGPU-accelerated models in browsers as well as Node, Bun and Deno. Models are re-exported operation by operation using ONNX Runtime contrib operators such as GroupQueryAttention, MatMulNBits and MultiHeadAttention, giving about a 4x speedup for BERT embedding models. The release also adds Mamba, MLA and MoE architectures such as GPT-OSS 20B, which runs at about 60 tokens/s on an M4 Pro Max. Other changes include a move from Webpack to esbuild (10x faster builds, 53% smaller default bundle), a pnpm monorepo, a ModelRegistry API for inspecting and caching pipeline assets, and a standalone 8.8kB tokenizers library.

  • WebGPU now available for testing in Safari Technology Preview

    WebKit mediumAdept

    Safari Technology Preview 185 ships an early WebGPU implementation, enabled via the "WebGPU", "GPU Process: DOM Rendering" and "GPU Process: Canvas Rendering" feature flags. A walkthrough of the core API shows requesting an adapter and GPUDevice, configuring a GPUCanvasContext, building a GPURenderPipeline from a WGSL shader module, and encoding and submitting a draw call through a GPURenderPassEncoder. A complete WGSL vertex/fragment shader draws a colored triangle, and developers are asked to try the WebGPU samples and file bugs at bugs.webkit.org.

  • Deno 1.8 Release Notes

    Deno mediumAdept

    Deno 1.8 adds experimental WebGPU support (built on wgpu/gfx-rs) aimed at GPU-accelerated ML such as running TensorFlow.js, ships full ICU so all JS Intl APIs match browsers, and stabilizes import maps, which can now be loaded from URLs. Coverage is split into collection (`deno test --coverage=dir`) and reporting (`deno coverage`, with lcov output for codecov/coveralls). Private module fetching works via per-host bearer tokens in `DENO_AUTH_TOKENS`. Other changes include an exit sanitizer for `Deno.test`, stable runtime permission query/request/revoke APIs, stabilized link/symlink APIs, per-op `Deno.metrics`, JSON formatting in `deno fmt`, and IIFE bundles from `Deno.emit`.

  • Figma rendering: Powered by WebGPU

    Figma mediumAdept

    Figma migrated its C++ renderer from WebGL to WebGPU while keeping WebGL as a fallback, first refactoring its graphics interface to pass draw-call state explicitly and to batch uniform uploads into a single buffer per submit to avoid performance regressions. Legacy WebGL 1 GLSL shaders are kept and automatically translated to WGSL via a custom shader processor plus naga, and Dawn is used for both the Emscripten/Wasm build and native server-side builds. Because WebGPU only supports asynchronous readback and can fail mid-session on Windows, Figma built a dynamic fallback that swaps backends to WebGL at runtime and blocklists devices by fallback rate. Benchmarks across Windows, Mac and ChromeOS showed gains on some device classes and neutral results elsewhere with no regressions, and compute shaders, MSAA and RenderBundles are next.

The quest for software engineering knowledge.

Look:
Layout: