Parallelizing the Growing Self-Organizing Maps algorithm using - - PowerPoint PPT Presentation

parallelizing the growing self organizing maps algorithm
SMART_READER_LITE
LIVE PREVIEW

Parallelizing the Growing Self-Organizing Maps algorithm using - - PowerPoint PPT Presentation

Parallelizing the Growing Self-Organizing Maps algorithm using Software Transactional Memory Growing Self-Organizing Maps Is a clustering algorithm. Growing Self-Organizing Maps So for example this is what the input looks like: Growing


slide-1
SLIDE 1

Parallelizing the Growing Self-Organizing Maps algorithm using Software Transactional Memory

slide-2
SLIDE 2

Growing Self-Organizing Maps

Is a clustering algorithm.

slide-3
SLIDE 3

Growing Self-Organizing Maps

So for example this is what the input looks like:

slide-4
SLIDE 4

Growing Self-Organizing Maps

And this is the output you would get:

slide-5
SLIDE 5

Growing Self-Organizing Maps

Bonus: output is a planar graph.

slide-6
SLIDE 6

Growing Self-Organizing Maps

So how to you generate this output?

slide-7
SLIDE 7

Growing Self-Organizing Maps

For each input point point ...

p

slide-8
SLIDE 8

Growing Self-Organizing Maps

you find the closest node in the output graph ...

np

slide-9
SLIDE 9

Growing Self-Organizing Maps

and pull every node in a neighborhood of closer to .

n′ np p

slide-10
SLIDE 10

Growing Self-Organizing Maps

Growth: start with a minimal number of nodes, keep track of the accumulated error for each node, check whether it exceeds a certain threshold, propagate the error to neighbours for internal nodes, create new neighbours for boundary nodes.

slide-11
SLIDE 11

Growing Self-Organizing Maps

Parallelization: this thing is slow (~ ), need to exploit parallelization potential, special case considered here: Multiprocessor/Multicore systems, not GPUs, no distributed computing.

O( ) n2

slide-12
SLIDE 12

Growing Self-Organizing Maps

No problem:

slide-13
SLIDE 13

Growing Self-Organizing Maps

Problem:

slide-14
SLIDE 14

Growing Self-Organizing Maps

Problem:

slide-15
SLIDE 15

Growing Self-Organizing Maps

Problem: need a way to synchronize parallel tasks. Traditional solution: locks, semaphores, critical sections, get complex quickly, don't compose, error prone (deadlocks, livelocks, resource starvation, priority inversion)

slide-16
SLIDE 16

Growing Self-Organizing Maps

Deadlock example (do you see the solution?):

slide-17
SLIDE 17

Growing Self-Organizing Maps

Deadlock example (do you see the solution?) Or: use a different concurrency abstraction, namely Software Transactional Memory.

slide-18
SLIDE 18

Software Transactional Memory

is a concurrency abstraction that: brings transaction semantics known from databases to software/programming, was proposed in the 95s, can be implemented VERY differently, is easier to reason about than locking, keeps a shared memory model, doesn't use user level locks, is still an area of research.

slide-19
SLIDE 19

Software Transactional Memory

Swapping the values of two variables:

swap a b = atomically (do value_a <- readTVar a value_b <- readTVar b writeTVar b value_a writeTVar a value_b)

slide-20
SLIDE 20

Software Transactional Memory

also has limits: transactions mean restarts, restarts disallow side effects, restarts can have surprising performance characteristics. Haskell's implementation: controls side effects through the type system, doesn't use locking, uses an optimistic approach.

slide-21
SLIDE 21

Applying STM to GSOM

means figuring out: thread granularity, transaction granularity, invariants between transactions.

slide-22
SLIDE 22

Applying STM to GSOM

Thread granularity:

  • ne point per thread.

Transaction granularity: figure out in one transaction , move and its neighbors closer to in another .

p np ( ) T1 np p ( ) T2

slide-23
SLIDE 23

Applying STM to GSOM

Transaction invariant: has minimum distance to at the end of and at the beginning of , is ensured by keeping track of pairs in a lookup table , checking whenever a node is modified and updating if necessary, modifications happen only during , transaction semantics guarantee correctness.

np p T1 T 2 (p, ) np t t n t T 2

slide-24
SLIDE 24

Results:

Around 20% speedup for 2 dimensions, 2 threads and 2 cores. Why so slow? most expensive transaction is , is highly likely to be restarted, restarts kill performance gains.

T 1 T 1

slide-25
SLIDE 25

Results:

Even worse for higher dimensions (i.e. around 200): running time degenerates to being unusable. But for this scenario a different parallelization strategy would be more appropriate: parallelize distance measure calculations (possibly on GPUs).

slide-26
SLIDE 26

Thank you for your patience!