pyro-ppl / pyro-ppl/numpyro

Amortizing overhead in `.run`

Open
#1,249 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted jax
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.