make MCMCThreads etc. respect check_model=false
#2721
Merged
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.
Prior to this PR, if you called
the model checking here
Turing.jl/src/mcmc/abstractmcmc.jl
Line 121 in ed7f76c
would be correctly skipped. The problem is that this calls
AbstractMCMC.mcmcsample, which then calls the single-threadedsample, but thecheck_modelargument is not passed down, so it defaults totruewhich then checks the model(!!)This PR fixes it by simply passing
check_model=falsethrough. (The point of explicitly setting it to false is that if the user wanted the check, it would be done on the line above already, there's no need to check the modelN+1times.)The added test fails on main and passes on this PR.