五年 Tinygrad
Five Years of Tinygrad

原始链接: https://geohot.github.io//blog/jekyll/update/2025/12/29/five-years-of-tinygrad.html

Tinygrad项目旨在与英伟达在人工智能硬件领域竞争,始于2020年10月,目前已发展成为一个6人团队,代码库达到18,935行(并扩展到约20,000行)。其核心理念是优先打造完全自主的软件堆栈,*再*进行芯片开发——认为软件才是真正的差异化因素,正如缺乏强大软件生态系统的公司芯片成功的有限性所证明。 目前,Tinygrad正在通过移除LLVM依赖来简化代码,目标是除了Python之外没有任何依赖,以便高效利用AMD GPU。它已经在许多任务上超越了PyTorch,并采用了一种独特的极简主义方法,专注于核心需求,而不是维护与不必要的抽象层的兼容性。 这家“小型公司”以解构公司的形式运作——主要通过Discord和GitHub公开——资金来源是电脑销售(约每年200万美元)以及与AMD签订的MLPerf测试合同。对代码库的贡献是主要的招聘方式,培养了一种以改进Tinygrad及其使命为中心的、自我导向的工作环境,即让拍片级计算变得触手可及。

## Tinygrad:五周年总结 这次黑客新闻讨论的中心是Tinygrad,一个由George Hotz (geohot) 创建的小型机器学习框架。 五年后,该项目正在获得进展,贡献者有时会因贡献而被直接聘用。 Tinygrad 的特点是远程优先、高生产力的工作结构——每周一次会议,专注于核心改进。 它旨在“使 petaflop 大众化”,从而能够在非 NVIDIA GPU 上进行高效的 LLM 训练,并且与 AMD 签订了合同以支持这一目标。 代码库目前有 18,935 行代码。 讨论要点包括其在边缘部署方面与 PyTorch 和 TensorFlow 相抗衡的潜力,以及其独特的资金模式(电脑销售产生每年 200 万美元的收入,另加 2023 年筹集了 510 万美元)。 一些人批评该项目将代码行数作为衡量标准,而另一些人则赞扬其开源性质和雄心勃勃的目标。 一个关键的理念是简化需求,一些人认为这源于 Elon Musk,而另一些人则认为这源于更古老的 TRIZ 方法论。
相关文章

原文

The first commit to tinygrad was October 17, 2020. It’s been almost three years since we raised money. The company is 6 people now. The codebase is 18,935 lines not including tests.

I have spent 5 years of my life working on 18,935 lines, and now many others have put years in as well. And there’s probably 5 more years to go. But this is the right process to compete with NVIDIA.

Only a fool begins by taping out a chip; it’s expensive and not the hard part. Once you have a fully sovereign software stack capable of training SOTA models, the chip is so easy. Note that AMD, Amazon, Tesla, and Groq have taped out fine chips, but only Google and NVIDIA chips have ever been seriously used for training. Because they have the software.

We are finally beginning to tackle LLVM removal, making tinygrad have 0 dependencies (except pure Python) to drive AMD GPUs. We have a frontend, we have a graph compiler, we have runtimes, and we have drivers. This is no longer a toy project, it outperforms PyTorch on many workloads. When this is finished and cleaned up, it’ll be about 20,000 lines. And that’s completely it.


I think a lot of how software is thought about is wrong. All codebases have workarounds for issues in other parts of the codebase. Sometimes you are lucky and these workarounds are clear, but many times they are so deep and structural that you’ll never see them reading the code line by line. I think this is so bad that 98% of lines of software are basically this in some way shape or form. tinygrad is following the Elon process for software.

Make the requirements less dumb. The best part is no part.

Most requirements in software exist to maintain compatibility with other abstractions. Let’s look at an LLM server. The real requirement is that it provide an OpenAI compatible API for quickly running LLMs on GPUs. But when you look at these codebases and what they depend on, they are collectively millions and millions of lines. tinygrad is 1000x smaller.

It’s because each piece of code in that stack isn’t focused on the goal. It’s focused on the other pieces of code. I believe this is the same dysfunction that exists in organizations too.


The tiny corp is a company, but like how fancy chefs will deconstruct dishes, the tiny corp is a deconstructed company. We have almost nothing private, it’s a Discord and GitHub. To fund the operation, we have a computer sales division that makes about $2M revenue a year.

We also have a contract with AMD to get MI350X on MLPerf for Llama 405B training. This was negotiated mostly in public on Twitter.

People get hired by contributing to the repo. It’s a very self directed job, with one meeting a week and a goal of making tinygrad better.

Our mission is to commoditize the petaflop.

联系我们 contact @ memedata.com