Skip to content

Commit

Permalink
Adapt CI to new LTS (#553)
Browse files Browse the repository at this point in the history
* Test Enzyme on 1.11

* Adapt CI to new LTS

* Rename LTS

* Replace Enzyme with Zygote in the docs

* Rm Enzyme

* Fix DW

* Otto
  • Loading branch information
gdalle authored Oct 8, 2024
1 parent efb5acf commit 3470e14
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.10' # TODO: 1
version: '1' # TODO: 1
- uses: julia-actions/cache@v1
- name: Install dependencies
run: julia --project=${{ matrix.pkg.dir}}/docs/ -e '
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
actions: write
contents: read
strategy:
fail-fast: false
fail-fast: true
matrix:
version:
- "1.10" # TODO: 1 (as of 2024.10.08, 1 means 1.11 and we're not ready yet)
- "1.11"
- "1.10"
- "1"
group:
- Misc/Internals
- Misc/DifferentiateWith
Expand All @@ -49,16 +49,16 @@ jobs:
- Back/Zygote
- Down/Flux
- Down/Lux
skip_pre:
skip_lts:
- ${{ github.event.pull_request.draft }}
exclude:
- skip_pre: true
version: "1.11"
- version: "1.11"
# - skip_lts: true
# version: "1.10"
- version: "1"
group: Back/ChainRulesBackends
- version: "1.11"
- version: "1"
group: Back/Enzyme
- version: "1.11"
- version: "1"
group: Back/Mooncake
env:
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
Expand Down Expand Up @@ -98,18 +98,18 @@ jobs:
fail-fast: true
matrix:
version:
- "1.10" # TODO: 1
- "1.11"
- "1.10"
- "1"
group:
- Formalities
- Zero
- Standard
- Weird
skip_pre:
skip_lts:
- ${{ github.event.pull_request.draft }}
exclude:
- skip_pre: true
version: "1.11"
# exclude:
# - skip_lts: true
# version: "1.10"
env:
JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion DifferentiationInterface/docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
DocumenterMermaid = "a078cd44-4d9c-4618-b545-3ab9d77f9177"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Expand Down
1 change: 0 additions & 1 deletion DifferentiationInterface/docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using DocumenterMermaid
using DocumenterInterLinks

using ADTypes: ADTypes
using Enzyme: Enzyme
using ForwardDiff: ForwardDiff
using Zygote: Zygote

Expand Down
6 changes: 3 additions & 3 deletions DifferentiationInterface/docs/src/tutorials/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ Beware that the `prep` object is nearly always mutated by differentiation operat
## Switching backends

The whole point of DifferentiationInterface.jl is that you can easily experiment with different AD solutions.
Typically, for gradients, reverse mode AD might be a better fit, so let's try the state-of-the-art [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl)!
Typically, for gradients, reverse mode AD might be a better fit, so let's try [Zygote.jl](https://github.com/FluxML/Zygote.jl)!

```@example tuto_basic
import Enzyme
import Zygote
backend2 = AutoEnzyme()
backend2 = AutoZygote()
```

Once the backend is created, things run smoothly with exactly the same syntax as before:
Expand Down
4 changes: 2 additions & 2 deletions DifferentiationInterface/src/misc/differentiate_with.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ Moreover, any larger algorithm `alg` that calls `f2` instead of `f` will also be
```jldoctest
julia> using DifferentiationInterface
julia> import Enzyme, ForwardDiff, Zygote
julia> import FiniteDiff, ForwardDiff, Zygote
julia> function f(x::Vector{Float64})
a = Vector{Float64}(undef, 1) # type constraint breaks ForwardDiff
a[1] = sum(abs2, x) # mutation breaks Zygote
return a[1]
end;
julia> f2 = DifferentiateWith(f, AutoEnzyme());
julia> f2 = DifferentiateWith(f, AutoFiniteDiff());
julia> f([3.0, 5.0]) == f2([3.0, 5.0])
true
Expand Down
3 changes: 1 addition & 2 deletions DifferentiationInterfaceTest/docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
DifferentiationInterfaceTest = "a82114a7-5aa3-49a8-9643-716bb13727a3"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
Documenter = "1"
4 changes: 2 additions & 2 deletions DifferentiationInterfaceTest/docs/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ We present a typical workflow with DifferentiationInterfaceTest.jl, building on

```@repl tuto
using DifferentiationInterface, DifferentiationInterfaceTest
import ForwardDiff, Enzyme
import ForwardDiff, Zygote
```

## Introduction

The AD backends we want to compare are [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) and [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl).

```@example tuto
backends = [AutoForwardDiff(), AutoEnzyme(; mode=Enzyme.Reverse)]
backends = [AutoForwardDiff(), AutoZygote()]
```

To do that, we are going to take gradients of a simple function:
Expand Down

0 comments on commit 3470e14

Please sign in to comment.