one kernel — bit-identical on native GPU & browser WebGPU

One pure-Rust AI stack.
Every fabric.

Ferric runs the same code on a datacenter GPU, a laptop, an edge robot, and a browser tab — a complete transformer, an ONNX importer, and a safetensors loader, with no Python or C++ in the hot path.

What it is

A single Rust ecosystem for AI compute — cloud, local, and browser.

Browser AI today is JavaScript and C++-WASM; Rust's AI story is fragmented and weak in the browser. Ferric is the missing piece: build directly on the portable GPU layer (wgpu), own the kernels, the model runtime, weight loading, and browser packaging — one coherent stack where a model defined once runs, and computes the same, everywhere. Every result below is validated against an independent reference and builds fully offline from vendored source.

Proven

Not a plan — a working transformer.

Each milestone checked against a CPU reference, onnxruntime, or numpy.

Cross-fabric core

7.15e-7

One matmul kernel, native Metal vs browser WebGPU — bit-identical.

Full transformer LM

1.9e-6

Embed → RoPE GQA attention → RMSNorm → SwiGLU, stacked, matched to CPU.

KV-cache generation

exact

Autoregressive decode, identical to a full recompute — token by token.

ONNX importer

~22 ops

Real graphs incl. SmolVLA components, matching onnxruntime.

Llama / SmolLM bridge

1.2e-6

Loads an HF safetensors checkpoint (GQA, tied embeddings), matched to numpy.

Self-reliant

offline

Strategic deps (wgpu, naga) forked in-tree; the whole build vendors.

The stack

Five crates, published on crates.io.

ferric-coreThe wgpu Context + the cross-fabric transformer kernel set.crates.io ↗
ferric-onnxA pure-Rust ONNX importer that runs graphs on Ferric tensor ops.crates.io ↗
ferric-loadA safetensors reader — fp16/bf16 dequant — how real checkpoints enter.crates.io ↗
ferric-llamaMaps a Llama/SmolLM safetensors checkpoint onto the kernels and runs it.crates.io ↗
ferric-webThe same core compiled to WASM, running on browser WebGPU.crates.io ↗

Playground

A transformer, running in this tab.

This runs a full Llama-style forward pass on your GPU via WebGPU, compiled from the same Rust as the native crates — and checks its own output against an in-page CPU reference.

statusinitializing… backend adapter

Weights here are fixed pseudo-random — an untrained demo net — so generation is deterministic, not meaningful language. The point is that a real transformer's compute runs correctly in a browser tab.