← all repositories
tracel-ai/burn

Deep learning in Rust that actually ships to GPUs, browsers, and bare metal

Burn is a Rust tensor library and training framework built around a composable backend trait, so the same model code runs on CUDA, WebGPU, Apple Metal, or even no_std embedded devices.

burn
Velocity · 7d
+11
★ / day
Trend
steady
star history

What it does

Burn is a deep learning framework and tensor library written in Rust. It handles model training, inference, and numerical computing, with a focus on letting you write model code once and run it across a wide variety of hardware targets without rewriting.

The interesting bit

The entire framework is generic over a Backend trait, and backends are composable decorators. Wrap a GPU backend with Autodiff and it gains backpropagation; wrap it with Fusion and it gains automatic kernel fusion. There’s even a Remote backend (beta) that sends tensor operations over the network for distributed execution. This is the kind of type-system heavy design that Rust makes possible and Python frameworks can’t easily copy.

Key highlights

  • Backend matrix covers Nvidia CUDA, AMD ROCm, Apple Metal, Vulkan, WebGPU, and CPU targets including WebAssembly and no_std embedded (via the Flex backend)
  • Imports ONNX models and PyTorch/Safetensors weights, converting them to native Rust code that runs on any backend
  • Includes a terminal training dashboard built on Ratatui for real-time metrics without external tools
  • Same model code used for training and deployment — no translation layer or code changes required when moving from cloud GPU to browser WASM to embedded device

Caveats

  • ONNX support is active development with a limited set of supported operators
  • Only the Flex backend currently works in no_std environments
  • WGPU backends can hit Rust’s default recursion limit during compilation; the README suggests manually raising it to 256

Verdict

Worth a serious look if you’re building ML systems where deployment targets vary wildly — cloud GPUs, user laptops, browsers, or embedded devices — and you want one codebase. If you’re already productive in PyTorch and only targeting Nvidia GPUs, the switch cost is harder to justify.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.