Show HN: High speed graphics rendering research with tinygrad/tinyJIT

Posted by quantbagel 2 days ago

Counter30Comment10OpenOriginal

I saw a tweet that tinygrad is so good that you could make a graphics library that wraps tg. So I’ve been hacking on a gtinygrad, and honestly it convinced me it could be used for legit research.

The JIT + tensor model ends up being a really nice way to express light transport all in simple python, so I reimplemented some new research papers from SIGGRAPH like REstir PG and SZ and it just works. instead of complicated cpp its just a 200 LOC of python.

Comments

Comment by nl 2 days ago

Why is this a fork of tinygrad and not just something that imports it?

Comment by sixtyj 2 days ago

Because forking is new coding /s (What we see is natural entropy of systems. Wannabe codies fork a repo… and instead of contributing to original one they make their own copy. What will happen if you repeat this a few times? ;)

Comment by quantbagel 2 days ago

Well I wanted to implement light transport papers without having to deal with cpp. I think tinygrad, and more specifically tinyJIT are super useful abstractions. This is def not available in ts

Comment by nl 1 day ago

My question was more why a fork instead of doing the conventional "import tinygrad" into your own project.

I don't think there is anywhere you are modifying tinygrad itself is there?

Comment by Keyframe 2 days ago

That is a legit way of working on contribution. You fork, you work on the fork - if it's not junk then you issue a pull request. What's the deal with belittling and holier-than-thou moralizing?

Comment by sixtyj 1 day ago

I have nothing against forking ofc. I like it. But I really don’t like laziness when there is no contribution to original project - instead those codies make the project as their, in fact it is just a (poor) fork. The result is the mess. My first comment was about this behaviour.

Forking is nice when it’s nice.

Comment by sxp 2 days ago

Claude didn't follow your "Every line must earn its keep. Prefer readability over cleverness. We believe that if carefully designed, 10 lines can have the impact of 1000." from https://github.com/quantbagel/gtinygrad/blob/master/AGENTS.m... given how bloated this demo is.

https://blog.evjang.com/2019/11/jaxpt.html is a better demo of how to render the Cornell Box on a TPU using differentiable path tracing.

Comment by hackernudes 2 days ago

The agents.md is from the upstream tinygrad repo: https://github.com/tinygrad/tinygrad/blob/master/AGENTS.md

Comment by nomilk 2 days ago

> Never mix functionality changes with whitespace changes.

Whoa.. the cursor rule I didn't know I needed!

Comment by suhacker256 2 days ago

so cool! id love to read a blog post about this.

Comment by 2 days ago