Amortizing overhead in `.run`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.8k
- Forks
- 315
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 27
Description
Hello --
New to numpyro, but really excited to be looking at it!
Question: When I call something like
nuts = NUTS(model)
mcmc = MCMC(nuts, num_warmup=500, num_samples=2000)
mcmc.run(rng_key_, data)
there's a startup overhead, where the progress bar appears but doesn't move for ~5 seconds and then moves very fast.
I'm guessing this is compilation overhead? If that's right, is there a way to cache the compilation so that I don't have to pay that overhead everytime I run my program?
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the MCMC.run entry point described in the issue and trace the startup work that occurs before sampling begins. Determine whether repeated runs can reuse compilation, and verify that subsequent runs avoid the reported startup overhead without changing sampling behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100