Semantics Consistent Parallelism

17
Semantics Consistent Parallelism Li-Yi Wei Microsoft Research

description

Semantics Consistent Parallelism. Li-Yi Wei Microsoft Research. Parallelism. parallel. parallel. parallel. Traditional parallelization. Sequential consistency [Lampert] parallel algorithms do NOT change result sorting, FFT, matrix, etc. sort. New parallelization (cheating). - PowerPoint PPT Presentation

Transcript of Semantics Consistent Parallelism

Page 1: Semantics  Consistent Parallelism

Semantics Consistent ParallelismSemantics Consistent Parallelism

Li-Yi Wei

Microsoft Research

Page 2: Semantics  Consistent Parallelism

ParallelismParallelism

Algorithm

API

Hardware parallel

?

CUDA, BSGP

CPU, GPU

parallel

parallel

Page 3: Semantics  Consistent Parallelism

Traditional parallelizationTraditional parallelization

Sequential consistency [Lampert]

parallel algorithms do NOT change result

sorting, FFT, matrix, etc.

1 2 3 4 5 6 7 8

3 8 7 1 6 5 2 4

sort

Page 4: Semantics  Consistent Parallelism

New parallelization (cheating)New parallelization (cheating)

Not all algorithms need to be seq-consistent

perception (graphics/vision/image/video), statistics

approximate solutions might suffice → more parallel

Semantic consistency

Page 5: Semantics  Consistent Parallelism

Pseudo Random Number GeneratorPseudo Random Number Generator

The main source of randomness in programs

e.g. rand() in c/c++

Desirable properties

white noise statistics

repeatable, fast computation

Traditional sequential method

e.g. xn = (a xn-1 + b) mod c

Page 6: Semantics  Consistent Parallelism

Parallel PRNGParallel PRNG

1. input trivially prepared in parallel, e.g. linear ramp

2. feed input value into hash, independently & in parallel

3. output white noise

key idea:

borrow cryptographic hash!

[Tzeng and Wei I3D 2008]

hash

input

output

Page 7: Semantics  Consistent Parallelism

How to start a bar flightHow to start a bar flight

Page 8: Semantics  Consistent Parallelism

How to stop the bar flightHow to stop the bar flight

Parallel GPU run time (slow motion)

4M Poisson disk samples / secin parallel!

Page 9: Semantics  Consistent Parallelism

Poisson disk samplingPoisson disk sampling

A set of samples that are

as random as possible

remain a minimum distance r away from each other

Why pick this problem?

important algorithm

- sampling, graphics, statistics

seemly non-parallelizable

Page 10: Semantics  Consistent Parallelism
Page 11: Semantics  Consistent Parallelism

Dart throwing [Cook 1986]Dart throwing [Cook 1986]

Loop:

random sample from the entire domain

accept sample if not in conflict with existing ones

O High quality

ground truth

X Slow speed

inherently sequential

Page 12: Semantics  Consistent Parallelism

Parallel Poisson disk sampling[Wei SIGGRAPH 2008]Parallel Poisson disk sampling[Wei SIGGRAPH 2008]

Samples from a grid

1 sample per grid cell

Sample grid cells far apart in parallel

Watch out for bias!

Tricks to avoid bias

Page 13: Semantics  Consistent Parallelism

Image cloningImage cloning

Page 14: Semantics  Consistent Parallelism

http://www.freewebs.com/cheesesandwiches/cloning.jpghttp://mahboubian.googlepages.com/dog-bird.jpg

Page 15: Semantics  Consistent Parallelism

Poisson image editing[Perez et al. SIGGRAPH 2003]Poisson image editing[Perez et al. SIGGRAPH 2003]

State-of-art for image cloning + other stuff

Solving Poisson equation

interior detail (source)

boundary condition (target)

Heavy computation

Page 16: Semantics  Consistent Parallelism

[Farbman et al. SIGGRAPH 2009]

p = ∑ wi bi

Easy computation

Run parallel on a GPU

Coordinate interpolationCoordinate interpolation

Page 17: Semantics  Consistent Parallelism

SummarySummary

Conclusion

sequential consistency too strict

semantic consistency (perceptual, statistical, etc)

Future work

parallelism via semantic consistency

individual algorithms / applications

general methodology?