FrankenTorch: PyTorch's API rebuilt in memory-safe Rust, runs in-browser via wasm
doodlestein · x · 2026-12-06
François (doodlestein) released FrankenTorch, a memory-safe Rust reimplementation of PyTorch's API with minimal external dependencies — a drop-in replacement, a standalone Rust library, and compilable to WebAssembly for in-browser training.
Highlights:
- Full coverage of tensors, autograd, nn, optim and data loading with PyTorch's names and argument order: 3,158 session methods (1,119 tensor ops) and 122 nn modules from Linear/Conv3d to LSTM, Transformer and MultiheadAttention.
- "Gradients with a receipt": backward passes run in a fixed order and report every step; weight fingerprints are bit-identical across runs.
- Verified against real PyTorch as an oracle: 550 conformance tests, 7,009 tests plus 56 fuzz targets; 11 of 14 crates forbid unsafe.
- Live in-browser training (4.7 MB wasm in a Web Worker) trains a digit reader to 95.4% in about a second; weights can be carried back to PyTorch.
More from coding & agent
- How the "100x coding" prompt works: let the model explore boldly, then verify with GPT — YouJiacheng · 2026-12-06
- Agents now reboot machines without asking: the autonomy line keeps moving — markjeffrey · 2026-12-06
- Study of 443 LangGraph systems: 67.3% are fixed workflows, not real multi-agent — dair_ai · 2026-12-06
- CoreWeave tip: let ARIA auto-draft your training run reports — CoreWeaveDevs · 2026-12-06
- Weekend project: have AI interview you to turn a weekly task into an agent brief — McDonaghMatthew · 2026-12-06
- NVIDIA paper: models managing own context lift GPT 6.1 from 21% to 56% — MaryamMiradi · 2026-12-06