Fast, Parallel Implementation
of Particle Filter on GPU
Introduction
Image processing, navigation, financial mathematics, etc:
Non-linear, non-Gaussian state-space
Analytic solution: not possible
Kalman filter suboptimal
Particle filter
Bootstrap filter: resampling
Standard PF: high running time
Review – 1.
1) Parallel implementation:
share ratio 25%
Quality degradation
CPU RNG
Data transfer!
Textures (2D)
Review – 2.
2) Resampling
Spreading-narrowing
N x Pi
Stratified random: {10, 20, 50, 100, 200, 500}
Metropolis resampler
Pair-wise operations
– B iterations / each p particle – Uniform choice
– Weight ration based refresh
Parallelizable
Background – 1.HMM & PF
Hidden Markov Model
Particle filter:
N particles / state
System dynamics → fitness & weight
„Weak” particles are filtered
Background – 2.PF algorithm
Steps / system-state:
1. Fitness calculation: density function of hidden sequence noise: actual observation ↔ observation based on model
2. Resampling: normalized weights, uniform random sweepstake
Estimation for xt ← average of choosen particles 3. Iteration:
based on model
Init for state t+1
Background – 3. CPF
Step 1 and 3: parallelizable
Idea for resampling: CNN architecture
Information exchange
Parallelizable
• Runtime: decrease
• error: decrease
HW details – GPU
Considetations:
Memory: access time ↔ information share
Warp conflict avoidance: 256 thr/blck
Random number generation – 1.
Our principal: GPU shared memory
NVIDIA Mersenne Twister
Inappropriate distribution for low numbers
Data file, seeds: 4096 different values
LFSR
Modified NVIDIA MT
Parameters and masks: defined as published in original article
Seed for recursion array based on: time, thread ID
Random number generation – 2.
Compare results:
60 bins on [0,1] for 1000 random numbers, 60 bins on [0,1] for 1000 random numbers
MATLAB vs. NVIDIA SDK Mersenne Twister MATLAB vs. modified NVIDIA SDK MT
Technical details: CPF on GPU
Restructure
2D → 1D → ring
Speed + information
Shared memory
Overlapping arrays
System overview
Allocate memory in global memory Initialize particles;
t = 1
t < T Main kernel
Summing kernel Averageing
kernel
t += 1 Estimation
array in global mem array
Main kernel
1. Copy: Y(t) to shared memory 2. Copy xparticles to shared memory
3. Calculate Lshared using: Y(t) and xshared(i)
4. Wshared: Norming sums for each xshared(i) on Ni 5. Reseed block
6. Generate RND num for each particle 7. Parallel resampling for each particle
8. Write resampled particles to global memory array 9. Iterate with random noise on xshared
10. Copy particles from xshared to xparticles
global → shared global → shared global → shared
shared → global shared → global
shared shared shared shared shared
shared
Measurements – 1.
Benchmark model
Widely used, non-linear and continous state- space, linear tools not applicable
24 (N,r) configurations, 1000 trajectories
N: 512, 1024, 2048, 4096, 8192, 16384
r = 32, 64, 128, 256
Mean sqaure error: estimation ↔ hidden sequence
Time
Measurements – results 1.
LFSR RMSE: sigmoid type decrease
MT:
RMSE for small numbers better
No significant improvement:
quality of MT still could be improved
Time: Ni sequential;
multiprocessor schedule
Measurements – results 2.
CPF:
Slight error difference but!
speedup
GPU: 4096 to 16K particles:
150 to 282 ms
CPF: 4096 particles 441 ms
Thank you for your kind attention!
Submitted to:
EURASIP Journal on Advances in Signal Processing
Questions?
System overview
Random number generation – 1.
Our principal: GPU shared memory
NVIDIA Mersenne Twister
Inappropriate distribution for low numbers
Data file, seeds: 4096 different values
LFSR
Modified NVIDIA MT
Parameters and masks: defined as published in original article
Seed for recursion array based on: time, thread ID
Random number generation – 1.
Our principal: GPU shared memory
NVIDIA Mersenne Twister
Inappropriate distribution for low numbers
Data file, seeds: 4096 different values
LFSR
Modified NVIDIA MT
Parameters and masks: defined as published in original article
Seed for recursion array based on: time, thread ID
Kenyérszöveg: Verdana 16/18pt
egy egyszerű szövegrészlete, szövegutánzata a betűszedő és nyomdaiparnak.
A Lorem Ipsum az 1500-as évek óta standard szövegrészletként szolgált az iparban; mikor egy ismeretlen nyomdász összeállította a betűkészletét és egy példa-könyvet vagy szöveget nyomott papírra, ezt használta. Nem csak 5
évszázadot élt túl, de az elektronikus betűkészleteknél is változatlanul
megmaradt. Az 1960-as években népszerűsítették a Lorem Ipsum részleteket magukba foglaló Letraset lapokkal, és legutóbb softwarekkel mint például az Aldus Pagemaker. Az 1960-as években népszerűsítették a Lorem Ipsum
részleteket magukba foglaló Letraset lapokkal, és legutóbb softwarekkel mint például az Aldus Pagemaker. Az 1960-as években népszerűsítették a Lorem Ipsum részleteket magukba foglaló Letraset lapokkal, és legutóbb
softwarekkel mint például az Aldus Pagemaker.
Címsor: Verdana 24pt
Kenyérszöveg: Verdana 16/18pt
egy egyszerű szövegrészlete, szövegutánzata a betűszedő és nyomdaiparnak.
A Lorem Ipsum az 1500-as évek óta standard szövegrészletként szolgált az iparban; mikor egy ismeretlen nyomdász összeállította a betűkészletét és egy példa-könyvet vagy szöveget nyomott papírra, ezt használta.
Nem csak 5 évszázadot élt túl, de az elektronikus betűkészleteknél is változatlanul megmaradt.
Nem csak 5 évszázadot élt túl, de az elektronikus betűkészleteknél is változatlanul megmaradt.