Repository navigation
Add CPU multithreading for particle filters - #195
Merged
Merged
Conversation
Introduce _predict_particles and _update_particles as the population traversal boundary, matching the GPU RBPF work so both CPU threading and batched storage dispatch at the same point.
ParticleFilter gains an execution option (SerialExecution by default, ThreadedExecution opt-in), forwarded by RBPF and AuxiliaryParticleFilter. Initialisation, prediction, updates and APF lookahead weights go through a single population map. Threaded maps give each fixed-size block of particles its own generator derived from one draw of the caller's rng, so results do not depend on the number of threads or scheduling.
Route the refreshment weight maps through the particle filter's execution. The weights draw no randomness, so threaded values equal serial ones exactly. Closes #135.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #195 +/- ##
==========================================
+ Coverage 78.88% 79.66% +0.77%
==========================================
Files 77 80 +3
Lines 3386 3530 +144
==========================================
+ Hits 2671 2812 +141
- Misses 715 718 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Closes #135. Supersedes
th/parallel-pf.Adds opt-in multithreading for particle filters via
BF(N; execution=ThreadedExecution()). RBPF, APF and CSMC (including ancestor sampling and backward simulation weights) inherit the setting. Per-particle work runs in fixed-size blocks, each with its own RNG derived from the caller's, so results don't depend on the number of threads.SerialExecution()remains the default and is unchanged.