tinygrad/tinygrad

Description: You like pytorch? You like micrograd? You love tinygrad! ❤️

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 49 minutes ago
Added to GitGenius on April 23rd, 2024
Created on October 18th, 2020
Open Issues & Pull Requests: 189 (+0)
Number of forks: 4,217
Total Stargazers: 33,287 (+0)
Total Subscribers: 290 (+0)

Issue Activity (beta)

Open issues: 105
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 361 days
Stale 30+ days: 95
Stale 90+ days: 87

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 1

Top labels

  • bug (29)
  • good first issue (24)
  • bounty (15)
  • enhancement (12)
  • TIP (8)
  • optimization (5)
  • bounty locked (4)
  • real issue (3)

Most active issues this week

Repository Insights (GitGenius)

Median issue/PR response: 10.8 hours
Mean response time: 55.8 days
90th percentile: 200.9 days
Tracked items: 676

Most active contributors

Detailed Description

Tinygrad is a deep learning framework positioned between PyTorch and micrograd, maintained by tiny corp. It provides an end-to-end deep learning stack consisting of a tensor library with autograd, an IR and compiler that fuses and lowers kernels, JIT plus graph execution capabilities, and neural network utilities including optimizers and datasets for real training. The framework is written in Python and draws inspiration from PyTorch for ergonomics, JAX for functional transforms and IR-based automatic differentiation, and TVM for scheduling and code generation, while maintaining an intentionally small and hackable codebase.

The framework's design philosophy emphasizes laziness in computation. When users write operations like matrix multiplication, tinygrad fuses them into single kernels through its lazy evaluation system. The compiler and IR are fully visible and hackable, distinguishing tinygrad from PyTorch where these components are typically opaque. Compared to JAX, tinygrad implements IR-based autodiff over primitives and function-level JIT through TinyJit, though it currently lacks full functional transforms like vmap and pmap. Unlike TVM, which focuses primarily on the compiler layer, tinygrad ships both the front-end framework with tensors, neural network modules, and optimizers alongside the compiler infrastructure.

The framework supports numerous accelerators including OpenCL, CPU, Metal, CUDA, AMD, NVIDIA, Qualcomm, and WebGPU. Adding new accelerators requires implementing only approximately 25 low-level operations, making the framework extensible across diverse hardware platforms. Users can check their default accelerator through a simple Python command.

According to GitGenius activity tracking across 676 issues and pull requests, the repository maintains a median response latency of 10.8 hours, indicating active maintenance. The most frequently labeled issues involve bugs (21 occurrences), good first issues (18 occurrences), and bounties (12 occurrences), reflecting both quality assurance efforts and community engagement through financial incentives. The top contributors tracked by GitGenius are chenyuxyz with 575 events, geohot with 305 events, and nimlgen with 117 events. The repository's contributor network overlaps with major projects including Microsoft's VSCode and TypeScript implementations as well as the Rust language repository, suggesting influence from and connections to significant open-source ecosystems.

The project maintains strict contribution guidelines emphasizing code quality and readability over line count reduction. Pull requests must include regression tests for bug fixes, avoid code golf patterns, and demonstrate clear wins in refactoring efforts. The maintainers offer cash bounties for specific improvements and require benchmarking for any claimed performance optimizations. Contributors must disclose AI tool usage and avoid submitting code they do not fully understand. The project includes process replay tests that compare generated kernels against the master branch, particularly for refactors and speedups without expected behavior changes. Installation is recommended from source, and the project provides documentation on its dedicated docs website along with a quick start guide. A pre-commit hook system is available to run linting, type checking, and test subsets automatically on commits.

tinygrad
by
tinygradtinygrad/tinygrad

Repository Details

Fetching additional details & charts...