Julia-Tempering / Pigeons.jl

Sampling from intractable distributions, with support for distributed and parallel methods
https://pigeons.run/dev/
GNU Affero General Public License v3.0
86 stars 10 forks source link

Method ambiguity introduced on latest release #259

Closed sefffal closed 3 months ago

sefffal commented 3 months ago

The octofitter CI started failing last night due to a method ambiguity in Pigeons. From the following stack trace, the ambiguity appears to be internal to Pigeons.

Stack trace:

┌ Error: failed to run `@example` block in src/fit-coplanar.md:117-121
│ ```@example 1
│ using Pigeons
│ results,pt = octofit_pigeons(model, n_rounds=10);
│ nothing # hide
│ ```
│   exception =
│    MethodError: ADgradient(::Val{:ForwardDiff}, ::Pigeons.GaussianReference, ::Pigeons.Augmentation{Dict{Symbol, Vector{Float64}}}) is ambiguous.
│    
│    Candidates:
│      ADgradient(kind::Val{:ForwardDiff}, log_potential, buffers::Pigeons.Augmentation)
│        @ PigeonsForwardDiffExt ~/.julia/packages/Pigeons/zJegb/ext/PigeonsForwardDiffExt/PigeonsForwardDiffExt.jl:30
│      ADgradient(kind::Val, log_potential::Pigeons.GaussianReference, buffers::Pigeons.Augmentation)
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/variational/GaussianReference.jl:65
│    
│    Possible fix, define
│      ADgradient(::Val{:ForwardDiff}, ::Pigeons.GaussianReference, ::Pigeons.Augmentation)
│    
│    Stacktrace:
│      [1] ADgradient(kind::Val{:ForwardDiff}, log_potential::Pigeons.GaussianReference, replica::Pigeons.Replica{Vector{Float64}, @NamedTuple{explorer_acceptance_pr::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, explorer_n_steps::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Sum{Float64}}, am_factors::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, buffers::Pigeons.Augmentation{Dict{Symbol, Vector{Float64}}}, ad_buffers::Pigeons.Augmentation{Dict{Symbol, Pigeons.BufferedAD}}, _transformed_online::Pigeons.OnlineStateRecorder, swap_acceptance_pr::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, log_sum_ratio::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, Pigeons.LogSum{Float64}}, traces::Dict{Pair{Int64, Int64}, Any}, round_trip::Pigeons.RoundTripRecorder, timing_extrema::NonReproducible{...}, allocation_extrema::NonReproducible{...}, index_process::Dict{Int64, Vector{Int64}}}}; kwargs::@Kwargs{})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/explorers/BufferedAD.jl:37
│      [2] get_buffer
│        @ ~/.julia/packages/Pigeons/zJegb/src/explorers/BufferedAD.jl:138 [inlined]
│      [3] ADgradient(kind::Val{:ForwardDiff}, log_potential::InterpolatedLogPotential{...}, replica::Pigeons.Replica{Vector{Float64}, @NamedTuple{explorer_acceptance_pr::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, explorer_n_steps::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Sum{Float64}}, am_factors::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, buffers::Pigeons.Augmentation{Dict{Symbol, Vector{Float64}}}, ad_buffers::Pigeons.Augmentation{Dict{Symbol, Pigeons.BufferedAD}}, _transformed_online::Pigeons.OnlineStateRecorder, swap_acceptance_pr::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, log_sum_ratio::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, Pigeons.LogSum{Float64}}, traces::Dict{Pair{Int64, Int64}, Any}, round_trip::Pigeons.RoundTripRecorder, timing_extrema::NonReproducible{...}, allocation_extrema::NonReproducible{...}, index_process::Dict{Int64, Vector{Int64}}}})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/explorers/BufferedAD.jl:82
│      [4] ADgradient(kind::Symbol, log_potential::InterpolatedLogPotential{...}, replica::Pigeons.Replica{Vector{Float64}, @NamedTuple{explorer_acceptance_pr::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, explorer_n_steps::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Sum{Float64}}, am_factors::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, buffers::Pigeons.Augmentation{Dict{Symbol, Vector{Float64}}}, ad_buffers::Pigeons.Augmentation{Dict{Symbol, Pigeons.BufferedAD}}, _transformed_online::Pigeons.OnlineStateRecorder, swap_acceptance_pr::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, log_sum_ratio::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, Pigeons.LogSum{Float64}}, traces::Dict{Pair{Int64, Int64}, Any}, round_trip::Pigeons.RoundTripRecorder, timing_extrema::NonReproducible{...}, allocation_extrema::NonReproducible{...}, index_process::Dict{Int64, Vector{Int64}}}}; kwargs::@Kwargs{})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/explorers/BufferedAD.jl:33
│      [5] ADgradient
│        @ ~/.julia/packages/Pigeons/zJegb/src/explorers/BufferedAD.jl:33 [inlined]
│      [6] _extract_commons_and_run!(explorer::Pigeons.AutoMALA{Vector{Float64}, Pigeons.MixDiagonalPreconditioner{Rational{Int64}}}, replica::Pigeons.Replica{Vector{Float64}, @NamedTuple{explorer_acceptance_pr::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, explorer_n_steps::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Sum{Float64}}, am_factors::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, buffers::Pigeons.Augmentation{Dict{Symbol, Vector{Float64}}}, ad_buffers::Pigeons.Augmentation{Dict{Symbol, Pigeons.BufferedAD}}, _transformed_online::Pigeons.OnlineStateRecorder, swap_acceptance_pr::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, log_sum_ratio::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, Pigeons.LogSum{Float64}}, traces::Dict{Pair{Int64, Int64}, Any}, round_trip::Pigeons.RoundTripRecorder, timing_extrema::NonReproducible{...}, allocation_extrema::NonReproducible{...}, index_process::Dict{Int64, Vector{Int64}}}}, shared::Shared{...}, log_potential::InterpolatedLogPotential{...}, state::Vector{Float64})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/explorers/AutoMALA.jl:89
│      [7] step!(explorer::Pigeons.AutoMALA{Vector{Float64}, Pigeons.MixDiagonalPreconditioner{Rational{Int64}}}, replica::Pigeons.Replica{Vector{Float64}, @NamedTuple{explorer_acceptance_pr::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, explorer_n_steps::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Sum{Float64}}, am_factors::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, buffers::Pigeons.Augmentation{Dict{Symbol, Vector{Float64}}}, ad_buffers::Pigeons.Augmentation{Dict{Symbol, Pigeons.BufferedAD}}, _transformed_online::Pigeons.OnlineStateRecorder, swap_acceptance_pr::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, log_sum_ratio::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, Pigeons.LogSum{Float64}}, traces::Dict{Pair{Int64, Int64}, Any}, round_trip::Pigeons.RoundTripRecorder, timing_extrema::NonReproducible{...}, allocation_extrema::NonReproducible{...}, index_process::Dict{Int64, Vector{Int64}}}}, shared::Shared{...}, state::Vector{Float64})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/explorers/GradientBasedSampler.jl:15
│      [8] step!
│        @ ~/.julia/packages/Pigeons/zJegb/src/explorers/GradientBasedSampler.jl:9 [inlined]
│      [9] step!
│        @ ~/.julia/packages/Pigeons/zJegb/src/explorers/Compose.jl:18 [inlined]
│     [10] explore!(pt::PT{...}, replica::Pigeons.Replica{Vector{Float64}, @NamedTuple{explorer_acceptance_pr::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, explorer_n_steps::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Sum{Float64}}, am_factors::OnlineStatsBase.GroupBy{Int64, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, buffers::Pigeons.Augmentation{Dict{Symbol, Vector{Float64}}}, ad_buffers::Pigeons.Augmentation{Dict{Symbol, Pigeons.BufferedAD}}, _transformed_online::Pigeons.OnlineStateRecorder, swap_acceptance_pr::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, OnlineStatsBase.Mean{Float64, OnlineStatsBase.EqualWeight}}, log_sum_ratio::OnlineStatsBase.GroupBy{Tuple{Int64, Int64}, Number, Pigeons.LogSum{Float64}}, traces::Dict{Pair{Int64, Int64}, Any}, round_trip::Pigeons.RoundTripRecorder, timing_extrema::NonReproducible{...}, allocation_extrema::NonReproducible{...}, index_process::Dict{Int64, Vector{Int64}}}}, explorer::Compose{...})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/pt/pigeons.jl:107
│     [11] explore!
│        @ ~/.julia/packages/Pigeons/zJegb/src/pt/pigeons.jl:96 [inlined]
│     [12] macro expansion
│        @ ~/.julia/packages/Pigeons/zJegb/src/pt/pigeons.jl:50 [inlined]
│     [13] macro expansion
│        @ ./timing.jl:503 [inlined]
│     [14] run_one_round!(pt::PT{...})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/pt/pigeons.jl:49
│     [15] pigeons(pt::PT{...})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/pt/pigeons.jl:18
│     [16] pigeons(pt_arguments::Pigeons.Inputs{Octofitter.LogDensityModel{Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}, Octofitter.var"#60#73"{ForwardDiff.GradientConfig{ForwardDiff.Tag{Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}, Float64}, Float64, 12, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}, Float64}, Float64, 12}}}, Vector{DiffResults.MutableDiffResult{1, Float64, Tuple{Vector{Float64}}}}, Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}}, System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, Octofitter.var"#51#63"{Vector{Distributions.Distribution{Distributions.Univariate, Distributions.Continuous}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}}, Pigeons.GaussianReference, Nothing, Nothing, Nothing}, ::Pigeons.ThisProcess)
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/api.jl:19
│     [17] pigeons(pt_arguments::Pigeons.Inputs{Octofitter.LogDensityModel{Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}, Octofitter.var"#60#73"{ForwardDiff.GradientConfig{ForwardDiff.Tag{Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}, Float64}, Float64, 12, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}, Float64}, Float64, 12}}}, Vector{DiffResults.MutableDiffResult{1, Float64, Tuple{Vector{Float64}}}}, Octofitter.var"#ℓπcallback#64"{System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr, :sampled), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x5b5f5f93, 0xe35cc569, 0xfe465bf1, 0xb8130f04, 0x37e79006), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:system, :θ_system), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0xa65a13e8, 0x1eaaf564, 0x2c2c2eb6, 0xca5073a8, 0xbc3ba9d5), Expr}, Octofitter.var"#ℓπcallback#52#65"}}, System{Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:Ωy, :Ωx}}, @NamedTuple{b::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Float64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Float64}}}}}}, c::Planet{Visual{KepOrbit}, Priors, Derived, Tuple{Octofitter.UnitLengthPrior{:θy, :θx}, PlanetRelAstromLikelihood{Table{@NamedTuple{epoch::Float64, object::Int64, ra::Float64, σ_ra::Float64, dec::Float64, σ_dec::Float64, cor::Int64}, 1, @NamedTuple{epoch::Vector{Float64}, object::Vector{Int64}, ra::Vector{Float64}, σ_ra::Vector{Float64}, dec::Vector{Float64}, σ_dec::Vector{Float64}, cor::Vector{Int64}}}}}}}}, Octofitter.var"#51#63"{Vector{Distributions.Distribution{Distributions.Univariate, Distributions.Continuous}}}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x7d9b08b5, 0x6236afb5, 0x58aa317b, 0x5c27b5ce, 0x94ae710b), Expr}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:arr,), Octofitter.var"#_RGF_ModTag", Octofitter.var"#_RGF_ModTag", (0x01a43f69, 0x2c4bde5f, 0x9578e88c, 0xb3bb80a9, 0x65b15f63), Expr}}, Pigeons.GaussianReference, Nothing, Nothing, Nothing})
│        @ Pigeons ~/.julia/packages/Pigeons/zJegb/src/api.jl:8
│     [18] octofit_pigeons(inputs::Pigeons.Inputs)
│        @ OctofitterPigeonsExt ~/work/Octofitter.jl/Octofitter.jl/ext/OctofitterPigeonsExt/OctofitterPigeonsExt.jl:200
│     [19] octofit_pigeons(target::Octofitter.LogDensityModel; n_rounds::Int64, n_chains::Int64, n_chains_variational::Int64, checkpoint::Bool, pigeons_kw...)
│        @ OctofitterPigeonsExt ~/work/Octofitter.jl/Octofitter.jl/ext/OctofitterPigeonsExt/OctofitterPigeonsExt.jl:172
│     [20] top-level scope
│        @ fit-coplanar.md:118
│     [21] eval
│        @ ./boot.jl:385 [inlined]
│     [22] #58
│        @ ~/.julia/packages/Documenter/qoyeC/src/expander_pipeline.jl:754 [inlined]
│     [23] cd(f::Documenter.var"#58#60"{Module, Expr}, dir::String)
│        @ Base.Filesystem ./file.jl:112
│     [24] (::Documenter.var"#57#59"{Documenter.Page, Module, Expr})()
│        @ Documenter ~/.julia/packages/Documenter/qoyeC/src/expander_pipeline.jl:753
│     [25] (::IOCapture.var"#5#9"{DataType, Documenter.var"#57#59"{Documenter.Page, Module, Expr}, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}, Base.PipeEndpoint, Base.PipeEndpoint})()
│        @ IOCapture ~/.julia/packages/IOCapture/Y5rEA/src/IOCapture.jl:170
│     [26] with_logstate(f::Function, logstate::Any)
│        @ Base.CoreLogging ./logging.jl:515
│     [27] with_logger
│        @ ./logging.jl:627 [inlined]
│     [28] capture(f::Documenter.var"#57#59"{Documenter.Page, Module, Expr}; rethrow::Type, color::Bool, passthrough::Bool, capture_buffer::IOBuffer, io_context::Vector{Any})
│        @ IOCapture ~/.julia/packages/IOCapture/Y5rEA/src/IOCapture.jl:167
│     [29] runner(::Type{Documenter.Expanders.ExampleBlocks}, node::MarkdownAST.Node{Nothing}, page::Documenter.Page, doc::Documenter.Document)
│        @ Documenter ~/.julia/packages/Documenter/qoyeC/src/expander_pipeline.jl:752
miguelbiron commented 3 months ago

