Skip to content

Commit cb6801e

Browse files
KristofferCKristofferCgdalle
authored
feat: add support for HyperHessian backend (#940)
* WIP: Add support for HyperHessian backend * only run HyperHessians tests * less tests * also have source for HyperHessians * package is now registerd * address review comments * updates * fixups and use ADTypes HyperHessians * bump compat for ADTypes * Add JET to test env * Docs fixes and version bump --------- Co-authored-by: KristofferC <kristoffer.carlsson@juliacomputing.com> Co-authored-by: Guillaume Dalle <22795598+gdalle@users.noreply.github.com>
1 parent d38d905 commit cb6801e

10 files changed

Lines changed: 381 additions & 6 deletions

File tree

.github/workflows/Test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
- FiniteDifferences
101101
- ForwardDiff
102102
- GTPSA
103+
- HyperHessians
103104
- Mooncake
104105
- Mooncake-old
105106
- PolyesterForwardDiff

DifferentiationInterface/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.17...main)
8+
## [Unreleased](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.18...main)
9+
10+
## [0.7.18](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.17...DifferentiationInterface-v0.7.18)
11+
12+
### Added
13+
14+
- Add support for HyperHessians backend ([#940](https://github.com/JuliaDiff/DifferentiationInterface.jl/pull/940))
915

1016
## [0.7.17](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterface-v0.7.16...DifferentiationInterface-v0.7.17)
1117

DifferentiationInterface/Project.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DifferentiationInterface"
22
uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
3-
version = "0.7.17"
3+
version = "0.7.18"
44
authors = ["Guillaume Dalle", "Adrian Hill"]
55

66
[deps]
@@ -15,6 +15,7 @@ Diffractor = "9f5e2b26-1114-432f-b630-d3fe2085c51c"
1515
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
1616
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
1717
FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be"
18+
HyperHessians = "06b494a0-c8e0-40cc-ad32-d99506a00a6c"
1819
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
1920
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
2021
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
@@ -40,6 +41,7 @@ DifferentiationInterfaceFiniteDiffExt = "FiniteDiff"
4041
DifferentiationInterfaceFiniteDifferencesExt = "FiniteDifferences"
4142
DifferentiationInterfaceForwardDiffExt = ["ForwardDiff", "DiffResults"]
4243
DifferentiationInterfaceGPUArraysCoreExt = ["GPUArraysCore", "Adapt"]
44+
DifferentiationInterfaceHyperHessiansExt = "HyperHessians"
4345
DifferentiationInterfaceGTPSAExt = "GTPSA"
4446
DifferentiationInterfaceMooncakeExt = "Mooncake"
4547
DifferentiationInterfacePolyesterForwardDiffExt = [
@@ -58,7 +60,7 @@ DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"]
5860

5961
[compat]
6062
Adapt = "4.5.0"
61-
ADTypes = "1.18.0"
63+
ADTypes = "1.22.0"
6264
ChainRulesCore = "1.23.0"
6365
DiffResults = "1.1.0"
6466
Diffractor = "=0.2.6"
@@ -70,6 +72,7 @@ FiniteDifferences = "0.12.31"
7072
ForwardDiff = "0.10.36,1"
7173
GPUArraysCore = "0.2"
7274
GTPSA = "1.4.0"
75+
HyperHessians = "0.2"
7376
LinearAlgebra = "1"
7477
Mooncake = "0.5.1"
7578
PolyesterForwardDiff = "0.1.2"

DifferentiationInterface/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ We support the following backends defined by [ADTypes.jl](https://github.com/Sci
3434
- [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl)
3535
- [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl)
3636
- [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl)
37+
- [HyperHessians.jl](https://github.com/KristofferC/HyperHessians.jl)
3738
- [GTPSA.jl](https://github.com/bmad-sim/GTPSA.jl)
3839
- [Mooncake.jl](https://github.com/chalk-lab/Mooncake.jl)
3940
- [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl)

DifferentiationInterface/docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
66
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
77
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
88
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
9+
HyperHessians = "06b494a0-c8e0-40cc-ad32-d99506a00a6c"
910
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
1011
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
1112
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -21,6 +22,7 @@ Documenter = "1"
2122
DocumenterInterLinks = "1.1"
2223
FiniteDiff = "2.29"
2324
ForwardDiff = "1.2.2"
25+
HyperHessians = "0.2"
2426
PrettyTables = "3.1"
2527
SparseConnectivityTracer = "1.1.2"
2628
SparseMatrixColorings = "0.4.23"

DifferentiationInterface/docs/src/explanation/backends.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ We support the following dense backend choices from [ADTypes.jl](https://github.
1212
- [`AutoFiniteDifferences`](@extref ADTypes.AutoFiniteDifferences)
1313
- [`AutoForwardDiff`](@extref ADTypes.AutoForwardDiff)
1414
- [`AutoGTPSA`](@extref ADTypes.AutoGTPSA)
15+
- [`AutoHyperHessians`](@extref ADTypes.AutoHyperHessians)
1516
- [`AutoMooncake`](@extref ADTypes.AutoMooncake) and [`AutoMooncakeForward`](@extref ADTypes.AutoMooncake) (the latter is experimental)
1617
- [`AutoPolyesterForwardDiff`](@extref ADTypes.AutoPolyesterForwardDiff)
1718
- [`AutoReverseDiff`](@extref ADTypes.AutoReverseDiff)
@@ -32,11 +33,11 @@ In practice, many AD backends have custom implementations for high-level operato
3233
!!! details
3334

3435
In the rough summary table below,
35-
36+
3637
- ✅ means that we reuse the custom implementation from the backend;
3738
- ❌ means that a custom implementation doesn't exist, so we use our default fallbacks;
3839
- 🔀 means it's complicated or not done yet.
39-
40+
4041
| | `pf` | `pb` | `der` | `grad` | `jac` | `hess` | `hvp` | `der2` |
4142
|:-------------------------- |:---- |:---- |:----- |:------ |:----- |:------ |:----- |:------ |
4243
| `AutoChainRules` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
@@ -48,6 +49,7 @@ In practice, many AD backends have custom implementations for high-level operato
4849
| `AutoFiniteDifferences` | 🔀 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
4950
| `AutoForwardDiff` | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
5051
| `AutoGTPSA` | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
52+
| `AutoHyperHessians` | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
5153
| `AutoMooncake` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
5254
| `AutoMooncakeForward` | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
5355
| `AutoPolyesterForwardDiff` | 🔀 | ❌ | 🔀 | ✅ | ✅ | 🔀 | 🔀 | 🔀 |
@@ -69,6 +71,7 @@ Moreover, each context type is supported by a specific subset of backends:
6971
| `AutoFiniteDifferences` |||
7072
| `AutoForwardDiff` |||
7173
| `AutoGTPSA` |||
74+
| `AutoHyperHessians` |||
7275
| `AutoMooncake` |||
7376
| `AutoMooncakeForward` |||
7477
| `AutoPolyesterForwardDiff` |||

0 commit comments

Comments
 (0)