Skip to content

Commit a5fb081

Browse files
authored
chore: test on Julia 1.12 with JET 0.10 (#841)
* chore: test on Julia 1.12 with JET 0.10 * Skip type stability on 1.12 * Fix * Apply suggestions from code review
1 parent ced97ee commit a5fb081

File tree

12 files changed

+50
-31
lines changed

12 files changed

+50
-31
lines changed

.github/workflows/Test.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ jobs:
2525
actions: write
2626
contents: read
2727
strategy:
28-
fail-fast: false # TODO: toggle
28+
fail-fast: true # TODO: toggle
2929
matrix:
3030
version:
31-
- "1.10"
31+
- "lts"
3232
- "1"
33+
- "pre"
3334
group:
3435
- Core/Internals
3536
- Back/DifferentiateWith
@@ -53,11 +54,21 @@ jobs:
5354
- Down/Lux
5455
skip_lts:
5556
- ${{ github.event.pull_request.draft }}
57+
skip_pre:
58+
- ${{ github.event.pull_request.draft }}
5659
exclude:
5760
- skip_lts: true
58-
version: "1.10"
61+
version: "lts"
62+
- skip_pre: true
63+
version: "pre"
5964
- version: "1"
6065
group: Back/ChainRules
66+
- version: "pre"
67+
group: Back/Enzyme
68+
- version: "pre"
69+
group: Back/Mooncake
70+
- version: "pre"
71+
group: Back/DifferentiateWith
6172
env:
6273
JULIA_DI_TEST_GROUP: ${{ matrix.group }}
6374
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}
@@ -100,18 +111,23 @@ jobs:
100111
fail-fast: true
101112
matrix:
102113
version:
103-
- "1.10"
114+
- "lts"
104115
- "1"
116+
- "pre"
105117
group:
106118
- Formalities
107119
- Zero
108120
- Standard
109121
- Weird
110122
skip_lts:
111123
- ${{ github.event.pull_request.draft }}
124+
skip_pre:
125+
- ${{ github.event.pull_request.draft }}
112126
exclude:
113127
- skip_lts: true
114-
version: "1.10"
128+
version: "lts"
129+
- skip_pre: true
130+
version: "pre"
115131
env:
116132
JULIA_DIT_TEST_GROUP: ${{ matrix.group }}
117133
JULIA_DI_PR_DRAFT: ${{ github.event.pull_request.draft }}

DifferentiationInterface/test/Back/Enzyme/test.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,6 @@ end;
7474
)
7575
end
7676

77-
#=
78-
# TODO: reactivate type stability tests
79-
80-
test_differentiation(
81-
AutoEnzyme(; mode=Enzyme.Forward), # TODO: add more
82-
default_scenarios(; include_batchified=false);
83-
correctness=false,
84-
type_stability=:prepared,
85-
excluded=SECOND_ORDER,
86-
logging=LOGGING,
87-
);
88-
=#
89-
9077
@testset "Second order" begin
9178
test_differentiation(
9279
[

DifferentiationInterface/test/Back/ForwardDiff/test.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,16 @@ end
4848
)
4949

5050
test_differentiation(
51-
AutoForwardDiff(); correctness=false, type_stability=:prepared, logging=LOGGING
51+
AutoForwardDiff();
52+
correctness=false,
53+
type_stability=safetypestab(:prepared),
54+
logging=LOGGING,
5255
)
5356

5457
test_differentiation(
5558
AutoForwardDiff(; chunksize=5);
5659
correctness=false,
57-
type_stability=:full,
60+
type_stability=safetypestab(:full),
5861
excluded=[:hessian],
5962
logging=LOGGING,
6063
)

DifferentiationInterface/test/Back/GTPSA/test.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ end
1919
test_differentiation(
2020
AutoGTPSA(),
2121
default_scenarios(; include_constantified=true);
22-
type_stability=:full,
22+
type_stability=safetypestab(:full),
2323
logging=LOGGING,
2424
);
2525

2626
# Test with Descriptor:
2727
d1 = GTPSA.Descriptor(20, 2) # 20 variables to 2nd order
28-
test_differentiation(AutoGTPSA(d1); type_stability=:full, logging=LOGGING);
28+
test_differentiation(AutoGTPSA(d1); type_stability=safetypestab(:full), logging=LOGGING);
2929

3030
# Test with Descriptor using varying orders
3131
vos = 2 * ones(Int, 20)
3232
vos[1] = 3
3333
d2 = GTPSA.Descriptor(vos, 3)
34-
test_differentiation(AutoGTPSA(d2); type_stability=:full, logging=LOGGING);
34+
test_differentiation(AutoGTPSA(d2); type_stability=safetypestab(:full), logging=LOGGING);

DifferentiationInterface/test/Core/ZeroBackends/test.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ end
2727
],
2828
default_scenarios(; include_batchified=false, include_constantified=true);
2929
correctness=false,
30-
type_stability=:full,
30+
type_stability=safetypestab(:full),
3131
logging=LOGGING,
3232
)
3333

3434
test_differentiation(
3535
AutoSparse.(zero_backends, coloring_algorithm=GreedyColoringAlgorithm()),
3636
default_scenarios(; include_constantified=true);
3737
correctness=false,
38-
type_stability=:full,
38+
type_stability=safetypestab(:full),
3939
excluded=[
4040
:pushforward, :pullback, :gradient, :derivative, :hvp, :second_derivative
4141
],

DifferentiationInterface/test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ComponentArrays = "0.15.27"
2323
DataFrames = "1.7.0"
2424
Dates = "1"
2525
ExplicitImports = "1.10.1"
26-
JET = "0.9"
26+
JET = "0.9,0.10"
2727
JLArrays = "0.2.0"
2828
Pkg = "1"
2929
Random = "1"

DifferentiationInterface/test/testutils.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ function MyAutoSparse(backend::AbstractADType)
2020
coloring_algorithm=GreedyColoringAlgorithm(),
2121
)
2222
end
23+
24+
safetypestab(symb) = VERSION < v"1.12-" ? symb : :none # TODO: remove

DifferentiationInterfaceTest/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/DifferentiationInterfaceTest-v0.10.1...main)
8+
## [Unreleased](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterfaceTest-v0.10.2...main)
9+
10+
### Fixed
11+
12+
- Allow JET v0.10 but disable test stability
13+
14+
## [0.10.2](https://github.com/JuliaDiff/DifferentiationInterface.jl/compare/DifferentiationInterfaceTest-v0.10.1...DifferentiationInterfaceTest-v0.10.2)
915

1016
### Fixed
1117

DifferentiationInterfaceTest/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ FiniteDifferences = "0.12"
5050
Flux = "0.16"
5151
ForwardDiff = "0.10.36,1"
5252
Functors = "0.4, 0.5"
53-
JET = "0.4 - 0.8, 0.9"
53+
JET = "0.9,0.10"
5454
JLArrays = "0.1, 0.2"
5555
LinearAlgebra = "1"
5656
Lux = "1.1.0"

DifferentiationInterfaceTest/test/formalities.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ using Test
1010
Aqua.test_all(DifferentiationInterfaceTest; ambiguities=false, undocumented_names=true)
1111
end
1212
@testset verbose = true "JET" begin
13-
JET.test_package(DifferentiationInterfaceTest; target_defined_modules=true)
13+
# until https://github.com/JuliaLang/julia/pull/59321 is released
14+
if VERSION <= v"1.12-"
15+
JET.test_package(DifferentiationInterfaceTest; target_defined_modules=true)
16+
end
1417
end
1518

1619
@testset "Documentation" begin

0 commit comments

Comments
 (0)