Skip to content

Commit 227d58d

Browse files
Red-Portalgithub-actions[bot]yebai
authored
Drop support for pre-1.10 (#129)
* drop pre 1.10 in CI * remove SimpleUnPack * fix conditional testing on Enzyme and Mooncake * add missing import for Mooncake and Enzyme * fix remove unpack syntax left behind * fix remove remaining @unpack * fix formatting * fix wrong merge * fix formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * bump Documenter compat * disable Zygote for scoregradelbo bijectors * fix remove uses of `SimpleUnPack` in docs * fix move footnote references from docstrings to the actual docs Seems like Documenter doesn't like this now. * remove redundant references in docstring * fix stop treating missing docs as error * refactor testing on Enzyme is now its own workflow * add Enzyme workflow * fix error in repgradelbo interface test * fix name of Enzyme workflow * refactor test group organizations * fix error in inference tests * bump compat bound for `Optimisers` and `Functors` * fix relax exactness check for `rand!(LocationScale)` * fix weaken equality tests, update tolerance for `LocationScale` test * fix formatting * fix test on LTS instead of "1.10" * fix conditionally load Enzyme in tests * bump setup-julia action version * fix remove Enzyme in non-Enzyme AD test * bump Julia, Bijectors, Functors, Optimisers version * fix build error update setup-julia action for Enzyme tests --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hong Ge <[email protected]>
1 parent 899cad7 commit 227d58d

31 files changed

+199
-202
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
version:
22-
- '1.7'
23-
- '1.10'
22+
- 'lts'
23+
- '1'
2424
os:
2525
- ubuntu-latest
2626
- macOS-latest
@@ -29,7 +29,7 @@ jobs:
2929
- x64
3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: julia-actions/setup-julia@v1
32+
- uses: julia-actions/setup-julia@v2
3333
with:
3434
version: ${{ matrix.version }}
3535
arch: ${{ matrix.arch }}

.github/workflows/Enzyme.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Enzyme
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags: ['*']
7+
pull_request:
8+
workflow_dispatch:
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
jobs:
15+
test:
16+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
17+
env:
18+
TEST_GROUP: Enzyme
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
version:
24+
- 'lts'
25+
- '1'
26+
os:
27+
- ubuntu-latest
28+
- macOS-latest
29+
- windows-latest
30+
arch:
31+
- x64
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: julia-actions/setup-julia@v2
35+
with:
36+
version: ${{ matrix.version }}
37+
arch: ${{ matrix.arch }}
38+
- uses: julia-actions/cache@v1
39+
- uses: julia-actions/julia-buildpkg@v1
40+
- uses: julia-actions/julia-runtest@v1

Project.toml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
1818
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
1919
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2020
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
21-
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
2221
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2322

2423
[weakdeps]
@@ -36,7 +35,7 @@ AdvancedVIEnzymeExt = "Enzyme"
3635
[compat]
3736
ADTypes = "1"
3837
Accessors = "0.1"
39-
Bijectors = "0.13, 0.14"
38+
Bijectors = "0.13, 0.14, 0.15"
4039
ChainRulesCore = "1.16"
4140
DiffResults = "1"
4241
DifferentiationInterface = "0.6"
@@ -45,29 +44,24 @@ DocStringExtensions = "0.8, 0.9"
4544
Enzyme = "0.13"
4645
FillArrays = "1.3"
4746
ForwardDiff = "0.10"
48-
Functors = "0.4"
47+
Functors = "0.4, 0.5"
4948
LinearAlgebra = "1"
5049
LogDensityProblems = "2"
5150
Mooncake = "0.4"
52-
Optimisers = "0.2.16, 0.3"
51+
Optimisers = "0.2.16, 0.3, 0.4"
5352
ProgressMeter = "1.6"
5453
Random = "1"
5554
Requires = "1.0"
5655
ReverseDiff = "1"
57-
SimpleUnPack = "1.1.0"
5856
StatsBase = "0.32, 0.33, 0.34"
5957
Zygote = "0.6"
60-
julia = "1.7"
58+
julia = "1.10, 1.11.2"
6159

6260
[extras]
6361
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4"
6462
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
65-
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
66-
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
6763
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
68-
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
6964
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
70-
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
7165

7266
[targets]
7367
test = ["Pkg", "Test"]

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ a `LogDensityProblem` can be implemented as
2626

2727
```julia
2828
using LogDensityProblems
29-
using SimpleUnPack
3029

3130
struct NormalLogNormal{MX,SX,MY,SY}
3231
μ_x::MX

bench/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2121
[compat]
2222
ADTypes = "1"
2323
BenchmarkTools = "1"
24-
Bijectors = "0.13, 0.14"
24+
Bijectors = "0.13, 0.14, 0.15"
2525
Distributions = "0.25.111"
2626
DistributionsAD = "0.6"
2727
Enzyme = "0.13.7"
@@ -30,10 +30,10 @@ ForwardDiff = "0.10"
3030
InteractiveUtils = "1"
3131
LogDensityProblems = "2"
3232
Mooncake = "0.4.5"
33-
Optimisers = "0.3"
33+
Optimisers = "0.3, 0.4"
3434
Random = "1"
3535
ReverseDiff = "1"
3636
SimpleUnPack = "1"
3737
StableRNGs = "1"
3838
Zygote = "0.6"
39-
julia = "1.10"
39+
julia = "1.10, 1.11.2"

docs/Project.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@ Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
1111
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1212
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
1313
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
14-
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
1514
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
1615

1716
[compat]
1817
ADTypes = "1"
1918
AdvancedVI = "0.3"
20-
Bijectors = "0.13.6, 0.14"
19+
Bijectors = "0.13.6, 0.14, 0.15"
2120
Distributions = "0.25"
2221
Documenter = "1"
2322
FillArrays = "1"
2423
ForwardDiff = "0.10"
2524
LogDensityProblems = "2.1.1"
26-
Optimisers = "0.3"
25+
Optimisers = "0.3, 0.4"
2726
Plots = "1"
2827
QuasiMonteCarlo = "0.3"
2928
ReverseDiff = "1"
30-
SimpleUnPack = "1"
3129
StatsFuns = "1"
32-
julia = "1.10"
30+
julia = "1.10, 1.11.2"

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ makedocs(;
2020
"Variational Families" => "families.md",
2121
"Optimization" => "optimization.md",
2222
],
23+
warnonly=[:missing_docs],
2324
)
2425

2526
deploydocs(; repo="github.com/TuringLang/AdvancedVI.jl", push_preview=true)

docs/src/elbo/repgradelbo.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ using LinearAlgebra
129129
using LogDensityProblems
130130
using Plots
131131
using Random
132-
using SimpleUnPack
133132
134133
using Optimisers
135134
using ADTypes, ForwardDiff
@@ -143,7 +142,7 @@ struct NormalLogNormal{MX,SX,MY,SY}
143142
end
144143
145144
function LogDensityProblems.logdensity(model::NormalLogNormal, θ)
146-
@unpack μ_x, σ_x, μ_y, Σ_y = model
145+
(; μ_x, σ_x, μ_y, Σ_y) = model
147146
logpdf(LogNormal(μ_x, σ_x), θ[1]) + logpdf(MvNormal(μ_y, Σ_y), θ[2:end])
148147
end
149148
@@ -168,7 +167,7 @@ L = Diagonal(ones(d));
168167
q0 = AdvancedVI.MeanFieldGaussian(μ, L)
169168
170169
function Bijectors.bijector(model::NormalLogNormal)
171-
@unpack μ_x, σ_x, μ_y, Σ_y = model
170+
(; μ_x, σ_x, μ_y, Σ_y) = model
172171
Bijectors.Stacked(
173172
Bijectors.bijector.([LogNormal(μ_x, σ_x), MvNormal(μ_y, Σ_y)]),
174173
[1:1, 2:1+length(μ_y)])
@@ -295,7 +294,7 @@ qmcrng = SobolSample(; R=OwenScramble(; base=2, pad=32))
295294
function Distributions.rand(
296295
rng::AbstractRNG, q::MvLocationScale{<:Diagonal,D,L}, num_samples::Int
297296
) where {L,D}
298-
@unpack location, scale, dist = q
297+
(; location, scale, dist) = q
299298
n_dims = length(location)
300299
scale_diag = diag(scale)
301300
unif_samples = QuasiMonteCarlo.sample(num_samples, length(q), qmcrng)
@@ -337,7 +336,7 @@ savefig("advi_qmc_dist.svg")
337336
function Distributions.rand(
338337
rng::AbstractRNG, q::MvLocationScale{<:Diagonal, D, L}, num_samples::Int
339338
) where {L, D}
340-
@unpack location, scale, dist = q
339+
(; location, scale, dist) = q
341340
n_dims = length(location)
342341
scale_diag = diag(scale)
343342
scale_diag.*rand(rng, dist, n_dims, num_samples) .+ location

docs/src/examples.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Using the `LogDensityProblems` interface, we the model can be defined as follows
1515

1616
```@example elboexample
1717
using LogDensityProblems
18-
using SimpleUnPack
1918
2019
struct NormalLogNormal{MX,SX,MY,SY}
2120
μ_x::MX
@@ -25,7 +24,7 @@ struct NormalLogNormal{MX,SX,MY,SY}
2524
end
2625
2726
function LogDensityProblems.logdensity(model::NormalLogNormal, θ)
28-
@unpack μ_x, σ_x, μ_y, Σ_y = model
27+
(; μ_x, σ_x, μ_y, Σ_y) = model
2928
return logpdf(LogNormal(μ_x, σ_x), θ[1]) + logpdf(MvNormal(μ_y, Σ_y), θ[2:end])
3029
end
3130
@@ -59,7 +58,7 @@ Thus, we will use [Bijectors](https://github.com/TuringLang/Bijectors.jl) to mat
5958
using Bijectors
6059
6160
function Bijectors.bijector(model::NormalLogNormal)
62-
@unpack μ_x, σ_x, μ_y, Σ_y = model
61+
(; μ_x, σ_x, μ_y, Σ_y) = model
6362
return Bijectors.Stacked(
6463
Bijectors.bijector.([LogNormal(μ_x, σ_x), MvNormal(μ_y, Σ_y)]),
6564
[1:1, 2:(1 + length(μ_y))],

docs/src/optimization.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ PolynomialAveraging
2424
```
2525

2626
[^DCAMHV2020]: Dhaka, A. K., Catalina, A., Andersen, M. R., Magnusson, M., Huggins, J., & Vehtari, A. (2020). Robust, accurate stochastic optimization for variational inference. Advances in Neural Information Processing Systems, 33, 10961-10973.
27+
[^KMJ2024]: Khaled, A., Mishchenko, K., & Jin, C. (2023). Dowg unleashed: An efficient universal parameter-free gradient descent method. Advances in Neural Information Processing Systems, 36, 6748-6769.
28+
[^IHC2023]: Ivgi, M., Hinder, O., & Carmon, Y. (2023). Dog is sgd's best friend: A parameter-free dynamic step size schedule. In International Conference on Machine Learning (pp. 14465-14499). PMLR.

0 commit comments

Comments
 (0)