JuliaDiff / JuliaDiff/DifferentiationInterface.jl
Option for Native AD backend APIs to offer direct stability guarantees ?
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 313
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
Native AD backend APIs often provide better stability and stronger correctness guarantees than DI's layer around them.
eg: https://github.com/chalk-lab/Mooncake.jl/issues/992 - a frule!!/rrule!! inconsistency in nan_tangent_guard causes forward-mode to return NaNwhere reverse-mode returns 0.0. This kind of edge-case divergence between modes is invisible to DI, which wraps each mode independently.
Broadly the concerns are:
- Maintenance burden: each AD backend update can silently break DI's assumptions, requiring downstream fixes (eg https://github.com/JuliaDiff/DifferentiationInterface.jl/issues/986)
- Correctness: bugs like https://github.com/chalk-lab/Mooncake.jl/issues/992 may only surface after multiple layers of wrapping, making diagnosis harder.
- Performance: calling native API is almost always faster as we don't have the DI overhead. (eg https://github.com/JuliaDiff/DifferentiationInterface.jl/issues/854)
Is there a path toward DI where we can either :
- (a) call native backend APIs more directly where they exist, or
- (b) expose a "native-first" mode that bypasses the wrapper for backends that have the latest stable and correct API?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked Mooncake.jl issue #992 and DifferentiationInterface.jl issues #986 and #854, then inspect how DI currently wraps backend APIs. Determine whether direct native calls or a native-first mode can preserve correctness and stability while reducing overhead. Done would require an agreed scope, supported backends, and validation criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100