# Status update on the Differentiable Swift language feature

**URL:** <https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805>\
**Category:** Compiler\
**Tags:** autodiff\
**Created:** [May 8, 2025, 10:33pm UTC](https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805 "2025-05-08T22:33:05Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Troy\_Harvey](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/troy_harvey/32/13926_2.png) [@Troy\_Harvey](https://forums.swift.org/u/Troy_Harvey)\
**Post date:** [November 7, 2025, 3:31pm UTC](https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805/22 "2025-11-07T15:31:24Z")

</div>

Thanks for the JAX pull request!  
awesome.

---

<div class="post-metadata">

**Author:** ![Lancelotbronner](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lancelotbronner/32/22071_2.png) [@Lancelotbronner](https://forums.swift.org/u/Lancelotbronner)\
**Post date:** [November 25, 2025, 5:06pm UTC](https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805/23 "2025-11-25T17:06:08Z")

</div>

I've been trying to find out how to get this working since `import _Differentiation` doesn't seem to work but I can't seem to find any information on how to install it?

---

<div class="post-metadata">

**Author:** ![pedronahum](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/pedronahum/32/24130_2.png) [@pedronahum](https://forums.swift.org/u/pedronahum)\
**Post date:** [November 25, 2025, 7:13pm UTC](https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805/25 "2025-11-25T19:13:22Z")

</div>

Try using any recent dev snapshot - it is not part of the release.

---

<div class="post-metadata">

**Author:** ![pedronahum](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/pedronahum/32/24130_2.png) [@pedronahum](https://forums.swift.org/u/pedronahum)\
**Post date:** [November 25, 2025, 7:45pm UTC](https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805/26 "2025-11-25T19:45:16Z")

</div>

Hi @Troy_Harvey, I've been experimenting with a complementary approach that can push things even further: graph compilation via tracing. The idea is to use Swift's existing autodiff as-is, but capture the computation into MLIR for XLA compilation.

Essentially, a `DifferentiableTracer` rides along with normal `@differentiable` code, observes Swift's AD generating pullbacks, emits MLIR operations, and hands the complete forward+backward graph to XLA for fusion into a single optimized kernel.

What's exciting is that this builds _on top of_ the current autodiff—no compiler changes needed. The existing foundation is solid.

Repo here if curious: [https://github.com/pedronahum/SwiftIR](https://github.com/pedronahum/SwiftIR).

Worth noting: for the building simulation benchmark, at low iteration counts the Swift compiler and native execution is arguably impossible to beat. But as iterations scale up, the graph compilation approach starts to add real value—XLA's fusion and optimization have more to amortize.

---

<div class="post-metadata">

**Author:** ![JaapWijnen](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jaapwijnen/32/8414_2.png) [@JaapWijnen](https://forums.swift.org/u/JaapWijnen)\
**Post date:** [March 5, 2026, 12:13pm UTC](https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805/27 "2026-03-05T12:13:56Z")

</div>

New update posted here: [Differentiable Swift Feb 2026 update](https://forums.swift.org/t/differentiable-swift-feb-2026-update/85161)

[Previous page](https://forums.swift.org/t/status-update-on-the-differentiable-swift-language-feature/79805.md?page=1)
