Sbs parallelism - #27
Merged
Merged
Conversation
File.fit_slice_by_slice() gains an n_workers kwarg that dispatches
per-slice fits across a ProcessPoolExecutor. Default cpu_count() - 1,
capped at the number of slices. n_workers=1 keeps the original serial
loop as a debug escape hatch.
- Uses spawn (only portable option; Windows lacks fork)
- Workers reuse one pickled model installed at startup so per-slice
pickle cost is bounded
- Worker init forces matplotlib Agg so per-slice plots don't try to
open a display
- tqdm progress bar over as_completed() so the bar advances as slices
finish; results reassembled into slice order via a dict
- Fail-fast on worker exception (cancel pending futures, re-raise)
- Final main-process model.const/args mirror the serial path's
trailing state so save_sbs_fit reads consistent values either way
Tests parameterize the existing GIR/MCP compare test over n_workers
∈ {1, 2} and add a parity test asserting fitted params match between
serial and parallel paths within rtol=1e-10.
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.
defaults to using number of cores -1 for slice-by-slice fitting