--- id: tinygrad version: "0.13.0" license: MIT license_treatment: permissive maintenance: active --- # tinygrad — You like pytorch? You like micrograd? You love tinygrad! <3 License: permissive · Maintenance: active · Downloads: 113.7K/mo ## 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 above — 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 pip install tinygrad uv add tinygrad 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_current - Install friction: low - Maintenance: active - Downloads: 113.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags minimal deep learning framework, pytorch alternative lightweight, tensor autograd library, neural network compiler, hackable machine learning stack, compiler-visible, minimal-framework, multi-backend [View on SkillFed](https://skillfed.io/packages/tinygrad) · [View on PyPI](https://pypi.org/project/tinygrad/)