Skip to content

Commit 43a614b

Browse files
authored
Disable Mooncake on prerelease; bump min Julia to 1.10.2; regroup CI tests (#2569)
* Disable Mooncake on prerelease * Remove Mooncake from environment * Remove Mooncake compat bound * Remove unused imports * Pkg * Balance tests * Bump Julia minimum version to 1.10.2 Closes #2570 * lump stdlib/distributions into everything else
1 parent 1a70627 commit 43a614b

File tree

11 files changed

+29
-26
lines changed

11 files changed

+29
-26
lines changed

.github/workflows/Tests.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,12 @@ jobs:
2626
# not included in the others.
2727
- name: "mcmc/gibbs"
2828
args: "mcmc/gibbs.jl"
29-
- name: "mcmc/hmc"
30-
args: "mcmc/hmc.jl"
31-
- name: "mcmc/abstractmcmc"
32-
args: "mcmc/abstractmcmc.jl"
3329
- name: "mcmc/Inference"
3430
args: "mcmc/Inference.jl"
35-
- name: "mcmc/ess"
36-
args: "mcmc/ess.jl"
31+
- name: "ad"
32+
args: "ad.jl"
3733
- name: "everything else"
38-
args: "--skip mcmc/gibbs.jl mcmc/hmc.jl mcmc/abstractmcmc.jl mcmc/Inference.jl mcmc/ess.jl"
34+
args: "--skip mcmc/gibbs.jl mcmc/Inference.jl ad.jl"
3935
runner:
4036
# Default
4137
- version: '1'

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Release 0.38.4
2+
3+
The minimum Julia version was increased to 1.10.2 (from 1.10.0).
4+
On versions before 1.10.2, `sample()` took an excessively long time to run (probably due to compilation).
5+
16
# Release 0.38.3
27

38
`getparams(::Model, ::AbstractVarInfo)` now returns an empty `Float64[]` if the VarInfo contains no parameters.

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Turing"
22
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
3-
version = "0.38.3"
3+
version = "0.38.4"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -83,7 +83,7 @@ Statistics = "1.6"
8383
StatsAPI = "1.6"
8484
StatsBase = "0.32, 0.33, 0.34"
8585
StatsFuns = "0.8, 0.9, 1"
86-
julia = "1.10"
86+
julia = "1.10.2"
8787

8888
[extras]
8989
DynamicHMC = "bbc10e6e-7c05-544b-b16e-64fede858acb"

test/Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2121
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
2222
LogDensityProblemsAD = "996a588d-648d-4e1f-a8f0-a84b347e47b1"
2323
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
24-
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
2524
NamedArrays = "86f7a689-2022-50b4-a561-43c23ac3c673"
2625
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
2726
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
@@ -61,7 +60,6 @@ LinearAlgebra = "1"
6160
LogDensityProblems = "2"
6261
LogDensityProblemsAD = "1.4"
6362
MCMCChains = "5, 6, 7"
64-
Mooncake = "0.4.95"
6563
NamedArrays = "0.9.4, 0.10"
6664
Optim = "1"
6765
Optimization = "3, 4"

test/ad.jl

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,23 @@ using Random: Random
88
using StableRNGs: StableRNG
99
using Test
1010
using ..Models: gdemo_default
11-
import ForwardDiff, ReverseDiff, Mooncake
11+
import ForwardDiff, ReverseDiff
12+
13+
# Detect if prerelease version, if so, we skip some tests
14+
const IS_PRERELEASE = !isempty(VERSION.prerelease)
15+
const INCLUDE_MOONCAKE = !IS_PRERELEASE
16+
17+
if INCLUDE_MOONCAKE
18+
import Pkg
19+
Pkg.add("Mooncake")
20+
using Mooncake: Mooncake
21+
end
1222

1323
"""Element types that are always valid for a VarInfo regardless of ADType."""
1424
const always_valid_eltypes = (AbstractFloat, AbstractIrrational, Integer, Rational)
1525

1626
"""A dictionary mapping ADTypes to the element types they use."""
17-
const eltypes_by_adtype = Dict(
27+
eltypes_by_adtype = Dict(
1828
Turing.AutoForwardDiff => (ForwardDiff.Dual,),
1929
Turing.AutoReverseDiff => (
2030
ReverseDiff.TrackedArray,
@@ -25,8 +35,10 @@ const eltypes_by_adtype = Dict(
2535
ReverseDiff.TrackedVecOrMat,
2636
ReverseDiff.TrackedVector,
2737
),
28-
Turing.AutoMooncake => (Mooncake.CoDual,),
2938
)
39+
if INCLUDE_MOONCAKE
40+
eltypes_by_adtype[Turing.AutoMooncake] = (Mooncake.CoDual,)
41+
end
3042

3143
"""
3244
AbstractWrongADBackendError
@@ -177,11 +189,10 @@ end
177189
"""
178190
All the ADTypes on which we want to run the tests.
179191
"""
180-
ADTYPES = [
181-
Turing.AutoForwardDiff(),
182-
Turing.AutoReverseDiff(; compile=false),
183-
Turing.AutoMooncake(; config=nothing),
184-
]
192+
ADTYPES = [Turing.AutoForwardDiff(), Turing.AutoReverseDiff(; compile=false)]
193+
if INCLUDE_MOONCAKE
194+
push!(ADTYPES, Turing.AutoMooncake(; config=nothing))
195+
end
185196

186197
# Check that ADTypeCheckContext itself works as expected.
187198
@testset "ADTypeCheckContext" begin

test/mcmc/Inference.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import MCMCChains
1212
import Random
1313
import ReverseDiff
1414
using StableRNGs: StableRNG
15-
import Mooncake
1615
using Test: @test, @test_throws, @testset
1716
using Turing
1817

test/mcmc/abstractmcmc.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ using LogDensityProblems: LogDensityProblems
1111
using Random: Random
1212
using ReverseDiff: ReverseDiff
1313
using StableRNGs: StableRNG
14-
import Mooncake
1514
using Test: @test, @test_throws, @testset
1615
using Turing
1716
using Turing.Inference: AdvancedHMC

test/mcmc/gibbs.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ using DynamicPPL: DynamicPPL
1515
using ForwardDiff: ForwardDiff
1616
using Random: Random
1717
using ReverseDiff: ReverseDiff
18-
import Mooncake
1918
using StableRNGs: StableRNG
2019
using Test: @inferred, @test, @test_broken, @test_throws, @testset
2120
using Turing

test/mcmc/hmc.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ using LinearAlgebra: I, dot, vec
1212
import Random
1313
using StableRNGs: StableRNG
1414
using StatsFuns: logistic
15-
import Mooncake
1615
using Test: @test, @test_logs, @testset, @test_throws
1716
using Turing
1817

test/mcmc/sghmc.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import ForwardDiff
1010
using LinearAlgebra: dot
1111
import ReverseDiff
1212
using StableRNGs: StableRNG
13-
import Mooncake
1413
using Test: @test, @testset
1514
using Turing
1615

test/optimisation/Optimisation.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ using ..Models: gdemo, gdemo_default
44
using Distributions
55
using Distributions.FillArrays: Zeros
66
using DynamicPPL: DynamicPPL
7-
using ForwardDiff: ForwardDiff
87
using LinearAlgebra: Diagonal, I
9-
using Mooncake: Mooncake
108
using Random: Random
119
using Optimization
1210
using Optimization: Optimization

0 commit comments

Comments
 (0)