There is no longer any need for VarInfo. Note that VarInfo carries with it
- vectorised values (
vi.values)
- a transform strategy (
vi.transform_strategy)
- accumulators (
vi.accs)
Now, vi.values is exactly the same as VectorValueAccumulator. This is rarely needed, and using VarInfo causes unnecessary performance losses in most scenarios. Many of the performance improvements have really resulted from the choice to stop using VarInfo See e.g.
And even in the cases where vi.values is needed, it can be simply added as a new accumulator in vi.accs.
vi.transform_strategy only exists to keep track of the status of vi.values and improve performance. However, if one uses init!! instead of evaluate!! this is not needed, because init!! takes a transform strategy as an argument.
Essentially, all use cases of evaluate!!(model, varinfo::VarInfo) should be replaced with init!!(model, oavi::OnlyAccsVarInfo, InitFromParams(varinfo.values), varinfo.transform_strategy).
With this in mind, I would argue that VarInfo should just be removed completely. There's no reason to keep maintaining an interface that's less flexible and less performant.
There is no longer any need for VarInfo. Note that VarInfo carries with it
vi.values)vi.transform_strategy)vi.accs)Now,
vi.valuesis exactly the same asVectorValueAccumulator. This is rarely needed, and using VarInfo causes unnecessary performance losses in most scenarios. Many of the performance improvements have really resulted from the choice to stop using VarInfo See e.g.predict,returned,logjoint, ... withOnlyAccsVarInfo#1130And even in the cases where
vi.valuesis needed, it can be simply added as a new accumulator invi.accs.vi.transform_strategyonly exists to keep track of the status ofvi.valuesand improve performance. However, if one usesinit!!instead ofevaluate!!this is not needed, becauseinit!!takes a transform strategy as an argument.Essentially, all use cases of
evaluate!!(model, varinfo::VarInfo)should be replaced withinit!!(model, oavi::OnlyAccsVarInfo, InitFromParams(varinfo.values), varinfo.transform_strategy).With this in mind, I would argue that VarInfo should just be removed completely. There's no reason to keep maintaining an interface that's less flexible and less performant.