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
281 changes: 141 additions & 140 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 @@ -94,26 +94,27 @@ jobs:
fail-fast: false # TODO: toggle
matrix:
version:
- '1.10'
# - '1.10'
- '1.11'
- '1.12'
# - '1.12'
group:
- ChainRules
- DifferentiateWith
# - ChainRules
# - DifferentiateWith
# - Diffractor
- Enzyme
- FastDifferentiation
- FiniteDiff
- FiniteDifferences
- ForwardDiff
- GTPSA
- Mooncake
- PolyesterForwardDiff
- ReverseDiff
- SparsityDetector
- Symbolics
- Tracker
- Zygote
# - Enzyme
# - FastDifferentiation
# - FiniteDiff
# - FiniteDifferences
# - ForwardDiff
# - GTPSA
# - Mooncake
# - PolyesterForwardDiff
- Reactant
# - 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
5 changes: 4 additions & 1 deletion DifferentiationInterface/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
GTPSA = "b27dd330-f138-47c5-815b-40db9dd9b6e8"
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
Expand All @@ -46,6 +47,7 @@ DifferentiationInterfacePolyesterForwardDiffExt = [
"ForwardDiff",
"DiffResults",
]
DifferentiationInterfaceReactantExt = ["Reactant", "Enzyme"]
DifferentiationInterfaceReverseDiffExt = ["ReverseDiff", "DiffResults"]
DifferentiationInterfaceSparseArraysExt = "SparseArrays"
DifferentiationInterfaceSparseConnectivityTracerExt = "SparseConnectivityTracer"
Expand All @@ -56,7 +58,7 @@ DifferentiationInterfaceTrackerExt = "Tracker"
DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"]

[compat]
ADTypes = "1.18.0"
ADTypes = "1.19.0"
ChainRulesCore = "1.23.0"
DiffResults = "1.1.0"
Diffractor = "=0.2.6"
Expand All @@ -71,6 +73,7 @@ GTPSA = "1.4.0"
LinearAlgebra = "1"
Mooncake = "0.4.175"
PolyesterForwardDiff = "0.1.2"
Reactant = "0.2.178"
ReverseDiff = "1.15.1"
SparseArrays = "1"
SparseConnectivityTracer = "0.6.14, 1"
Expand Down
7 changes: 4 additions & 3 deletions DifferentiationInterface/docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[sources]
DifferentiationInterface = {path = ".."}

[compat]
ADTypes = "1"
BenchmarkTools = "1"
Expand All @@ -26,6 +30,3 @@ SparseConnectivityTracer = "1.1.2"
SparseMatrixColorings = "0.4.23"
Zygote = "0.7.10"
julia = "1.10.10"

[sources]
DifferentiationInterface = { path = ".." }
1 change: 1 addition & 0 deletions DifferentiationInterface/docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ using Zygote: Zygote

links = InterLinks(
"ADTypes" => "https://sciml.github.io/ADTypes.jl/stable/",
"Reactant" => "https://enzymead.github.io/Reactant.jl/stable/",
"SparseConnectivityTracer" => "https://adrianhill.de/SparseConnectivityTracer.jl/stable/",
"SparseMatrixColorings" => "https://gdalle.github.io/SparseMatrixColorings.jl/stable/",
"Symbolics" => "https://symbolics.juliasymbolics.org/stable/",
Expand Down
7 changes: 7 additions & 0 deletions DifferentiationInterface/docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,10 @@ DifferentiationInterface.AutoReverseFromPrimitive
```@docs
DifferentiationInterface.Prep
```

### Reactant

```@docs
AutoReactant
DifferentiationInterface.to_reactant
```
6 changes: 6 additions & 0 deletions DifferentiationInterface/docs/src/explanation/backends.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ We support the following dense backend choices from [ADTypes.jl](https://github.
- [`AutoTracker`](@extref ADTypes.AutoTracker)
- [`AutoZygote`](@extref ADTypes.AutoZygote)

In addition, we provide experimental support for [`AutoReactant`](@extref ADTypes.AutoReactant), sofar only for [`gradient`](@ref) and its variants.
Copy link

Choose a reason for hiding this comment

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

Can we remove the experimental word, but just say the incomplete implementation?

Copy link

Choose a reason for hiding this comment

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

For example it's better supported here than Diffractor listed above as fully supported

Copy link
Member Author

Choose a reason for hiding this comment

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

Diffractor is listed in the README as broken, but sure

Copy link
Member Author

Choose a reason for hiding this comment

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

Another argument for the "experimental" support is protecting us if we decide that we made an API mistake, because breaking an "experimental" feature is arguably ok within SemVer


## Features

Given a backend object, you can use:
Expand Down Expand Up @@ -167,6 +169,10 @@ If a GTPSA [`Descriptor`](https://bmad-sim.github.io/GTPSA.jl/stable/man/b_descr

Most operators fall back on `AutoForwardDiff`.

### Reactant

See the docstring for [`AutoReactant`](@ref).

### ReverseDiff

With `AutoReverseDiff(compile=false)`, preparation preallocates a [config](https://juliadiff.org/ReverseDiff.jl/dev/api/#The-AbstractConfig-API).
Expand Down
Loading
Loading