Skip to content
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

SVGP deprecation not exact #88

Closed
st-- opened this issue Jan 11, 2022 · 9 comments · Fixed by #95
Closed

SVGP deprecation not exact #88

st-- opened this issue Jan 11, 2022 · 9 comments · Fixed by #95

Comments

@st--
Copy link
Member

st-- commented Jan 11, 2022

SVGP simply redirects to SparseVariationalApproximation, but the SVGP default (and only implementation) was Centered representation, whereas SparseVariationalApproximation defaults to NonCentered. So it was actually a breaking change. Is there some way we can fix this?

Originally posted by @st-- in #64 (comment)

@st--
Copy link
Member Author

st-- commented Jan 11, 2022

I think it'd be better to remove the @deprecate and instead have a stub

SVGP(args...) = error(
    "`SVGP(...)` is deprecated; use `SparseVariationalApproximation(Centered(), ...)` "*
    "for retaining previous behaviour, or consider if you want to use "*
    "NonCentered() [new default] instead."
)

@theogf
Copy link
Member

theogf commented Jan 11, 2022

But isn't it an issue now that this is a bug and that should be solved before the next breaking release (your solution is nice but would be breaking

@st--
Copy link
Member Author

st-- commented Jan 14, 2022

My solution would be fixing a bug - the change from SVGP to SparseVariationalApproximation was already declared breaking. If anyone is actually using SVGP, and they rely on @deprecate preserving the behaviour, their code might give them wrong answers (without realising). An explicit error message that tells them how to fix it would be much preferable, no?

@theogf
Copy link
Member

theogf commented Jan 14, 2022

@deprecate should keep things working but alarm the users that they are going to change.
The real bug fix would be to have @deprecate SVGP(args...) SparseVariationalApproximation(Centered(), args...) not sure what the correct syntax is though

@st--
Copy link
Member Author

st-- commented Jan 14, 2022

You can write

@deprecate SVGP(fz, q) SparseVariationalApproximation(Centered(), fz, q)

but then that won't add a deprecation for the struct, so also wouldn't be backwards compatible.

Moreover, @deprecate as of julia 1.5 doesn't by default print any warnings, so in practice users are likely to miss it.

@devmotion
Copy link
Member

Moreover, @deprecate as of julia 1.5 doesn't by default print any warnings, so in practice users are likely to miss it.

AFAIK this is on purpose since deprecatipn warmings slow down code massively. Eg, deprecations in a Turing model make it basically impossible to sample with the model if warnings are enabled.

@st--
Copy link
Member Author

st-- commented Jan 14, 2022

Actually, the type doesn't get aliased anyways, so doesn't make a difference. See #95. (Though personally I'd still prefer an explicit error()!)

@devmotion
Copy link
Member

@deprecate_binding can be used to deprecate types.

@st--
Copy link
Member Author

st-- commented Jan 14, 2022

@deprecate_binding can be used to deprecate types.

it doesn't work together with the constructor @deprecate though...

@st-- st-- closed this as completed in #95 Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants