luminal-ai/luminal

Inference at the speed of light.

What it solves

Luminal is designed to overcome the performance bottlenecks and complexity explosion found in traditional deep learning frameworks. It replaces eager-first execution with a high-performance, general-purpose inference compiler that optimizes computation graphs ahead-of-time, reducing runtime overhead and maximizing hardware utilization.

How it works

Luminal treats all neural networks as static computation graphs. It reduces complex operations into 15 primitive ops (unary, binary, and other) to maintain a minimal core. Instead of relying on hand-written heuristics for optimization, it uses a search-based approach to discover the most efficient execution paths—automatically discovering optimizations like Flash Attention. It is written in Rust and interacts directly with accelerator APIs (CUDA, Metal) to avoid abstraction layers.

Who it’s for

It is intended for developers and researchers who need maximum inference speed on any device, as well as PyTorch users who want to use Luminal as a compiler backend via torch.compile.

Highlights

  • High Performance: Capable of running Q8 Llama 3 8B at ~80% of theoretical max performance on an H100.
  • PyTorch Integration: Works as a compiler backend for PyTorch models.
  • Minimalist Architecture: Uses a RISC-style approach with only 15 primitive operations.
  • Symbolic Dimensions: Natively supports dynamic shapes through symbolic dimensions for aggressive specialization.
  • Native Rust Implementation: Statically-linked Rust crate that interacts directly with hardware APIs.

Related

  • Project
  • Project
  • Project
  • Project
  • Project