skillfed

tinygrad

You like pytorch? You like micrograd? You love tinygrad! <3

tinygrad v0.13.0 113.7K downloads/30d#12,332 on PyPI
Permissive license MIT Active released

What it is and what it does

tinygrad is a deep learning framework designed to be small, readable, and hackable while remaining practical for real neural network training. It combines a PyTorch-like eager tensor API with autograd, an IR-based compiler inspired by JAX and TVM, and built-in support for optimizers, layers, and datasets. The framework uses lazy evaluation to fuse operations into single kernels and supports multiple accelerators (CPU, CUDA, Metal, OpenCL, AMD, QCOM, WebGPU) by requiring only ~25 low-level ops per backend.

Unlike PyTorch, tinygrad exposes its entire compiler and IR for inspection and modification, making it suitable for researchers and developers who want visibility into how computation is compiled and scheduled. It is intentionally kept minimal to remain understandable—the core library prioritizes readability and simplicity over feature completeness, though it covers the essentials: tensor operations, automatic differentiation, neural network layers, optimizers, and data loading.

Use it for:

  • Learning how deep learning frameworks work internally by reading and modifying the compiler and IR.
  • Training neural networks on custom or less common accelerators by implementing a new backend.
  • Prototyping machine learning models with a PyTorch-like API in a codebase small enough to fully understand.
  • Research on compiler optimizations and kernel scheduling for tensor operations.
  • Embedded or resource-constrained deployments where framework size and hackability matter.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

tinygrad is a minimal deep learning framework providing a tensor library with autograd, an IR-based compiler, JIT execution, and neural network training utilities—positioned between PyTorch's ergonomics and lower-level compiler systems.

Yes, if you are building models and want a transparent, minimal framework or need to understand how deep learning compilers work. Yes-with-conditions if you rely on advanced functional transforms or need production-grade performance guarantees—tinygrad prioritizes simplicity and readability over feature parity. No if you need a mature, battle-tested ecosystem with extensive third-party libraries and pre-trained models.

Install

tinygrad on PyPI

pip

pip install tinygrad

uv

uv add tinygrad

poetry

poetry add tinygrad

Installing tinygrad

Before you install

Low install friction with a pure Python wheel. Actively maintained with a recent release 84 days ago. Requires Python 3.11 or later.

License in practice

MIT license permits commercial and private use with minimal restrictions, making it suitable for both research and production deployments.

Quickstart

pip install tinygrad
from tinygrad import Tensor, nn

class LinearNet:
  def __init__(self):
    self.l1 = Tensor.kaiming_uniform(784, 128)
    self.l2 = Tensor.kaiming_uniform(128, 10)
  def __call__(self, x):
    return x.flatten(1).dot(self.l1).relu().dot(self.l2)

model = LinearNet()
optim = nn.optim.Adam([model.l1, model.l2], lr=0.001)

Requires Python 3.11 or later. Accelerator support (CUDA, Metal, etc.) depends on system libraries and environment configuration.

Verify before relying

  • Whether accelerator support (OpenCL, CUDA, Metal, AMD, QCOM, WebGPU) is fully functional across all listed backends.
  • Performance characteristics and memory overhead compared to PyTorch in real training scenarios.
  • Completeness of functional transforms (vmap, pmap) relative to other frameworks.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 84 days since the last release
First released
Downloads 113,736/month — #12,332 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tinygrad-0.13.0-py3-none-any.whl

Programming Language :: Python :: 3

Tags

minimal deep learning frameworkpytorch alternative lightweighttensor autograd libraryneural network compilerhackable machine learning stack
compiler-visibleminimal-frameworkmulti-backend

More Artificial Intelligence packages