Oof my bad, thanks for flagging! Weird that we didn't have a test like this.

sefffal commented 3 months ago

It happens! It occurs to me that adding downstream tests for one or two packages might help catch something like this in future.

miguelbiron commented 3 months ago

For sure, we already do that with Comrade.

I'm installing octofitter now because I tried some pure Pigeons MWE and none of them throw the error you mention. Is your command basically running pigeons on a custom target with the Gaussian reference and the composed explorer?

https://github.com/sefffal/Octofitter.jl/blob/19206c078d1025fff54f51d8600571d1f90fdb30/ext/OctofitterPigeonsExt/OctofitterPigeonsExt.jl#L151

sefffal commented 3 months ago

Ah, okay. In that case I will try to find a minimum example, just a minute.

sefffal commented 3 months ago

This is strange, I can't reproduce with either the latest release or the development release, only in CI. I'll see if I can get to the bottom of this, sorry for the noise!

miguelbiron commented 3 months ago

Sounds good, keep me posted. I'll be running some other tests myself just in case.

miguelbiron commented 3 months ago

Ok yeah I found the error. Basically the AD augmentation is not working when a variational reference is present. It should be solved today though.

miguelbiron commented 3 months ago

Hey @sefffal -- just merged the PR. When the registration process finished would you mind rerunning the CI on your end?

sefffal commented 3 months ago

Great, thanks so much! I'll do that.

sefffal commented 3 months ago

I ran CI again and everything passed. Thanks @miguelbiron !

miguelbiron commented 3 months ago

Nice! Glad to know the issue is fixed 😌