Live data from Hacker News

Five Years of Tinygrad

geohot.github.io

111–120 of 167 posts

Re: Five Years of Tinygrad

#111
post #12
post #5

So this is all python? I bet Chris Lattner probably approached them.

Lattner is a smart guy, but I think Mojo might be the wrong direction. Time will tell. History has not so far been kind to projects which attempt to supplant cPython, whether they are other Python variants such as PyPy, or other languages such as julia. Python has a lot of detractors, but (despite some huge missteps with the 2-3 transition) the core team keeps churning out stuff that people want to use. Mojo is being…

I don't think they intend to supplant cPython, but to make it easier for someone to take a piece of software written in high-productivity Python and make it more performant on specialized hardware by using a similar syntax.

Long term it can find applications outside of ML-specific hardware.

Re: Five Years of Tinygrad

#112

>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 I find this organizational structure compelling, probably the closest to reaching 100% productivity in a week as you can get.

It’s hard to argue against hiring contributors, but a bounty system that pays pennies vs. market value for skilled developers shouldn’t be the only interview path, it’s borderline exploitative.

All other interview processes (that I've witnessed or heard of) waste anyone's time with barely anything to show for though, regardless if it ever comes to a offer.

Re: Five Years of Tinygrad

#113
post #99
post #33

Earlier quoted context omitted.

You would be amazed https://en.wikipedia.org/wiki/TRIZ

Ok this wins my “best wikipedia article of December” award

Check out this cacophony of an infographic:

https://upload.wikimedia.org/wikipedia/commons/b/bf/40_princ...

No wonder the soviet union collapsed!

When you need Moscow to explain the hammer sign on your corded drill, its too late for damage control.

Re: Five Years of Tinygrad

#114
post #90

Earlier quoted context omitted.

Looks fine to me. I'm going to guess that you're used to codebases that use an autoformatter. There's definitely a case to be made for autoformatters in projects with a very large (>100) number of developers, but the price you pay for that is much poorer information density per screenful of code. For things like tinygrad or sqlite with a small dev team it's possible to use whitespace, style, and formatting to communi…

Even with autoformatters, it's a choice of what criteria you pick. It's possible to have consistency without enforcing low information density.

No, it really isn't. Like I said, math journals don't autoformat the mathematicians' equations. There's signal encoded in the formatting that a tool can't understand.

But if you have hundreds of developers on a project it does in fact make sense to sacrifice that signal in order to keep them from fighting with each other over silly formatting choices.

Re: Five Years of Tinygrad

#115

Earlier quoted context omitted.

Have you run into problems with contributors who can't enter the PRC?

Actually the opposite is the problem: “International scientists rethink U.S. conference attendance“ https://www.science.org/content/article/international-scient...

This is not helpful.

Re: Five Years of Tinygrad

#116

I've looked at the "only 18,935 lines of code" python code and it made me want to poke my eyes out. Not sure what's the point of this extreme code-golfing.

yes, it's really crazy, if people think you're exaggerating look at this: https://github.com/tinygrad/tinygrad/blob/master/tinygrad/co... One of the cases why I think obsession with lines of code is one of the most counterproductive metrics, it always produces code like this.

I don't think this is bad, if you know Python then most of the code will be fine for you. I think you're probably referring to pm_reduce_collapse, but while it looks daunting at first, it really isn't when you consider the alternatives, I'd be curious on how you'd improve it short of creating a DSL.

Re: Five Years of Tinygrad

#117

I've looked at the "only 18,935 lines of code" python code and it made me want to poke my eyes out. Not sure what's the point of this extreme code-golfing.

yes, it's really crazy, if people think you're exaggerating look at this: https://github.com/tinygrad/tinygrad/blob/master/tinygrad/co... One of the cases why I think obsession with lines of code is one of the most counterproductive metrics, it always produces code like this.

Is is code a form of AST rewrite rules for optimization? This operation still looks like a incomprehensible wall of code 40 years later (I looked in the past inside the C++ compiler).

Re: Five Years of Tinygrad

#118

>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 I find this organizational structure compelling, probably the closest to reaching 100% productivity in a week as you can get.

It’s hard to argue against hiring contributors, but a bounty system that pays pennies vs. market value for skilled developers shouldn’t be the only interview path, it’s borderline exploitative.

To me, it's better than spending months of your free time grinding leetcode to get past an interview (everyone wants to hire like FAANG now).

You get a small reward in return if the contribution is accepted and you get to contribute to the world corpus of knowledge.

Re: Five Years of Tinygrad

#119

Dude is an absolute nut, I'll stick with PyTorch https://geohot.github.io/blog/jekyll/update/2025/04/22/a-way...

Aside from the edgy Unabomber quote and calling both established US political parties racists, everything there is reasonable analysis. What exactly got your goat?

Re: Five Years of Tinygrad

#120
post #98

Earlier quoted context omitted.

You’re getting some pushback but one look at pm_reduce_collapse and I’m glad I don’t have to work in this codebase.

I see the advantage of the inline lambdas, but also it seems like it would hamper the ability to test the functions which can often have intricacies that catch you out. I believe one of the principles of Tinygrad is that tests shouldn't be part of the core codebase and shouldn't add to the total linecount. I think there is an opportunity there to have a tag in comments for tests. Have a hotkey to generate an id so yo…

You don't really want or need classical unit tests for compilers. You need a harness that you can feed a program representation into and get a transformed one out, then check the result -- ideally mostly just by running it, or alternatively by comparing the output against a reference.
Post reply on HN