Hysen Labs
Open-source project
joey00072/Tinytorch avatar
joey00072

Tinytorch

A really tiny autograd engine

100 stars5 forksPythonMIT
01
DEEP OPEN-SOURCE ANALYSIS

Tinytorch: an autograd engine under a thousand lines

The main file stays under 1000 lines, with a promise to revert if it grows. Tinytorch positions itself between micrograd and tinygrad on a deliberately playful power scale.

02
DEEP OPEN-SOURCE ANALYSIS

The size limit is the point

Tinytorch calls itself a really tiny autograd engine, and the README jokes that it is the newest ML framework users probably do not need. It is backed by numpy, and the main file is kept under 1000 lines with a stated intention to revert changes if the count passes that. That ceiling is the design constraint, and it is what keeps the code readable as an educational project. Readability over reach is the trade being made on purpose.

03
DEEP OPEN-SOURCE ANALYSIS

Running it past toys means jax

There is a practical ceiling to numpy. The README warns that numpy is too slow to train an LLM, and points anyone who wants to scale up at jax as a faster numpy drop in. For small experiments the plain engine is fine, and the jax note only matters once you outgrow them.

04
DEEP OPEN-SOURCE ANALYSIS

Where it lands between micrograd and tinygrad

The project positions itself on a power level scale. Karpathy's micrograd sits at 1.0 and is described as really simple, Tinytorch at 3.14 is simple but capable of a lot, and tinygrad at 69 is no longer simple. A linked development blog documents building tensors, the backward pass, refactoring and cleanup, and broadcasting, so the construction is traced step by step rather than presented as a finished artifact. The blog parts follow the building of the engine in order, which makes the project genuinely useful for learning autograd internals. It reads like software made to be read, not just shipped.

06
DEEP OPEN-SOURCE ANALYSIS

Official sources

07
Community notes

Community notes