HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
JuliaDiff
ForwardDiff.jl
Julia2017–2024
JuliaDiff / ForwardDiff.jl

ForwardDiff.jl

Forward Mode Automatic Differentiation for Julia

7Distinct people
7Mentions
0Explicit recommenders
1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Forward Mode Automatic Differentiation for Julia

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 7:02:50 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year7 dated mentions

Observed mentions: 2017-02-21 17:57:30 UTC to 2024-03-23 02:12:25 UTC.

0122017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC202
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC000
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

What Hacker News says

2 sources
I'll forward this to some of my GPU-expert-coauthors in the morning to see if they have a take on your questions. I think there's a few interesting facets here, though, so here's my take. > What's the most notable way the GPU in particular comes into play? Forward-mode and reverse-mode AD have different expressibility constraints on the kinds of programs that each can efficiently target in the face of dynamism, and GPUs also have fairly constrained programming models compared to the CPU. For me, a big part of the paper was the exploration of the intersection of these two sets of programmability constraints. Section 2.2.4 and the experimental sections explain some of this in detail, but I think one of the more surprising results was that the benefits of fusing dynamic control flow into the broadcasted derivative kernel outweighed potential
Read the rest
detriments e.g. warp divergence. It turns out newer GPU architectures give you more leeway in that regard than any of us on the team expected. > How does caching come into play? Depends on which kind of "caching" you're referring to. If you mean tape-level partial derivative caching/memory usage: Broadcasting a forward-mode derivative operator, as presented in this paper, can save on memory when it enables better fusion than reverse-mode on complicated kernels (resulting in fewer temporaries). However, there is also a question of when this technique should actually be employed: during the forward pass, or during the reverse pass? If employed in the forward pass, then the primal and partial derivative calculations can be fused, reducing compute cost. However, doing so means that the memory required to store the partial derivatives is held captive until those derivatives can be backpropagated in the reverse pass. Conversely, employing the technique in the reverse pass allows you to free the partial derivative storage quickly, but features some redundant computation. Section 2.2.3 of the paper discusses this a bit. If you mean instruction-level caching, i.e. efficient pipelining of memory into registers: On the CPU, it's quite easy to thrash cache for high-arity dual number calculations (i.e. calculations where dual number instances carry around a long stack-allocated array of partial derivatives). Our experiment in Section 3.4.1 tries to characterize the analogous GPU behavior by measuring how occupancy scales with target calculation arity. Also, there was definitely a bit of implementation work to ensure that loads from our GPU-backed "dual number" arrays coalesced properly, that indexing calculations were compiled away when possible, etc. The cool part is that the dual numbers themselves were just the implementation provided by the ForwardDiff package (https://github.com/JuliaDiff/ForwardDiff.jl), which contains no GPU-specific specialization, and they're automagically JIT-compiled for the GPU by CUDAnative (https://github.com/JuliaGPU/CUDAnative.jl). > What about intrinsic condensing functions? Hmm...I'm not positive I know what "intrinsic condensing functions" are. Apologies!
In Dynamic Automatic Differentiation of GPU Broadcast Kernels [pdf]
ScottPJones uses it for string processing, and I have seen him comment on hackernews a few times. He's a big advocate for using it for things other than crunching numbers. For scripts, the JIT overhead has gotten a lot better, and I think it will continue to improve. The strategy is saving more so that it doesn't have to get recompiled on launch. That currently doesn't happen for packages. Which means while R and Python run much slower, they feel much snappier -- and will be much faster if you're just running a bunch of short scripts that wont amortize compilation. So in the short term, I wouldn't use Julia for speed. Multiple dispatch and powerful meta-programming are two other major highlights. Multiple dispatch can make for much simpler, cleaner looking syntax, while often making it easier to remember too -- you only need one name per
Read the rest
concept. I briefly compared explicit SIMD vectorization in Julia and C here: https://bayeswatch.org/2018/08/08/matrix-multiplication-kern... were I to change the vector size, all that'd take in Julia is changing the number of elements, and it'll dispatch correctly. In C... I don't have too much experience with object oriented programming which gives single dispatch, but I like the separation of functions from objects, and freedom of dispatching on any/all of the arguments. If metaprogramming appeals to you, Julia makes that really easy compared to many other languages, with things like the `@eval` macro or `@generated` functions. Any sort of repetitive pattern that isn't easily expressed in array operations can probably be handled pretty simply with metaprogramming. I gave an example of `@generated` in the blog post with matrix multiplication kernels, and a great example of `@eval` is: https://github.com/JuliaDiff/ForwardDiff.jl/blob/master/src/... In that link, ForwardDiff defines a gazillion function overloads for dual numbers for automatic differentiation. Being an interactive language, plus the helpful macro `@macroexpand`, can make it easy to explore and figure out what's going on if you like playing with that sort of stuff. I've heard loads of great things about Rust, too. Hope this helps decide if its worth looking at. My examples were all still analysis-focused, but that's my experience.
In Julia v1.0 has been released

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.