# What's the state of Automatic Differentiation in Julia January 2023?

**URL:** <https://discourse.julialang.org/t/whats-the-state-of-automatic-differentiation-in-julia-january-2023/92473>\
**Category:** General Usage\
**Tags:** autodiff\
**Created:** [January 3, 2023, 11:24pm UTC](https://discourse.julialang.org/t/whats-the-state-of-automatic-differentiation-in-julia-january-2023/92473 "2023-01-03T23:24:37Z")\
**Posts on this page:** 2\
**Page:** 3

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 21, 2024, 11:11pm UTC](https://discourse.julialang.org/t/whats-the-state-of-automatic-differentiation-in-julia-january-2023/92473/42 "2024-06-21T23:11:48Z")

</div>

Ahh interesting, didn’t know it only did the one way there. That must be why it currently has a feel of “I think it mostly works but a few things seem to get hit”. Is there a reason Enzyme cannot just mixed mode that? ReverseDiff first did that, where broadcast has a diagonal sparsity pattern so you can always switch that step to forward without a cost (and that can sometimes reduce cost)

---

<div class="post-metadata">

**Author:** ![wsmoses](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsmoses/32/26497_2.png) [@wsmoses](https://discourse.julialang.org/u/wsmoses)\
**Post date:** [June 21, 2024, 11:15pm UTC](https://discourse.julialang.org/t/whats-the-state-of-automatic-differentiation-in-julia-january-2023/92473/43 "2024-06-21T23:15:18Z")

</div>

I mean it’s probably useful to mixed mode broadcast regardless.

However, what that PR does is generically say that autodiff of @cuda is @cuda of autodiff (which is presently needed by broadcasting among other things).

It’s definitely useful to also consider what higher level utilities we want to add – but that is useful as a baseline so generic code doesn’t need to pipe in an inner autodiff call inside all @cuda’s.

That’s why I’ll argue that the linked PR makes broadcast work in reverse mode (among other things), but will potentially get further improved with additional broadcast-specific tuning.

[Previous page](https://discourse.julialang.org/t/whats-the-state-of-automatic-differentiation-in-julia-january-2023/92473.md?page=2)
