Hugging Face kernels: Jinja templates let browsers compile the fastest GPU kernels
nicodotdev · x · 2026-09-04
Two days after shipping @huggingface/kernels, a Hugging Face engineer published a deep dive into how the browser-side GPU kernel library works.
- Jinja templates instead of WGSL files: the optimal kernel differs per GPU, so templates are compiled in-browser for the specific device
- Results: attention in 20 lines of JS running on the GPU; a single matmul animates 1M+ pixels at 400 fps vs 6 fps in plain JS
- Fleet: users benchmark their GPUs, helping tune kernels for every device
Full video, blog post, playground, and npm package are linked.
Related event: Hugging Face open-sources kernels library for in-browser GPU kernels(3 posts)→
More from Infra
- The hedonic treadmill of ever-growing token spend and cluster size — kevinnbass · 2026-12-05
- Chinese dev open-sources EwokOS: 600K-line microkernel with CUDA layer beating TensorRT — 量子位 · 2026-12-05
- Can Google AI Pro's 200 monthly Colab credits run MiniMax H3? — Wonderful_Fig4792 · 2026-12-05
- Artificial Analysis launches mobile small-model inference benchmark covering major phones — ArtificialAnlys · 2026-12-05
- Qwen4-35B-A3B hits 280 tok/s decode on Apple M5 Ultra via Superfluid — Fair_Breakfast398 · 2026-12-05
- A Reddit user on a 5070 Ti (16GB VRAM, 32GB RAM) runs Qwen3.8 27B ud-q2-k-xl at 131k context with 50-60 tps. With the new Qwen4 35B A3B MoE, they're stuck between 60 tps at 2-bit and 40 tps at 4-bit, and feel Qwen4 needs more guidance for the same tasks, making perceived speed slower. Unclear if it's an optimization issue; they haven't tried Basalt yet. — CrowKing63 · 2026-12-05