# What lessons could Julia's autodiff ecosystem learn from Stan's TinyGrad?

**URL:** <https://discourse.julialang.org/t/what-lessons-could-julias-autodiff-ecosystem-learn-from-stans-tinygrad/103070>\
**Category:** Machine Learning\
**Created:** [August 22, 2023, 2:50pm UTC](https://discourse.julialang.org/t/what-lessons-could-julias-autodiff-ecosystem-learn-from-stans-tinygrad/103070 "2023-08-22T14:50:56Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 22, 2023, 1:50am UTC](https://discourse.julialang.org/t/what-lessons-could-julias-autodiff-ecosystem-learn-from-stans-tinygrad/103070/4 "2023-08-22T01:50:33Z")

</div>

> [@What steps should the Julia community take to bring Julia to the next level of popularity?](https://discourse.julialang.org/t/what-steps-should-the-julia-community-take-to-bring-julia-to-the-next-level-of-popularity/101389/395):
>
> Stan built a world-class autodiff system with a team of two people in about a year, and TinyGrad is now mostly usable after 2-3 years of work by one programmer.

TinyGrad looks like an ML system targeted exclusively at NN models, not a general-purpose AD engine? If you read the source code of TinyGrad, it looks like it has [hard-coded derivative rules](https://github.com/tinygrad/tinygrad/blob/4f02491cd4285a198e875915404c26d9d47f343d/tinygrad/mlops.py) for a relatively small set of building-blocks (and compositions thereof), with users expected to implement other rules themselves (e.g. [in their examples](https://github.com/tinygrad/tinygrad/blob/4f02491cd4285a198e875915404c26d9d47f343d/examples/vits.py#L262-L279)). This is _much, much_ easier than something like Enzyme that aims to AD arbitrary code.

---

_[View the full topic](https://discourse.julialang.org/t/what-lessons-could-julias-autodiff-ecosystem-learn-from-stans-tinygrad/103070)._
