Ferrotensor
ContentsIntroduction

Ferrotensor

Ferrotensor is a pure-Rust GPU ML framework. It runs tensors, autograd and neural networks on the GPU using wgpu and hand-written WGSL compute kernels, which run through Vulkan, Metal or DX12. It has been tested on an NVIDIA A10G (24 GB) through Vulkan, an Apple M2 (8 GB) through Metal, and software Vulkan (Mesa lavapipe) in CI; other GPUs are untested, and reports are welcome. cargo build is the whole toolchain. Python bindings wrap the same tensor API.

The same API also runs on a CPU device, which the tests use as the reference for the GPU. Op gradients are tested against finite differences on the CPU, and the LoRA loss and gradients against PyTorch autograd.

It is young: pre-1.0, single GPU, and small-scale by design. Arithmetic and trainable parameters are f32; the CLI stores frozen LoRA base weights as f16 by default to save memory (--f32-weights keeps them f32).

Where to startLink to this section

If you want toRead
Install the crate, the CLI or the Python packageInstallation
Train a model from PythonPython quickstart
See runnable Rust programs and their real outputUse cases
Fine-tune a real model with LoRA, step by stepLoRA fine-tuning
Understand how a tensor op reaches a WGSL kernelArchitecture
Add your own GPU opWriting a kernel
Check the numbers and how they were measuredBenchmarks

The Rust API reference is on docs.rs. The source, issues and releases are on GitHub.

This guide is built from the documents in the repository, so it always matches the files on the main branch.