Coordinating Data-Parallel SAC Programs with S-Net Sven-Bodo Scholz - - PowerPoint PPT Presentation

coordinating data parallel sac programs with s net
SMART_READER_LITE
LIVE PREVIEW

Coordinating Data-Parallel SAC Programs with S-Net Sven-Bodo Scholz - - PowerPoint PPT Presentation

Coordinating Data-Parallel SAC Programs with S-Net Sven-Bodo Scholz Clemens Grelck and Alex Shafarenko Compiler Technology and Computer Architecture Group University of Hertfordshire, UK HIPS-ToPMoDRS, 26.March 2007, Long Beach


slide-1
SLIDE 1

Coordinating Data-Parallel SAC Programs with S-Net

Sven-Bodo Scholz Clemens Grelck and Alex Shafarenko

Compiler Technology and Computer Architecture Group University of Hertfordshire, UK

HIPS-ToPMoDRS, 26.March 2007, Long Beach www.aether-ist.org

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-2
SLIDE 2

SAC in a nutshell

◮ generic array programming ◮ purely functional ◮ no-frills ◮ aggressive program optimisation ◮ sequential performance competitive with fortran77 ◮ generation of multi-threaded code without annotations

For details see www.sac-home.org

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-3
SLIDE 3

Exploitation of Data-Parallelism in SAC

◮ hinges on our data-parallel construct, the With-Loop ◮ all our array operations are defined by these ◮ granularity control by

◮ array size inference ◮ several fusion techniques

◮ architecture specific code generation ◮ POSIX-threads for SMPs ◮ taylor-made memory management ◮ almost linear speedups for examples such as NAS-benchmarks

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-4
SLIDE 4

So what is the catch??

Our compiler maps all concur- rency into one Concurrency pat- tern:

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-5
SLIDE 5

So what is the catch??

Our compiler maps all concur- rency into one Concurrency pat- tern: if our application cannot be mapped on this pattern, we cannot exploit its concurrency!

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-6
SLIDE 6

An example: Search Algorithms

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-7
SLIDE 7

Our Approach: S-Net

S-Net:

◮ asynchronous component

framework

◮ functional stream

processing

◮ pure coordination

language

◮ dynamic network creation ◮ orthogonal to the box

language Existing software

code code code code code code code

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-8
SLIDE 8

S-Net at a Glance

◮ central construct: box

wraps existing code box foo

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-9
SLIDE 9

S-Net at a Glance

◮ central construct: box

wraps existing code

◮ connected by

◮ single input stream ◮ single output stream

box foo

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-10
SLIDE 10

S-Net at a Glance

◮ central construct: box

wraps existing code

◮ connected by

◮ single input stream ◮ single output stream

◮ streams transport records:

sets of named fields

◮ opaque value fields ◮ integer-valued tag fields

box foo {A,B,<T>}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-11
SLIDE 11

S-Net at a Glance

◮ central construct: box

wraps existing code

◮ connected by

◮ single input stream ◮ single output stream

◮ streams transport records:

sets of named fields

◮ opaque value fields ◮ integer-valued tag fields

◮ box behaviour declared by

type signature box foo {A,B,<T>} {X,<T>} {A,B,<T>}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-12
SLIDE 12

S-Net at a Glance

◮ central construct: box

wraps existing code

◮ connected by

◮ single input stream ◮ single output stream

◮ streams transport records:

sets of named fields

◮ opaque value fields ◮ integer-valued tag fields

◮ box behaviour declared by

type signature

◮ behaviour defined in box

language, not S-Net box foo {X,<T>} {A,B,<T>} {A,B,<T>}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-13
SLIDE 13

S-Net at a Glance

◮ central construct: box

wraps existing code

◮ connected by

◮ single input stream ◮ single output stream

◮ streams transport records:

sets of named fields

◮ opaque value fields ◮ integer-valued tag fields

◮ box behaviour declared by

type signature

◮ behaviour defined in box

language, not S-Net

◮ box maps single input

record to stream of output records box foo {X,<T>} {A,B,<T>} {A,B,<T>} {X,<T>}; {X,<T>};

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-14
SLIDE 14

Network Combinators: Serial

A B box X := A..B

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-15
SLIDE 15

Network Combinators: Choice

A B box X := A..B

B A box X := A||B

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-16
SLIDE 16

