# \[blog post\] Implement your own AD with Julia in ONE day

**URL:** <https://discourse.julialang.org/t/blog-post-implement-your-own-ad-with-julia-in-one-day/16666>\
**Category:** Community\
**Tags:** blog-post\
**Created:** [October 23, 2018, 4:21am UTC](https://discourse.julialang.org/t/blog-post-implement-your-own-ad-with-julia-in-one-day/16666 "2018-10-23T04:21:07Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [October 23, 2018, 5:40pm UTC](https://discourse.julialang.org/t/blog-post-implement-your-own-ad-with-julia-in-one-day/16666/17 "2018-10-23T17:40:16Z")

</div>

Note that Flux has an explicit `@grad` rule for matrix multiplication, which should be fast, while it looks like Zygote does not (yet?): [https://github.com/FluxML/Zygote.jl/blob/master/src/lib/array.jl](https://github.com/FluxML/Zygote.jl/blob/master/src/lib/array.jl) compare to [https://github.com/FluxML/Flux.jl/blob/master/src/tracker/array.jl](https://github.com/FluxML/Flux.jl/blob/master/src/tracker/array.jl) line 327.

So perhaps it must fall back on some generic for-loop multiplication, and having a go with this [Naive matrix multiplication is super slow in Julia 1.0?](https://discourse.julialang.org/t/naive-matrix-multiplication-is-super-slow-in-julia-1-0/13589) version gives me a slowdown of almost this magnitude.

---

_[View the full topic](https://discourse.julialang.org/t/blog-post-implement-your-own-ad-with-julia-in-one-day/16666)._
