Guide
Deep Learning

tinygrad on macOS — GPU Guide

Run deep learning models locally on your Mac with full Metal GPU acceleration. Built by comma.ai - the same team behind openpilot.

comma.ai connection
tinygrad is not just a random ML library.
tinygrad is the deep learning framework built and maintained by comma.ai, the company behind openpilot and the comma 3/3X devices. The examples/openpilot/ folder in tinygrad directly powers the neural networks in openpilot. If you are a comma user, tinygrad is part of your car's AI stack.
What is tinygrad?
A minimal deep learning stack that stays readable from tensors down to kernel generation.

tinygrad is an end-to-end deep learning stack built by tiny corp, comma.ai's research arm. It is intentionally minimal and hackable - the entire compiler, IR, and runtime are readable and modifiable. Think PyTorch for people who want to understand what is actually happening.

Tensor library with autograd (automatic differentiation)

IR and compiler that fuses and lowers kernels (lazy evaluation)

JIT + graph execution @TinyJit decorator makes inference fast

nn / optim / datasets for real training

How tinygrad compares
FrameworkSimilarityKey Difference
PyTorchSame eager Tensor API, autograd, optimIn tinygrad, the entire compiler is visible and hackable
JAXIR-based autodiff, function-level JITSimpler - far easier to read and modify
TVMMultiple lowering passes, BEAM search over kernelstinygrad ships the full front-end too (tensors, nn, optim)
The lazy evaluation model
All operations in tinygrad are lazy - nothing executes until you call .realize() or .numpy(). This allows the compiler to fuse multiple operations into a single GPU kernel, which is why performance is surprisingly good despite the small codebase.
Why macOS is a first-class platform

tinygrad has a first-class Metal backend in tinygrad/runtime/ops_metal.py that uses Apple's Metal API directly.

Full GPU acceleration on all Apple Silicon Macs (M1, M2, M3, M4)

Full GPU acceleration on Intel Macs with AMD or Intel graphics via Metal

Automatic detection - on macOS, Metal is the default backend

Metal 3.1 support on macOS Sonoma (14+), Metal 3.0 on Ventura (13+), Metal 2.0 on Monterey (12+)