A lightweight ML framework built from scratch in Rust with GPU-first architecture.
- GPU acceleration via wgpu (Vulkan, Metal, DX12)
- Element types:
f32,i32,u32 - Cross-platform: Linux, macOS, Windows
- Automatic compute pipeline caching
- No unsafe code
| Flag | Description |
|---|---|
unstable-kernels |
Exposes the low-level kernel module |
The kernel module provides raw GPU compute kernels (GEMM, transpose, element-wise ops, etc.). These are internal building blocks not intended for direct use:
- Kernels panic on invalid input (no
Resultreturn) - API may change without notice
- A stable, user-friendly tensor API will be provided in the future
Enable only if you need low-level GPU access and understand the risks:
[dependencies]
xnn = { version = "0.1", features = ["unstable-kernels"] }Examples require the unstable-kernels feature flag.
Trains a simple linear model to fit y = 2x + 1.
cargo run --release --features=unstable-kernels --example linregTrains a 2-layer neural network to solve the XOR problem.
cargo run --release --features=unstable-kernels --example xorMIT — see LICENSE for details.