You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should have decent ways to inform the user of certain simple things they can do to improve the performance of their model.
For example, in #2396, it is suggested that we should maybe warn a user if they use a forward-mode AD backend on a model with more than, say, 20 parameters. This is ofc a nuanced issue, as not all AD backends support the same (sub)set of Julia.
However, we could maybe hide some of these suggestions behind a function, e.g. performance_hints(model) or something, which prints out certain suggestions to how to improve a model / warns the user of typical patterns that have performance impacts.
Again, it'll be difficult to make this perfect, but if accompanied with good docs (ref: #2415), this could work well.
Example of things we could put in such a performnace_hints method:
Usage of reverse-mode AD backend when dimensionality is "high".
Using DynamicPPL.check_model_and_trace we could also analyse the ~ statements to check if there's anything going on there, e.g. x[i] ~ Normal() in a loop instead of x ~ filldist(Normal(), n).
More?
Longer term, we could probably make use of JET.jl to inspect more things, e.g. are allocations happening in the model, etc.
The text was updated successfully, but these errors were encountered:
We should have decent ways to inform the user of certain simple things they can do to improve the performance of their model.
For example, in #2396, it is suggested that we should maybe warn a user if they use a forward-mode AD backend on a model with more than, say, 20 parameters. This is ofc a nuanced issue, as not all AD backends support the same (sub)set of Julia.
However, we could maybe hide some of these suggestions behind a function, e.g.
performance_hints(model)
or something, which prints out certain suggestions to how to improve a model / warns the user of typical patterns that have performance impacts.Again, it'll be difficult to make this perfect, but if accompanied with good docs (ref: #2415), this could work well.
Example of things we could put in such a
performnace_hints
method:DynamicPPL.check_model_and_trace
we could also analyse the~
statements to check if there's anything going on there, e.g.x[i] ~ Normal()
in a loop instead ofx ~ filldist(Normal(), n)
.Longer term, we could probably make use of JET.jl to inspect more things, e.g. are allocations happening in the model, etc.
The text was updated successfully, but these errors were encountered: