Burn is a Rust tensor library and deep learning framework for training and inference on many backends. The same model code can run in research and production without a separate export step.
Overview
Burn unifies training and inference behind one API so teams avoid brittle exports to ONNX or separate runtime engines when moving models to production. It supports dynamic shapes and graphs while JIT-compiling tensor operation streams and applying automatic kernel fusion. The design targets incremental recompilation for faster edit-compile-run cycles in Rust.
Backends include CubeCL paths for CUDA, ROCm, Metal, Vulkan, WebGPU, and CPU, plus a pure-Rust Flex backend for CPU, Wasm, and no_std embedded use. Autodiff and fusion decorators compose with backends, and weights can be loaded from PyTorch or Safetensors. ONNX import is available through a dedicated crate with a growing operator set.
Training workflows include a terminal dashboard for metrics, dataset and vision helpers in the ecosystem, remote execution for distributed setups, and browser inference examples via WebAssembly and WebGPU. Models defined in Burn can run from embedded devices through GPU clusters using runtime backend selection.
Key features
- Unified training and inference API
- Multi-GPU and CPU backends
- Automatic kernel fusion
- Autodiff across backends
- PyTorch and Safetensors import
- ONNX model import
- WebAssembly inference support
- Terminal training metrics dashboard
Use cases
- On-device model personalization
- Cross-platform ML deployment
- Rust-native research prototypes
- Browser-based inference demos
- Embedded no_std inference