Repolode
tracel-ai

tracel-ai/burn

A Rust tensor library and deep learning framework for training and inference across CUDA, ROCm, Metal, Vulkan, WebGPU and CPU backends.

Open-source alternative to:PyTorch

Stars
16,144
Forks
1,106
Open issues
173
Last commit
12 hours ago

What is it?

Burn is a tensor library and deep learning framework written in Rust. It aims to use one codebase for both training and deployment, so a model trained with its API is the same code that runs in production, rather than being exported to a separate runtime. It keeps a PyTorch-like, dynamic programming style while JIT-compiling tensor operations and performing automatic kernel fusion.

The framework supports multiple backends that can be swapped without changing model code, including CUDA, ROCm, Metal, Vulkan and WebGPU through the CubeCL compute layer, plus a pure-Rust CPU backend (Flex) that also runs on Wasm and no_std targets. Autodiff, kernel fusion and remote execution are implemented as backend decorators. Model weights can be imported from ONNX, PyTorch and Safetensors formats, and a terminal dashboard shows training metrics.

The project is in active development and makes breaking changes between versions. Its ecosystem includes crates for computer vision, reinforcement learning, datasets and benchmarking.

Key features

  • 01Single tensor and module API that works across CUDA, ROCm, Metal, Vulkan, WebGPU and CPU backends.
  • 02Automatic kernel fusion and autodiff implemented as backend decorators.
  • 03Imports ONNX models as native Rust code and loads PyTorch and Safetensors weights.
  • 04Terminal training dashboard for monitoring metrics and checkpoints.
  • 05Flex CPU backend with no_std and WebAssembly support.
  • 06Remote execution mode for running tensor operations on a server (beta).

Use cases

  • Training a model in Rust and deploying the same code to servers, browsers or embedded devices.
  • Running ONNX or PyTorch-trained models inside a Rust application.
  • Running inference in the browser with WebGPU or WebAssembly.
  • Experimenting with deep learning in Rust with fast incremental compilation.

Things to know

  • The LibTorch backend was deprecated in 0.22.0 and removed from main, so GPU acceleration now depends on CubeCL backends.
  • Each GPU backend only works on specific vendor and API combinations, as listed in the README's support matrix.

Topics

FAQ

What is burn?
A Rust tensor library and deep learning framework for training and inference across CUDA, ROCm, Metal, Vulkan, WebGPU and CPU backends. Burn is a tensor library and deep learning framework written in Rust. It aims to use one codebase for both training and deployment, so a model trained with its API is the same code that runs in production, rather than being exported to a separate runtime. It keeps a PyTorch-like, dynamic programming style while JIT-compiling tensor operations and performing automatic kernel fusion.
Is burn free to use? What license does it have?
burn is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is burn still maintained?
Actively maintained. The last commit to burn was on Oct 21, 2026.
What can I use burn for?
Training a model in Rust and deploying the same code to servers, browsers or embedded devices. Running ONNX or PyTorch-trained models inside a Rust application. Running inference in the browser with WebGPU or WebAssembly. Experimenting with deep learning in Rust with fast incremental compilation.
Where can I get burn?
The source code and installation instructions are on GitHub: https://github.com/tracel-ai/burn

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects