Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
279 changes: 140 additions & 139 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,71 +16,71 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test-DI-Core:
name: ${{ matrix.version }} - DI Core (${{ matrix.group }})
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
timeout-minutes: 120
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false # TODO: toggle
matrix:
version:
- '1.10'
- '1.11'
- '1.12'
group:
- Internals
- SimpleFiniteDiff
- ZeroBackends
skip_lts:
- ${{ github.event.pull_request.draft }}
skip_pre:
- ${{ github.event.pull_request.draft }}
exclude:
- skip_lts: true
version: '1.10'
- skip_pre: true
version: '1.12'
env:
JULIA_DI_TEST_TYPE: 'Core'
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: x64
- uses: julia-actions/cache@v2
- name: Install dependencies & run tests
run: julia --color=yes -e '
using Pkg;
Pkg.activate("./DifferentiationInterface/test");
if VERSION < v"1.11";
Pkg.rm("DifferentiationInterfaceTest");
Pkg.resolve();
else;
Pkg.develop(; path="./DifferentiationInterfaceTest");
end;
Pkg.activate("./DifferentiationInterface");
test_kwargs = (; allow_reresolve=false, coverage=true);
if ENV["JULIA_DI_PR_DRAFT"] == "true";
Pkg.test("DifferentiationInterface"; julia_args=["-O1"], test_kwargs...);
else;
Pkg.test("DifferentiationInterface"; test_kwargs...);
end;'
- uses: julia-actions/julia-processcoverage@v1
with:
directories: ./DifferentiationInterface/src,./DifferentiationInterface/ext,./DifferentiationInterface/test
- uses: codecov/codecov-action@v5
with:
files: lcov.info
flags: DI
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
# test-DI-Core:
# name: ${{ matrix.version }} - DI Core (${{ matrix.group }})
# runs-on: ubuntu-latest
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
# timeout-minutes: 120
# permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
# actions: write
# contents: read
# strategy:
# fail-fast: false # TODO: toggle
# matrix:
# version:
# - '1.10'
# - '1.11'
# - '1.12'
# group:
# - Internals
# - SimpleFiniteDiff
# - ZeroBackends
# skip_lts:
# - ${{ github.event.pull_request.draft }}
# skip_pre:
# - ${{ github.event.pull_request.draft }}
# exclude:
# - skip_lts: true
# version: '1.10'
# - skip_pre: true
# version: '1.12'
# env:
# JULIA_DI_TEST_TYPE: 'Core'
# JULIA_DI_TEST_GROUP: ${{ matrix.group }}
# JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
# steps:
# - uses: actions/checkout@v6
# - uses: julia-actions/setup-julia@v2
# with:
# version: ${{ matrix.version }}
# arch: x64
# - uses: julia-actions/cache@v2
# - name: Install dependencies & run tests
# run: julia --color=yes -e '
# using Pkg;
# Pkg.activate("./DifferentiationInterface/test");
# if VERSION < v"1.11";
# Pkg.rm("DifferentiationInterfaceTest");
# Pkg.resolve();
# else;
# Pkg.develop(; path="./DifferentiationInterfaceTest");
# end;
# Pkg.activate("./DifferentiationInterface");
# test_kwargs = (; allow_reresolve=false, coverage=true);
# if ENV["JULIA_DI_PR_DRAFT"] == "true";
# Pkg.test("DifferentiationInterface"; julia_args=["-O1"], test_kwargs...);
# else;
# Pkg.test("DifferentiationInterface"; test_kwargs...);
# end;'
# - uses: julia-actions/julia-processcoverage@v1
# with:
# directories: ./DifferentiationInterface/src,./DifferentiationInterface/ext,./DifferentiationInterface/test
# - uses: codecov/codecov-action@v5
# with:
# files: lcov.info
# flags: DI
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: false

test-DI-Backend:
name: ${{ matrix.version }} - DI Back (${{ matrix.group }})
Expand All @@ -98,22 +98,23 @@ jobs:
- '1.11'
- '1.12'
group:
- ChainRules
- DifferentiateWith
# - Diffractor
- Enzyme
- FastDifferentiation
- FiniteDiff
- FiniteDifferences
- ForwardDiff
- GTPSA
- Mooncake
- PolyesterForwardDiff
- ReverseDiff
- SparsityDetector
- Symbolics
- Tracker
- Zygote
# - ChainRules
# - DifferentiateWith
# # - Diffractor
# - Enzyme
# - FastDifferentiation
# - FiniteDiff
# - FiniteDifferences
# - ForwardDiff
# - GTPSA
- HyperHessians
# - Mooncake
# - PolyesterForwardDiff
# - ReverseDiff
# - SparsityDetector
# - Symbolics
# - Tracker
# - Zygote
skip_lts:
- ${{ github.event.pull_request.draft }}
skip_pre:
Expand Down Expand Up @@ -157,61 +158,61 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false

test-DIT:
name: ${{ matrix.version }} - DIT (${{ matrix.group }})
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false # TODO: toggle
matrix:
version:
- '1.10'
- '1.11'
- '1.12'
group:
- Formalities
- Zero
- Standard
- Weird
skip_lts:
- ${{ github.event.pull_request.draft }}
skip_pre:
- ${{ github.event.pull_request.draft }}
exclude:
- skip_lts: true
version: '1.10'
- skip_pre: true
version: '1.12'
env:
JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: x64
- uses: julia-actions/cache@v2
- name: Install dependencies & run tests
run: julia --project=./DifferentiationInterfaceTest --color=yes -e '
using Pkg;
Pkg.Registry.update();
Pkg.develop(path="./DifferentiationInterface");
if ENV["JULIA_DI_PR_DRAFT"] == "true";
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true, julia_args=["-O1"]);
else;
Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true);
end;'
- uses: julia-actions/julia-processcoverage@v1
with:
directories: ./DifferentiationInterfaceTest/src,./DifferentiationInterfaceTest/ext,./DifferentiationInterfaceTest/test
- uses: codecov/codecov-action@v5
with:
files: lcov.info
flags: DIT
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
# test-DIT:
# name: ${{ matrix.version }} - DIT (${{ matrix.group }})
# runs-on: ubuntu-latest
# if: ${{ !contains(github.event.pull_request.labels.*.name, 'skipci') }}
# timeout-minutes: 60
# permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
# actions: write
# contents: read
# strategy:
# fail-fast: false # TODO: toggle
# matrix:
# version:
# - '1.10'
# - '1.11'
# - '1.12'
# group:
# - Formalities
# - Zero
# - Standard
# - Weird
# skip_lts:
# - ${{ github.event.pull_request.draft }}
# skip_pre:
# - ${{ github.event.pull_request.draft }}
# exclude:
# - skip_lts: true
# version: '1.10'
# - skip_pre: true
# version: '1.12'
# env:
# JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
# JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
# steps:
# - uses: actions/checkout@v6
# - uses: julia-actions/setup-julia@v2
# with:
# version: ${{ matrix.version }}
# arch: x64
# - uses: julia-actions/cache@v2
# - name: Install dependencies & run tests
# run: julia --project=./DifferentiationInterfaceTest --color=yes -e '
# using Pkg;
# Pkg.Registry.update();
# Pkg.develop(path="./DifferentiationInterface");
# if ENV["JULIA_DI_PR_DRAFT"] == "true";
# Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true, julia_args=["-O1"]);
# else;
# Pkg.test("DifferentiationInterfaceTest"; allow_reresolve=false, coverage=true);
# end;'
# - uses: julia-actions/julia-processcoverage@v1
# with:
# directories: ./DifferentiationInterfaceTest/src,./DifferentiationInterfaceTest/ext,./DifferentiationInterfaceTest/test
# - uses: codecov/codecov-action@v5
# with:
# files: lcov.info
# flags: DIT
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: false
3 changes: 3 additions & 0 deletions DifferentiationInterface/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Diffractor = "9f5e2b26-1114-432f-b630-d3fe2085c51c"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be"
HyperHessians = "06b494a0-c8e0-40cc-ad32-d99506a00a6c"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Expand All @@ -38,6 +39,7 @@ DifferentiationInterfaceFastDifferentiationExt = "FastDifferentiation"
DifferentiationInterfaceFiniteDiffExt = "FiniteDiff"
DifferentiationInterfaceFiniteDifferencesExt = "FiniteDifferences"
DifferentiationInterfaceForwardDiffExt = ["ForwardDiff", "DiffResults"]
DifferentiationInterfaceHyperHessiansExt = "HyperHessians"
DifferentiationInterfaceGPUArraysCoreExt = "GPUArraysCore"
DifferentiationInterfaceGTPSAExt = "GTPSA"
DifferentiationInterfaceMooncakeExt = "Mooncake"
Expand All @@ -63,6 +65,7 @@ Diffractor = "=0.2.6"
Enzyme = "0.13.39"
EnzymeCore = "0.8.8"
FastDifferentiation = "0.4.3"
HyperHessians = "0.1"
FiniteDiff = "2.27.0"
FiniteDifferences = "0.12.31"
ForwardDiff = "0.10.36,1"
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)
- [HyperHessians.jl](https://github.com/KristofferC/HyperHessians.jl)
- [GTPSA.jl](https://github.com/bmad-sim/GTPSA.jl)
- [Mooncake.jl](https://github.com/chalk-lab/Mooncake.jl)
- [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl)
Expand Down
2 changes: 2 additions & 0 deletions DifferentiationInterface/docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
HyperHessians = "06b494a0-c8e0-40cc-ad32-d99506a00a6c"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -21,6 +22,7 @@ Documenter = "1"
DocumenterInterLinks = "1.1"
FiniteDiff = "2.29"
ForwardDiff = "1.2.2"
HyperHessians = "0.1"
PrettyTables = "3.1"
SparseConnectivityTracer = "1.1.2"
SparseMatrixColorings = "0.4.23"
Expand Down
7 changes: 5 additions & 2 deletions DifferentiationInterface/docs/src/explanation/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ We support the following dense backend choices from [ADTypes.jl](https://github.
- [`AutoFiniteDifferences`](@extref ADTypes.AutoFiniteDifferences)
- [`AutoForwardDiff`](@extref ADTypes.AutoForwardDiff)
- [`AutoGTPSA`](@extref ADTypes.AutoGTPSA)
- [`AutoHyperHessians`](https://github.com/KristofferC/HyperHessians.jl)
- [`AutoMooncake`](@extref ADTypes.AutoMooncake) and [`AutoMooncakeForward`](@extref ADTypes.AutoMooncake) (the latter is experimental)
- [`AutoPolyesterForwardDiff`](@extref ADTypes.AutoPolyesterForwardDiff)
- [`AutoReverseDiff`](@extref ADTypes.AutoReverseDiff)
Expand All @@ -32,11 +33,11 @@ In practice, many AD backends have custom implementations for high-level operato
!!! details

In the rough summary table below,

- ✅ means that we reuse the custom implementation from the backend;
- ❌ means that a custom implementation doesn't exist, so we use our default fallbacks;
- 🔀 means it's complicated or not done yet.

| | `pf` | `pb` | `der` | `grad` | `jac` | `hess` | `hvp` | `der2` |
|:-------------------------- |:---- |:---- |:----- |:------ |:----- |:------ |:----- |:------ |
| `AutoChainRules` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Expand All @@ -48,6 +49,7 @@ In practice, many AD backends have custom implementations for high-level operato
| `AutoFiniteDifferences` | 🔀 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
| `AutoForwardDiff` | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| `AutoGTPSA` | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
| `AutoHyperHessians` | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
| `AutoMooncake` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| `AutoMooncakeForward` | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| `AutoPolyesterForwardDiff` | 🔀 | ❌ | 🔀 | ✅ | ✅ | 🔀 | 🔀 | 🔀 |
Expand All @@ -69,6 +71,7 @@ Moreover, each context type is supported by a specific subset of backends:
| `AutoFiniteDifferences` | ✅ | ✅ |
| `AutoForwardDiff` | ✅ | ✅ |
| `AutoGTPSA` | ✅ | ❌ |
| `AutoHyperHessians` | ✅ | ✅ |
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you support caches, that would require dealing with hyperdual element types

| `AutoMooncake` | ✅ | ✅ |
| `AutoMooncakeForward` | ✅ | ✅ |
| `AutoPolyesterForwardDiff` | ✅ | ✅ |
Expand Down
Loading
Loading