Skip to content

UndefVarError: CodeInfo not defined #1756

@andreasko

Description

@andreasko

Hey all,

after switching Julia from 1.6.2 to 1.6.5, I experience problems when using ReverseDiff in combination with Memoization, The following MWE fails:

using Turing
using Memoization
using ReverseDiff
setadbackend(:reversediff)
Turing.setrdcache(true)


@model function demo(xs)
   s ~ InverseGamma(2, 3)
   m ~ Normal(10, s)
   xs .~ Normal(m, s)
end
model = demo(randn(10));
chain = sample(model, NUTS(), 10);

The full error message is

UndefVarError: CodeInfo not defined
in eval at base/boot.jl:360 
in top-level scope at test_regional.jl
in top-level scope at base/timing.jl:210 
in macro expansion at test_regional.jl:112 
in  at Turing/uMQmD/src/inference/Inference.jl:132
in #sample#1 at Turing/uMQmD/src/inference/Inference.jl:132 
in sample##kw at Turing/uMQmD/src/inference/Inference.jl:142 
in #sample#2 at Turing/uMQmD/src/inference/Inference.jl:142 
in sample##kw at Turing/uMQmD/src/inference/hmc.jl:116 
in var"#sample#40" at Turing/uMQmD/src/inference/hmc.jl:133
in  at AbstractMCMC/BPJCW/src/sample.jl:107
in var"#mcmcsample#20" at AbstractMCMC/BPJCW/src/sample.jl:114
in macro expansion at AbstractMCMC/BPJCW/src/logging.jl:8 
in macro expansion at ProgressLogging/6KXlp/src/ProgressLogging.jl:328 
in macro expansion at AbstractMCMC/BPJCW/src/sample.jl:123 
in step##kw at DynamicPPL/RcfQU/src/sampler.jl:62 
in var"#step#17" at DynamicPPL/RcfQU/src/sampler.jl:87
in  at Turing/uMQmD/src/inference/hmc.jl:153
in var"#initialstep#41" at Turing/uMQmD/src/inference/hmc.jl:167
in phasepoint at AdvancedHMC/HQHnm/src/hamiltonian.jl:153 
in phasepoint at AdvancedHMC/HQHnm/src/hamiltonian.jl:76 
in ∂H∂θ at AdvancedHMC/HQHnm/src/hamiltonian.jl:31
in ∂logπ∂θ at Turing/uMQmD/src/inference/hmc.jl:433 
in gradient_logp at Turing/uMQmD/src/core/ad.jl:83 
in gradient_logp at Turing/uMQmD/src/core/ad.jl:83 
in gradient_logp at Turing/uMQmD/src/core/compat/reversediff.jl:69 
in memoized_taperesult at Turing/uMQmD/src/core/compat/reversediff.jl:86 
in memoized_taperesult at Memoization/LiJeV/src/Memoization.jl:98
in  at base/boot.jl:571
in var"#s487#29" at base/none
in #s487#29 at Memoization/LiJeV/src/Memoization.jl:117

Sorry in advance if this is not related to Turing but rather to Memoization but, I can't make much sense of the error message.

Cheers!

Edit:
Here is the package list

Memoization v0.1.13
ReverseDiff v1.12.0
Turing v0.19.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions