implement per-chain progress bars with ProgressMeter.jl #165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables per-chain progress bars when sampling multiple chains with
MCMCThreads()
.To do so, it switches the logging functionality to use ProgressMeter.jl which appears to be much more actively maintained.
As a bonus, it also means that when sampling with
isdone
(i.e., we don't know how many iterations will happen untilisdone
returns true) we can make use ofProgressMeter.ProgressUnknown
which is a more sensible interface than the typical progress bar.I had first tried to implement this using the existing logging setup (with ProgressLogging.jl -- see https://github.com/TuringLang/AbstractMCMC.jl/tree/py/parallel), but found myself blocked by JuliaLogging/ProgressLogging.jl#41 (I have asked on Slack to see if somebody would merge it).
Here is a video:
Screen.Recording.2025-06-27.at.01.20.51.mov
The code I ran in the video is:
TODO
keep=true
doesn't seem to have the intended behaviourCloses #24
Closes #82
Would close TuringLang/Turing.jl#2264 as well