stan-dev / stan-dev/stan

Improve allocation behavior in NUTS

Open
#3,414 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

algorithm code cleanup help wanted
Dominant language
C++
Stars
2.8k
Forks
388
Avg merge
2d 17h
Merged PRs (30d)
15

Description

As discussed on the forums, @sims1253 found several ways to remove short-lived repeated allocations in our NUTS code, see https://github.com/sims1253/stan/pull/1

This is consistent with observations that @bob-carpenter and I have made in walnutpie, where it appears to outperform Stan even when using settings designed to make it as similar as possible to Stan's implementation of NUTS. We suspected memory allocations, which walnutpie is quite careful with, to be one possible source

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 with the NUTS implementation and review the forum discussion and the referenced pull request at https://github.com/sims1253/stan/pull/1. Identify short-lived repeated allocations in the NUTS code, then compare allocation behavior and performance with the existing implementation; done means the targeted allocations are reduced without changing sampling behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.