Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5a69e77
add extension directory
mattsignorelli Jun 17, 2024
aeedb5d
derivative,second derivative, gradient
mattsignorelli Jun 18, 2024
9572d57
jacobian, hessian
mattsignorelli Jun 18, 2024
6e69e6c
add GTPSA to Project.toml, move AutoGTPSA to ADTypes
mattsignorelli Jun 24, 2024
a39fd4e
Fix tests
gdalle Jun 25, 2024
a2df56f
Merge remote-tracking branch 'origin' into pr/mattsignorelli/329
gdalle Jun 25, 2024
79d6ee1
Lighter workflow
gdalle Jun 25, 2024
cee4b7e
pushforward
mattsignorelli Jul 7, 2024
b362dd9
trigger workflow
mattsignorelli Jul 7, 2024
1473858
fix tests?
mattsignorelli Jul 7, 2024
20c026a
fix typo
mattsignorelli Jul 7, 2024
29029b3
Merge branch 'main' into pr/mattsignorelli/329
gdalle Jul 15, 2024
23ce9fd
Merge branch 'addgtpsa' of github.com:mattsignorelli/DifferentiationI…
gdalle Jul 15, 2024
45012c7
hvp done and two args done
mattsignorelli Aug 7, 2024
3afbbb9
fix typo
mattsignorelli Aug 7, 2024
9943008
Merge branch 'addgtpsa' into main
mattsignorelli Aug 7, 2024
1493573
Merge pull request #1 from mattsignorelli/main
mattsignorelli Aug 7, 2024
3039528
Update Test.yml
mattsignorelli Aug 7, 2024
ecee93e
no code coverage
mattsignorelli Aug 7, 2024
f0a0d79
add GTPSA test
mattsignorelli Aug 7, 2024
8997b93
almost all tests passing, bugs in pushforward
mattsignorelli Aug 8, 2024
b9ae5e0
all tests passing
mattsignorelli Aug 8, 2024
12ac9d9
latest GTPSA version specified, docs updated
mattsignorelli Aug 8, 2024
5c40296
no coverage test
mattsignorelli Aug 8, 2024
3ed2f08
Fix formatting and docs
gdalle Aug 8, 2024
5022e2e
Exclude GTPSA from LTS testing
gdalle Aug 8, 2024
5f4c34c
Reactivate coverage
gdalle Aug 8, 2024
037df40
Reactivate all tests
gdalle Aug 8, 2024
c7e1382
Test group
gdalle Aug 8, 2024
65d5a4e
simplified code and removed derivative
mattsignorelli Aug 9, 2024
1819835
Merge remote-tracking branch 'origin' into pr/mattsignorelli/329
gdalle Aug 26, 2024
cbf0c49
Merge remote-tracking branch 'origin/main' into pr/mattsignorelli/329
gdalle Sep 17, 2024
8a3a239
Adapt to new Tangents
gdalle Sep 17, 2024
f663484
Tangents import
gdalle Sep 17, 2024
a388cfc
Fix da fixes
gdalle Sep 17, 2024
ef77111
Merge remote-tracking branch 'origin/main' into pr/mattsignorelli/329
gdalle Sep 18, 2024
bd70675
Remove temporary backend
gdalle Sep 18, 2024
77e49d6
Fixes
gdalle Sep 18, 2024
dacf84d
Docs
gdalle Sep 18, 2024
c1044e5
Merge branch 'main' into addgtpsa
mattsignorelli Jan 6, 2025
f67c9aa
GTPSAExt devel in progress
mattsignorelli Jan 6, 2025
97a2f5a
one arg done
mattsignorelli Jan 7, 2025
9a3fddf
all tests except hvp passing, should have full code cov
mattsignorelli Jan 7, 2025
ea203eb
bump gtpsa version
mattsignorelli Jan 8, 2025
637f66e
fix hvp functions and docs update
mattsignorelli Jan 8, 2025
cfe4c95
fix typo
mattsignorelli Jan 8, 2025
731e9da
one more typo (sorry)
mattsignorelli Jan 8, 2025
6701e95
JuliaFormatter
mattsignorelli Jan 8, 2025
52ecdf6
Update DifferentiationInterface/docs/Project.toml
mattsignorelli Jan 23, 2025
840e136
Better clarification of "variables" in GTPSA
mattsignorelli Jan 23, 2025
c970426
address comments
mattsignorelli Jan 23, 2025
c1931c1
no implicit imports test
mattsignorelli Jan 23, 2025
7c5e6bc
Merge branch 'JuliaDiff:main' into addgtpsa
mattsignorelli Jan 23, 2025
3473422
fixes and formatting
mattsignorelli Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- Back/FiniteDiff
- Back/FiniteDifferences
- Back/ForwardDiff
- Back/GTPSA
- Back/Mooncake
- Back/PolyesterForwardDiff
- Back/ReverseDiff
Expand Down
4 changes: 4 additions & 0 deletions DifferentiationInterface/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GTPSA = "b27dd330-f138-47c5-815b-40db9dd9b6e8"
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Expand All @@ -35,6 +36,7 @@ DifferentiationInterfaceFastDifferentiationExt = "FastDifferentiation"
DifferentiationInterfaceFiniteDiffExt = "FiniteDiff"
DifferentiationInterfaceFiniteDifferencesExt = "FiniteDifferences"
DifferentiationInterfaceForwardDiffExt = ["ForwardDiff", "DiffResults"]
DifferentiationInterfaceGTPSAExt = "GTPSA"
DifferentiationInterfaceMooncakeExt = "Mooncake"
DifferentiationInterfacePolyesterForwardDiffExt = "PolyesterForwardDiff"
DifferentiationInterfaceReverseDiffExt = ["ReverseDiff", "DiffResults"]
Expand All @@ -57,6 +59,7 @@ FastDifferentiation = "0.4.1"
FiniteDiff = "2.23.1"
FiniteDifferences = "0.12.31"
ForwardDiff = "0.10.36"
GTPSA = "1.4.0"
JuliaFormatter = "1"
LinearAlgebra = "<0.0.1,1"
Mooncake = "0.4.52"
Expand Down Expand Up @@ -84,6 +87,7 @@ FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
GTPSA = "b27dd330-f138-47c5-815b-40db9dd9b6e8"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
Expand Down
1 change: 1 addition & 0 deletions DifferentiationInterface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ We support the following backends defined by [ADTypes.jl](https://github.com/Sci
- [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl)
- [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl)
- [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl)
- [GTPSA.jl](https://github.com/bmad-sim/GTPSA.jl)
- [Mooncake.jl](https://github.com/compintell/Mooncake.jl)
- [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl)
- [ReverseDiff.jl](https://github.com/JuliaDiff/ReverseDiff.jl)
Expand Down
12 changes: 12 additions & 0 deletions DifferentiationInterface/docs/src/explanation/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ We support the following dense backend choices from [ADTypes.jl](https://github.
- [`AutoFiniteDiff`](@extref ADTypes.AutoFiniteDiff)
- [`AutoFiniteDifferences`](@extref ADTypes.AutoFiniteDifferences)
- [`AutoForwardDiff`](@extref ADTypes.AutoForwardDiff)
- [`AutoGTPSA`](@extref ADTypes.AutoGTPSA)
- [`AutoMooncake`](@extref ADTypes.AutoMooncake)
- [`AutoPolyesterForwardDiff`](@extref ADTypes.AutoPolyesterForwardDiff)
- [`AutoReverseDiff`](@extref ADTypes.AutoReverseDiff)
Expand Down Expand Up @@ -45,6 +46,7 @@ In practice, many AD backends have custom implementations for high-level operato
| `AutoFiniteDiff` | 🔀 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| `AutoFiniteDifferences` | 🔀 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
| `AutoForwardDiff` | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| `AutoGTPSA` | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
| `AutoMooncake` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| `AutoPolyesterForwardDiff` | 🔀 | ❌ | 🔀 | ✅ | ✅ | 🔀 | 🔀 | 🔀 |
| `AutoReverseDiff` | ❌ | 🔀 | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
Expand All @@ -64,6 +66,7 @@ Moreover, each context type is supported by a specific subset of backends:
| `AutoFiniteDiff` | ✅ |
| `AutoFiniteDifferences` | ✅ |
| `AutoForwardDiff` | ✅ |
| `AutoGTPSA` | ✅ |
| `AutoMooncake` | ✅ |
| `AutoPolyesterForwardDiff` | ✅ |
| `AutoReverseDiff` | ✅ |
Expand Down Expand Up @@ -138,6 +141,15 @@ Nothing specific to mention.
We implement [`pushforward`](@ref) directly using [`Dual` numbers](https://juliadiff.org/ForwardDiff.jl/stable/dev/how_it_works/), and preparation allocates the necessary space.
For higher level operators, preparation creates a [config object](https://juliadiff.org/ForwardDiff.jl/stable/user/api/#Preallocating/Configuring-Work-Buffers), which can be type-unstable.

### GTPSA

For all operators, preparation preallocates the input [`TPS`s](https://bmad-sim.github.io/GTPSA.jl/stable/man/c_tps/), and for in-place functions the output `TPS`s as well. For minimal allocations of `TPS` temporaries inside of a function, the [`@FastGTPSA`/`@FastGTPSA!`](https://bmad-sim.github.io/GTPSA.jl/stable/man/j_fastgtpsa/) macros are recommended.

If a GTPSA [`Descriptor`](https://bmad-sim.github.io/GTPSA.jl/stable/man/b_descriptor/) is not provided to `AutoGTPSA`, then a `Descriptor` will be generated in preparation based on the context.

!!! danger
When providing a custom GTPSA `Descriptor` to `AutoGTPSA`, it is the responsibility of the user to ensure that the number of [GTPSA "variables"](https://bmad-sim.github.io/GTPSA.jl/stable/quickstart/#Calculating-a-Truncated-Power-Series) specified in the `Descriptor` is consistent with the number of inputs of the provided function. Undefined behavior and crashes may occur if this is not the case.

### PolyesterForwardDiff

Most operators fall back on `AutoForwardDiff`.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module DifferentiationInterfaceGTPSAExt

import DifferentiationInterface as DI
using ADTypes: AutoGTPSA
using GTPSA: GTPSA, TPS, Descriptor

DI.check_available(::AutoGTPSA) = true

Check warning on line 7 in DifferentiationInterface/ext/DifferentiationInterfaceGTPSAExt/DifferentiationInterfaceGTPSAExt.jl

View check run for this annotation

Codecov / codecov/patch

DifferentiationInterface/ext/DifferentiationInterfaceGTPSAExt/DifferentiationInterfaceGTPSAExt.jl#L7

Added line #L7 was not covered by tests

include("onearg.jl")
include("twoarg.jl")

end
Loading
Loading