# Smooth progress bar for multithreads sampling in turing.jl

**URL:** <https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768>\
**Category:** Modelling & Simulations\
**Tags:** turing, modelling, progress-bar\
**Created:** [July 16, 2025, 8:05am UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768 "2025-07-16T08:05:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [July 16, 2025, 8:05am UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768/1 "2025-07-16T08:05:34Z")

</div>

Hello everyone,

Im working with turing.jl and what I have noticed that when sampling multiple chains with mulithreads option. Progress bar show progress based on number of chains used for example if I use 3 chains then progress will be shown after 1/3 sampling is done for all chains. So, 0 → 30% → 60% → 90% like that. Now issue is for large sample numbers and complex model it can take hours to get 30% of smaples and till then you have no clue if things are even running or just stuck.

I suggest that it will be super nice if progress bar can be customised to give small progress too like in case of single thread run we see progress go 0 → 1% → 2% …

Has anyone implemented something in this direction ?

Thank you

---

<div class="post-metadata">

**Author:** ![eteppo](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@eteppo](https://discourse.julialang.org/u/eteppo)\
**Post date:** [July 16, 2025, 2:07pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768/2 "2025-07-16T14:07:57Z")

</div>

I noticed the multichain progress bar is currently being updated to show all chains. [Progress bars when sampling multiple chains by penelopeysm · Pull Request #168 · TuringLang/AbstractMCMC.jl · GitHub](https://github.com/TuringLang/AbstractMCMC.jl/pull/168)

---

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [July 16, 2025, 2:27pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768/3 "2025-07-16T14:27:31Z")

</div>

Perfect, it will be very helpful 😁

---

<div class="post-metadata">

**Author:** ![penelopeysm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/penelopeysm/32/213172_2.png) [@penelopeysm](https://discourse.julialang.org/u/penelopeysm)\
**Post date:** [July 24, 2025, 12:47pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768/4 "2025-07-24T12:47:30Z")

</div>

That PR is merged now so if you update to AbstractMCMC 5.7.0 you should be able to use this: specifically

`sample(model, sampler, MCMCThreads(), 1000, 3)`

will have a single progress bar that shows overall % of samples done, and

`sample(model, sampler, MCMCThreads(), 1000, 3; progress=:perchain)`

will additionally create one extra progress bar per chain.

---

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [July 24, 2025, 1:12pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768/5 "2025-07-24T13:12:02Z")

</div>

This is super news. Thanks 😃

---

<div class="post-metadata">

**Author:** ![marcobonici](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marcobonici/32/20549_2.png) [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Post date:** [July 24, 2025, 4:16pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768/6 "2025-07-24T16:16:53Z")

</div>

This is great, thanks! Will the same happen in the case of MCMCDistributed()?

---

<div class="post-metadata">

**Author:** ![penelopeysm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/penelopeysm/32/213172_2.png) [@penelopeysm](https://discourse.julialang.org/u/penelopeysm)\
**Post date:** [July 26, 2025, 1:13pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768/7 "2025-07-26T13:13:42Z")

</div>

Yes to a certain extent; if you use `MCMCDistributed()` you will get a single progress bar that has more fine-grained progress, but `:perchain` won’t work (it was way too fiddly to code up and I was hoping that the improved overall progress bar should be sufficient).
