pymc icon indicating copy to clipboard operation
pymc copied to clipboard

Non-blocking sampling

Open ricardoV94 opened this issue 2 months ago • 3 comments

Description

Nutpie allow sampling in a non-blocking thread, which is great for interactive workflows. You can start playing with plotting - summary code while the model is sampling. We should try to enable that for PyMC samplers as well, running it in a distinct thread from main?

CC @lucianopaz @aseyboldt

ricardoV94 avatar Oct 17 '25 12:10 ricardoV94

I would like to solve this

aviralgarg05 avatar Nov 01 '25 20:11 aviralgarg05

I don’t see a PR for this yet. I’m going to take a crack at it and open a draft soon. First pass will add an opt-in background sampling option for NUTS (threaded), return a handle to check completion/get the result, keep progress bars quiet, and include a couple of small tests + docs. Happy to adjust if you prefer a different API or scope.

XPE-7 avatar Dec 09 '25 19:12 XPE-7

Hi! I’ve opened this PR to add an opt-in background sampling handle to pm.sample. Pre-commit and docs have passed. Please approve the pending workflows (all_tests, mypy) so they can run, and review and tell if any changes when you have a moment. Thanks!

XPE-7 avatar Dec 10 '25 11:12 XPE-7