TuringLang / TuringLang/DynamicPPL.jl

Rename `OnlyAccsVarInfo` to `VarInfo`

Open
#1,376 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

data-structures
Dominant language
Julia
Stars
286
Forks
41
Avg merge
1d 11h
Merged PRs (30d)
34

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the VarInfo and OnlyAccsVarInfo interfaces, especially evaluate!! and init!!, and review the linked removals from LogDensityFunction, MCMCChainsExt, MH, Gibbs, and ESS. Clarify whether the intended result is renaming OnlyAccsVarInfo or removing VarInfo entirely; done means the chosen interface is consistently applied without the obsolete VarInfo use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.