← all repositories
tinygrad/tinygrad

PyTorch ergonomics with a compiler you can actually read

For when you outgrow micrograd but still want a deep learning compiler small enough to read and hack.

33.3k stars Python ML Frameworks
tinygrad
Velocity · 7d
+3.1
★ / day
Trend
cooling
star history

What it does

tinygrad is an end-to-end deep learning framework with tensors, autograd, optimizers, and standard layers. It compiles and fuses kernels through an exposed IR and compiler, then executes them via JIT or graph mode across a wide range of accelerators. You write familiar eager-mode training loops, but the framework lazily fuses operations and lowers them to device-specific code behind the scenes.

The interesting bit

The project borrows PyTorch’s ergonomics, JAX’s IR-based autodiff, and TVM’s scheduling and codegen, yet keeps the entire compiler readable enough to modify. It achieves kernel fusion through laziness rather than explicit graph construction, and adding a new accelerator requires implementing only about 25 low-level ops. The maintainers also offer cash bounties for improvements and will close PRs that sacrifice readability for marginal speedups.

Key highlights

  • End-to-end stack: tensors, autograd, nn/optim, compiler, JIT, and graph execution
  • Lazy evaluation automatically fuses operations into single kernels
  • Supports CPU, CUDA, Metal, AMD, NV, Qualcomm, WebGPU, and OpenCL backends
  • Entire compiler and IR are exposed and hackable, unlike PyTorch’s black box
  • New accelerators require only ~25 low-level ops to add

Caveats

  • Not yet at version 1.0, so expect rough edges
  • Lacks full JAX-style functional transforms such as vmap and pmap
  • Contributing guidelines are strict: speedups must be benchmarked, and large or “complex” PRs are unlikely to be merged

Verdict

Worth a look if you want to understand how a modern deep learning compiler works without wading through millions of lines of C++. Skip it if you need production stability or JAX’s full suite of functional transforms today.

Frequently asked

What is tinygrad/tinygrad?
For when you outgrow micrograd but still want a deep learning compiler small enough to read and hack.
Is tinygrad open source?
Yes — tinygrad/tinygrad is open source, released under the MIT license.
What language is tinygrad written in?
tinygrad/tinygrad is primarily written in Python.
How popular is tinygrad?
tinygrad/tinygrad has 33.3k stars on GitHub and is currently cooling off.
Where can I find tinygrad?
tinygrad/tinygrad is on GitHub at https://github.com/tinygrad/tinygrad.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.