-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default float type to float(Real), not Real #685
Conversation
5234453
to
9ec575c
Compare
I'm proposing to release a bugfix for 0.28 first, since we're still working on a version of Turing that's compatible with 0.29 (TuringLang/Turing.jl#2341). But if we merge this, I can ofc port this to the master branch too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better with a test. :) Thanks @penelopeysm
* Default float type to float(Real), not Real (#685) * Default float type to float(Real), not Real Closes #684 * Trigger CI on backport branches/PRs * Add integration test for #684 * Bump Turing version to 0.34 in test subfolder * Bump minimum Julia version to 1.10 * Bump patch version * Bump patch again
Closes #684
The issue seen in #684 results from this series of calls:
DynamicPPL.jl/src/model.jl
Lines 1190 to 1200 in cdd3407
Here,
argvals_dict
is anOrderedDict
, and whenlikelihood()
is called on L1198 it gets promoted to aSimpleVarInfo
where the type oflogp
isfloat_type_with_fallback(infer_nested_eltype(typeof(argvals_dict)))
:DynamicPPL.jl/src/simple_varinfo.jl
Lines 214 to 222 in cdd3407
In this case,
infer_nested_eltype(typeof(argvals_dict))
isAny
and thusfloat_type_with_fallback(Any)
givesReal
. And then whenresetlogp!!
is called, it sets logp tozero(Real)
, which ends up being anInt64
(on my system).This PR proposes to make
float_type_with_fallback(Any)
returnfloat(Real)
instead, which isFloat64
.