Dynamic Programming on SIMD
SIMD (SSE)


A register has say                   Example
  4 parts, each                       x:=x+y
part has 8 bits or
     16 bits
                            x,y are memory locations of
   Each part                appropriate alignment and
 executes the                 each refers to 4 different
same operation                        variables
 but in parallel
Edit Distance between Strings
                                Q
                                D




 Edit distance
between Q[1..j]
  and D[1..i]
E(i,j)
F(i,j)
Summarizing

                  A    G    C    T
              A   -1   2    2    2
              G   2    -1   2    2
              C   2    2    -1   2
              T   2    2    2    -1
Parallel Computing


                                          Find the max
                                         value path from
Mismatch
                                         each location to
                                           the top left
                                             corner
           Insertion in
                Q




                          Insertion in
                               D
Parallel Computing



  Anti-
diagonal
 can be
done in
parallel
SIMD?




                      One SIMD register
                        can handle all
                     values in this chunk
   Partition into
chunks, each chunk
should have proper
    alignment
Fix: Go Vertical




Partition into vertical
 chunks, each chunk
 should have proper
      alignment
Problem 1: Boundaries



                     One value comes from
                      the previous chunk




Each chunk needs a
       shift
Solution 1: Striping




  x’s belong to one
chunk, y’s to another
      and so on
Problem 2: Computing F




                        At most number of
                             blocks




Sequential Dependency
Problem 2: Computing F




Sequential Dependency
Thank You

Dynamic programming for simd