Network Combinators: Serial Replication

A B box X := A..B B A box X := A||B

box X := A*{<stop>} A

{<stop>}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-17
SLIDE 17

Network Combinators: Index Split

A B box X := A..B B A box X := A||B box X := A*{<stop>} A

{<stop>}

A A box X := A!<T>

<T>

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-18
SLIDE 18

Primitive Boxes: Filter and Sync

{A,B,<T>} {A,<T>,<X>:=1}; {B,<T>,<X>:=2}

Filter housekeeping:

◮ eliminate record fields ◮ duplicate record fields ◮ add tags ◮ manipulate tag values ◮ ...

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-19
SLIDE 19

Primitive Boxes: Filter and Sync

{A,B,<T>} {A,<T>,<X>:=1}; {B,<T>,<X>:=2}

Filter housekeeping:

◮ eliminate record fields ◮ duplicate record fields ◮ add tags ◮ manipulate tag values ◮ ... {A,B,C,D} {A,B} {C,D}

Sync synchronisation:

◮ keep record that matches

pattern

◮ all patterns matched:

release merged records

◮ pattern already matched:

pass through

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-20
SLIDE 20

Problem: Incompatible Boxes

?

box foo {A,B} {C,D} {C,X} {X,Y} box bar

◮ Box code typically designed in isolation. ◮ Interfaces only partially overlap. ◮ Network composition unfeasible in practice?

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-21
SLIDE 21

Solution: Flow Inheritence

box foo {C,D} {A,B} flow inheritence bypass

◮ Any “unwanted” field is bypassed to output channel ◮ and is attached to any record produced in response.

{A,B,X} {C,D,X}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-22
SLIDE 22

Solution: Flow Inheritence

box foo {C,D} {A,B} flow inheritence bypass

◮ Any “unwanted” field is bypassed to output channel ◮ and is attached to any record produced in response.

{A,B,X} {C,D,X} {C,D,X} {C,D,X}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-23
SLIDE 23

Flow Inheritence: Enabling Network Combination

box foo {C,D} {C,X} {X,Y} box bar {A,B} {X} {D}

◮ Flow inheritence is the key to network glue.

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-24
SLIDE 24

How to apply this to our problem?

box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box vert:= hor *{<done>}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-25
SLIDE 25

How to apply this to our problem?

{..., <k=0>}

box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box vert:= hor *{<done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k>

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-26
SLIDE 26

How to apply this to our problem?

{..., <k=0>} <k=0>

box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box vert:= hor *{<done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-27
SLIDE 27

How to apply this to our problem?

{..., <k=0>} <k=0> {..., <k=1>}

box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box vert:= hor *{<done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>}

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-28
SLIDE 28

How to apply this to our problem?

<k=0> {..., <k=0>} {..., <k=1>} <k=0> <k=1> {..., <k=1>}

box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box vert:= hor *{<done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k>

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-29
SLIDE 29

How to apply this to our problem?

<k=0> {..., <k=0>} {..., <k=1>} <k=0> <k=1> <k=2> <k=0> <k=1> {..., <k=3>} {..., <k=1>} {..., <k=0>} {..., <k=3>} {..., <k=2>} {..., <k=1>} {..., <k=1>}

box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box vert:= hor *{<done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k> box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} box solveOneLevel {board, opts} −> {board, opts, <k>} box solveOneLevel {board, opts} −> {board, opts, <k>} | {board, <done>} | {board, <done>} <k> box hor:= solveOneLevel ! <k>

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-30
SLIDE 30

Conclusion

S-Net is

◮ versatile component framework ◮ for functional stream processing

S-Net features

◮ SISO as predominant construction principle ◮ asynchronous distributed computing ◮ dynamic network extension ◮ open box language interface ◮ few powerfull combinators

Sven-Bodo Scholz Coordinating SAC with S-Net

slide-31
SLIDE 31

Current and Future Work

◮ prototype implementation

(UH + ICL)

◮ runtime system ◮ compiler

◮ graphical tools

(UH + VTT)

◮ network editor ◮ network simulator

◮ mapping to MicroThread architecture

(UH + UvA)

◮ hardware support for light threads ◮ highly efficient synchronisation

◮ applications

(UH + VTT + others)

◮ network protocols ◮ physics simulations ◮ ... Sven-Bodo Scholz Coordinating SAC with S-Net