added multiprocessing to Bayesian sampling#251
Draft
rozyczko wants to merge 2 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## bayesian #251 +/- ##
============================================
- Coverage 82.75% 82.04% -0.72%
============================================
Files 62 62
Lines 5021 5156 +135
============================================
+ Hits 4155 4230 +75
- Misses 866 926 +60
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Member
Author
|
This has quite a few steps for pickling/serialization of legacy objects based on weakrefs and global object. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request introduces multiprocessing support for Bayesian DREAM sampling with the BUMPS minimizer, allowing parallel evaluation of the population during MCMC sampling. The changes add a new
n_workersparameter to the sampling API, enabling users to specify the number of worker processes for parallel execution. Serialization logic is implemented to allow fit problems to be sent to worker processes, with robust handling of objects that are not trivially pickleable. The PR also includes comprehensive tests and a benchmarking script to demonstrate and validate the new multiprocessing functionality.Multiprocessing support for BUMPS DREAM sampling
Added a new
n_workersparameter to thesamplemethod in bothminimizer_bumps.pyandmulti_fitter.py, allowing users to specify the number of worker processes for parallel population evaluation. Ifn_workersis greater than 1, a custom multiprocessing pool mapper is used; otherwise, the default sequential evaluation is retained.Implemented the
BumpsPoolMapperclass and associated serialization/deserialization helpers inminimizer_bumps.pyto enable robust transfer of fit problems and closures to worker processes, including special handling for weak references andscipp.Variableobjects. Added dependency oncloudpicklefor advanced serialization.Error handling and API improvements
Improved error messages and input validation for multiprocessing, including checks that
n_workersis at least 1 and that the fit problem is serializable. The documentation for thesamplemethods was updated to describe the new parameter and possible exceptions.Added a benchmarking script
sampling_mpi.pyto thetools/benchmarksdirectory, allowing users to measure wall-clock speedup from multiprocessing in a realistic sampling scenario.