tinygrad
You like pytorch? You like micrograd? You love tinygrad! <3
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 tinygraduv
uv add tinygradpoetry
poetry add tinygradInstalling 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
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
autogradAutograd automatically computes derivatives of…
permissive · top 5,000 on PyPI
torchvizGenerates visual diagrams of PyTorch neural…
permissive · top 5,000 on PyPI
tensorflow-cpuTensorFlow CPU provides a machine learning and…
permissive · top 5,000 on PyPI
pytorchThis package is a redirect or placeholder; the…
unclear · top 15,000 on PyPI
nvidia-cudnn-cu13Provides cuDNN runtime libraries for…
unclear · top 1,000 on PyPI
pytorch_revgradImplements a gradient reversal layer for…
permissive · top 15,000 on PyPI
nvidia-cudnn-cu12Provides cuDNN runtime libraries for…
unclear · top 1,000 on PyPI
tensorlyTensorLy performs tensor decomposition, tensor…
permissive · top 15,000 on PyPI
torch-optimizerProvides a collection of alternative…
permissive · top 15,000 on PyPI