Skip to main content

Crate ferric_web

Crate ferric_web 

Source
Expand description

Ferric web — proves the SAME pure-Rust kernels (ferric-core) run in the browser on WebGPU. The matmul WGSL, the Context, the readback — all identical to native; only the target changes.

Functions§

ferric_lm_demo
Runs the full Ferric transformer LM in the browser on WebGPU: greedy-generates steps tokens from a comma-separated prompt of token ids, and validates the prefill logits against the in-wasm CPU reference. Returns a JSON string {backend, prompt, generated, layers, logit_diff, ms}.
ferric_matmul_demo
Runs the Ferric matmul on the browser’s WebGPU and validates against the CPU reference. Returns “backend|maxdiff|first6”.