tinygrad  by tinygrad

Minimalist deep learning framework for education and exploration

Created 4 years ago
30,123 stars

Top 1.2% on SourcePulse

GitHubView on GitHub
Project Summary

tinygrad is a lightweight deep learning framework designed for simplicity and ease of accelerator integration, targeting researchers and developers who find existing frameworks too complex. It aims to be the easiest framework to add new hardware backends to, supporting both inference and training with a RISC-like philosophy compared to XLA's CISC approach.

How It Works

tinygrad leverages laziness to fuse operations into single kernels, optimizing execution. Its core design prioritizes a minimal set of low-level operations (~25) required for an accelerator to support, making it highly extensible. This approach allows for efficient execution on diverse hardware, from CPUs and GPUs to specialized accelerators.

Quick Start & Requirements

  • Install from source: git clone https://github.com/tinygrad/tinygrad.git && cd tinygrad && python3 -m pip install -e .
  • Direct install: python3 -m pip install git+https://github.com/tinygrad/tinygrad.git
  • Prerequisites: Python 3.x. Supports CPU, OpenCL, LLVM, METAL, CUDA, AMD, NV, QCOM, and WebGPU.
  • Documentation: https://docs.tinygrad.org/

Highlighted Details

  • Supports LLaMA and Stable Diffusion models.
  • Achieves 98% accuracy on MNIST in ~5 seconds with a simple LinearNet example.
  • Extensive accelerator support including CPU, GPU (OpenCL, CUDA, Metal), LLVM, and more.
  • Designed for easy addition of new hardware backends.

Maintenance & Community

Licensing & Compatibility

  • License: Apache 2.0.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

The project is explicitly stated as alpha software. The README warns against code golf, complex or large diffs, and unsolicited documentation/whitespace changes, indicating a strict contribution policy focused on simplicity and clarity.

Health Check
Last Commit

23 hours ago

Responsiveness

1 day

Pull Requests (30d)
529
Issues (30d)
20
Star History
295 stars in the last 30 days

Explore Similar Projects

Starred by François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), Chaoyu Yang Chaoyu Yang(Founder of Bento), and
13 more.

neon by NervanaSystems

0%
4k
Deep learning framework (discontinued)
Created 11 years ago
Updated 4 years ago
Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Li Jiang Li Jiang(Coauthor of AutoGen; Engineer at Microsoft), and
26 more.

ColossalAI by hpcaitech

0.1%
41k
AI system for large-scale parallel training
Created 3 years ago
Updated 14 hours ago
Feedback? Help us improve.