Skip to content

Commit

Permalink
Replace AD package extensions with DifferentiationInterface (#51)
Browse files Browse the repository at this point in the history
* Adapt to Julia 1.11

* Changelog

* Replace AD package extensions with DifferentiationInterface

* Mark broken test as broken

* Temporarily go back to v0.3.14

* Run tests with custom branch of Manifolds

* Fix version

* Fix deps

* Remove Pkg trick
  • Loading branch information
gdalle authored Nov 27, 2024
1 parent cbee92a commit 1715f95
Show file tree
Hide file tree
Showing 22 changed files with 151 additions and 312 deletions.
3 changes: 2 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ All notable changes to this Julia package will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.14] unreleased
## [0.4.0] unreleased

### Changed

* Switch from manual backend creation to [ADTypes.jl](https://github.com/SciML/ADTypes.jl) + [DifferentiationInterface.jl](https://github.com/JuliaDiff/DifferentiationInterface.jl)
* Julia compat lower bound bumped from 1.6 to 1.10 (the new LTS)

## [0.3.13] November 13, 2024
Expand Down
34 changes: 24 additions & 10 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name = "ManifoldDiff"
uuid = "af67fdf4-a580-4b9f-bbec-742ef357defd"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>"]
version = "0.3.14"
version = "0.4.0"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand All @@ -17,18 +19,12 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[extensions]
ManifoldDiffFiniteDiffExt = "FiniteDiff"
ManifoldDiffFiniteDifferencesExt = "FiniteDifferences"
ManifoldDiffForwardDiffExt = "ForwardDiff"
ManifoldDiffReverseDiffExt = "ReverseDiff"
ManifoldDiffZygoteExt = "Zygote"

[compat]
ADTypes = "1.11.0"
ChainRules = "1"
ChainRulesCore = "1"
DifferentiationInterface = "0.6.23"
DoubleFloats = ">= 0.9.2"
ForwardDiff = "0.10"
Manifolds = "0.10"
ManifoldsBase = "0.15"
RecursiveArrayTools = "2, 3"
Expand All @@ -37,8 +33,10 @@ StaticArrays = "1"
julia = "1.10"

[extras]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
Expand All @@ -52,4 +50,20 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["Test", "ChainRules", "ChainRulesCore", "DoubleFloats", "FiniteDiff", "FiniteDifferences", "ForwardDiff", "Manifolds", "OrdinaryDiffEq", "RecursiveArrayTools", "ReverseDiff", "StaticArrays", "Zygote"]
test = [
"Test",
"ADTypes",
"ChainRules",
"ChainRulesCore",
"DifferentiationInterface",
"DoubleFloats",
"FiniteDiff",
"FiniteDifferences",
"ForwardDiff",
"Manifolds",
"OrdinaryDiffEq",
"RecursiveArrayTools",
"ReverseDiff",
"StaticArrays",
"Zygote",
]
20 changes: 1 addition & 19 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,14 @@ end

using ManifoldsBase, ManifoldDiff
using Documenter, DocumenterCitations
using FiniteDiff, ForwardDiff, ReverseDiff, FiniteDifferences, Zygote

bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style = :alpha)
makedocs(;
format = Documenter.HTML(;
prettyurls = (get(ENV, "CI", nothing) == "true") || ("--prettyurls" ARGS),
assets = ["assets/favicon.ico", "assets/citations.css"],
),
modules = [
ManifoldDiff,
isdefined(Base, :get_extension) ?
Base.get_extension(ManifoldDiff, :ManifoldDiffFiniteDiffExt) :
ManifoldDiff.ManifoldDiffFiniteDiffExt,
isdefined(Base, :get_extension) ?
Base.get_extension(ManifoldDiff, :ManifoldDiffFiniteDifferencesExt) :
ManifoldDiff.ManifoldDiffFiniteDifferencesExt,
isdefined(Base, :get_extension) ?
Base.get_extension(ManifoldDiff, :ManifoldDiffForwardDiffExt) :
ManifoldDiff.ManifoldDiffForwardDiffExt,
isdefined(Base, :get_extension) ?
Base.get_extension(ManifoldDiff, :ManifoldDiffReverseDiffExt) :
ManifoldDiff.ManifoldDiffReverseDiffExt,
isdefined(Base, :get_extension) ?
Base.get_extension(ManifoldDiff, :ManifoldDiffZygoteExt) :
ManifoldDiff.ManifoldDiffZygoteExt,
],
modules = [ManifoldDiff],
authors = "Seth Axen, Mateusz Baran, Ronny Bergmann, and contributors.",
sitename = "ManifoldDiff.jl",
pages = [
Expand Down
29 changes: 5 additions & 24 deletions docs/src/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,15 @@ set_default_differential_backend!
default_differential_backend
```

## EmbeddedDiff

```@autodocs
Modules = [ManifoldDiff]
Pages = ["embedded_diff.jl"]
Order = [:type, :function, :constant]
```
## Euclidian backends

## ForwardDiff.jl
Euclidian backend objects can be taken from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
See the documentation of [DifferentiationInterface.jl](https://github.com/JuliaDiff/DifferentiationInterface.jl) for the list of supported packages.

```@autodocs
Modules = [ManifoldDiff]
Pages = ["forward_diff.jl"]
Order = [:type, :function, :constant]
```

## FiniteDiff.jl
## EmbeddedDiff

```@autodocs
Modules = [ManifoldDiff]
Pages = ["finite_diff.jl"]
Pages = ["embedded_diff.jl"]
Order = [:type, :function, :constant]
```

## FiniteDifferenes.jl

```@autodocs
Modules = [ManifoldDiff]
Pages = ["finite_differences.jl"]
Order = [:type, :function, :constant]
```
1 change: 0 additions & 1 deletion docs/src/internals.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## Internal functions

```@docs
ManifoldDiff.AbstractDiffBackend
ManifoldDiff.CurrentDiffBackend
ManifoldDiff._current_default_differential_backend
ManifoldDiff._hessian
Expand Down
28 changes: 0 additions & 28 deletions ext/ManifoldDiffFiniteDiffExt.jl

This file was deleted.

31 changes: 0 additions & 31 deletions ext/ManifoldDiffFiniteDifferencesExt.jl

This file was deleted.

31 changes: 0 additions & 31 deletions ext/ManifoldDiffForwardDiffExt.jl

This file was deleted.

15 changes: 0 additions & 15 deletions ext/ManifoldDiffReverseDiffExt.jl

This file was deleted.

16 changes: 0 additions & 16 deletions ext/ManifoldDiffZygoteExt.jl

This file was deleted.

Loading

2 comments on commit 1715f95

@mateuszbaran
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release Notes:

Changed

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/120257

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.0 -m "<description of version>" 1715f9509b5da9a041c7e27037c11b13a9eba1c5
git push origin v0.4.0

Please sign in to comment.