serialization sets a dynamic dependence based parallel execution model
Download
Skip this Video
Download Presentation
Serialization Sets A Dynamic Dependence-Based Parallel Execution Model

Loading in 2 Seconds...

play fullscreen
1 / 27

Serialization Sets A Dynamic Dependence-Based Parallel Execution Model - PowerPoint PPT Presentation


  • 148 Views
  • Uploaded on

Serialization Sets A Dynamic Dependence-Based Parallel Execution Model. Matthew D. Allen Srinath Sridharan Gurindar S. Sohi University of Wisconsin-Madison. Motivation. Multicore processors ubiquitous Performance via parallel execution Multithreaded programming is problematic

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Serialization Sets A Dynamic Dependence-Based Parallel Execution Model' - becca


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
serialization sets a dynamic dependence based parallel execution model

Serialization SetsA Dynamic Dependence-Based Parallel Execution Model

Matthew D. Allen

SrinathSridharan

Gurindar S. Sohi

University of Wisconsin-Madison

motivation
Motivation
  • Multicore processors ubiquitous
    • Performance via parallel execution
  • Multithreaded programming is problematic
    • Dependences encoded statically
    • Difficult to reason about locks, synchronization
    • Many errors not found in sequential programs
    • Execution is nondeterministic
  • Need better parallel execution models!

PPoPP 2009

serialization sets overview
Serialization Sets Overview
  • Sequential program with annotations
    • Identify potentially independent methods
    • Associate a serializer with these methods
  • Serializer groups dependent method invocations into serialization sets
    • Runtime executes in order to honor dependences
  • Serializer attempts to map independent methods invocations into different sets
    • Runtime opportunistically parallelizes execution

PPoPP 2009

serialization sets overview1
Serialization Sets Overview
  • Sequential program with no locks and

no explicit synchronization

  • Deterministic, race-free execution
  • Comparable performance to multithreading
    • Sometimes better!

PPoPP 2009

outline
Outline
  • Overview
  • Serialization Sets Execution Model
  • Prometheus: C++ Library for SS
  • Experimental Evaluation
  • Related Work & Conclusions

PPoPP 2009

running example
Running Example

# of transactions?

trans_t* trans;

while ((trans = get_trans ()) != NULL) {

account_t* account = trans->account;

if (trans->type == DEPOSIT)

account->deposit (trans->amount);

if (trans->type == WITHDRAW)

account->withdraw (trans->amount);

}

Points to?

Loop-carried dependence?

Several static unknowns!

PPoPP 2009

multithreading strategy
Multithreading Strategy

Oblivious to what accounts each thread may access!

→ Methods must lock account to

→ ensure mutual exclusion

trans_t* trans;

while ((trans = get_trans ()) != NULL) {

account_t* account = trans[i]->account;

if (trans->type == DEPOSIT)

account->deposit (trans->amount);

if (trans->type == WITHDRAW)

account->withdraw (trans->amount);

}

  • Read all transactions into an array
  • Divide chunks of array among multiple threads

PPoPP 2009

serialization sets
Serialization Sets
  • Potentially independent methods
    • Modify only data owned by object
    • Fields / Data members
    • Pointers to non-shared data
    • Consistent with OO practices (modularity, encapsulation, information hiding)
  • Modifying methods for independence
    • Store return value in object, retrieve with accessor
    • Copy pointer data

PPoPP 2009

serialization sets1
Serialization Sets
  • Divide program into isolation epochs
    • Data partitioned into domains
  • Privately writable: data that may be read or written by a single serialization set
    • Object or set of objects
    • Serializer dynamically identifies serialization set for each method invocation
  • Shared read-only: data that may be read (but not written) by any method

PPoPP 2009

example with serialization sets
Example with Serialization Sets

writable <account_t, acct_ser_t> pw_account_t;

begin_isolation ();

trans_t* trans;

while ((trans = get_trans ()) != NULL) {

pw_account_t* account = trans->account;

if (trans->type == DEPOSIT)

delegate(account, deposit, trans->amount);

if (trans->type == WITHDRAW)

delegate(account, withdraw, trans->amount);

}

end_isolation ();

Declare privately-writable account

Serializer type: uses account number to compute serialization set

Delegate indicates potentially-independent operations

  • At execution, delegate:
  • Executes serializer
  • Identifies serialization set
  • Inserts invocation in serialization set

Begin isolation epoch

End isolation epoch

PPoPP 2009

slide11

Delegate context

Program context

SS #100

SS #200

SS #300

delegate

deposit

acct=100

$2000

deposit

acct=100

$300

withdraw

acct=100

$50

withdraw

acct=100

$20

delegate

delegate

delegate

withdraw

acct=200

$1000

withdraw

acct=200

$1000

delegate

delegate

delegate

delegate

withdraw

acct=300

$350

deposit

acct=300

$5000

Serializer: computes SS with account number

ss_t ss = account->get_number();

PPoPP 2009

slide12

Delegate threads

Delegate context

Program thread

Program context

SS #100

Delegate 0

SS #200

Delegate 1

SS #300

delegate

withdraw

acct=100

$50

withdraw

acct=100

$20

deposit

acct=100

$2000

deposit

acct=100

$300

withdraw

acct=100

$50

withdraw

acct=100

$20

deposit

acct=100

$300

deposit

acct=100

$2000

delegate

delegate

delegate

withdraw

acct=200

$1000

withdraw

acct=200

$1000

withdraw

acct=200

$1000

withdraw

acct=200

$1000

delegate

delegate

delegate

delegate

withdraw

acct=300

$350

withdraw

acct=300

$350

deposit

acct=300

$5000

deposit

acct=300

$5000

Race-free, deterministic execution without synchronization!

PPoPP 2009

parallel execution w o sharing
Parallel Execution w/o Sharing
  • Vary data in privately-writable/read-only domains in alternating epochs
    • Outputs of one epoch become inputs of the next
  • Associative, commutative methods
    • Operate on local copy of state
    • Reduction to summarize result
  • Containers manipulated by program context
    • Delegate operations on underlying data

PPoPP 2009

outline1
Outline
  • Overview
  • Serialization Sets Execution Model
  • Prometheus: C++ Library for SS
  • Experimental Evaluation
  • Related Work & Conclusions

PPoPP 2009

prometheus c library for ss
Prometheus: C++ Library for SS
  • Template library
    • Compile-time instantiation of SS data structures
    • Metaprogramming for static type checking
  • Runtime orchestrates parallel execution
  • Portable
    • x86, x86_64, SPARC V9
    • Linux, Solaris

PPoPP 2009

prometheus serializers
Prometheus Serializers
  • Serializers
    • Subclass serializer base class and override method
    • Or use built-in serializer supplied by library
  • Reducibles
    • Subclass reducible base class and override virtual reduce method
    • Reduction automatically performed on first use after isolation epoch ends

PPoPP 2009

prometheus runtime
Prometheus Runtime

Program Thread

Delegate Thread 0

Delegate Thread 2

Delegate Thread 1

Delegate assignment:

SS % NUM_THREADS

Communication queues:

Fast-Forward [PPoPP 2008] +

Polymorphic interface

PPoPP 2009

debugging support
Debugging Support
  • Tag all data accessed by serialization set
    • Objects
    • Smart pointers
  • Any data accessed by multiple serialization sets indicates programmer error
  • Problem: can’t detect some kinds of missing annotations
    • Future work: static checking of annotations

PPoPP 2009

debugging support1
Debugging Support
  • Deterministic model means we can simulate SS execution in sequential program
    • Prometheus support for compiling debug version
    • Do all debugging on sequential program!
  • Correct sequential → correct parallel

(caveat: for a given input)

PPoPP 2009

outline2
Outline
  • Overview
  • Serialization Sets Execution Model
  • Prometheus: C++ Library for SS
  • Experimental Evaluation
  • Related Work & Conclusions

PPoPP 2009

evaluation methodology
Evaluation Methodology
  • Benchmarks
    • Lonestar, NU-MineBench, PARSEC, Phoenix
  • Conventional Parallelization
    • pthreads, OpenMP
  • Prometheus versions
    • Port program to sequential C++ program
    • Idiomatic C++: OO, inheritance, STL
    • Parallelize with serialization sets

PPoPP 2009

results summary
Results Summary

4 Socket AMD Barcelona (4-way multicore) = 16 total cores

PPoPP 2009

results summary1
Results Summary

PPoPP 2009

outline3
Outline
  • Overview
  • Serialization Sets Execution Model
  • Prometheus: C++ Library for SS
  • Experimental Evaluation
  • Related Work & Conclusions

PPoPP 2009

related work
Related Work
  • Actors / Active Objects
    • Hewitt [JAI 1977]
  • MultiLisp
    • Halstead [ACM TOPLAS 1985]
  • Inspector-Executor
    • Wu et al. [ICPP 1991]
  • Jade
    • Rinard and Lam [ACM TOPLAS 1998]
  • Cilk
    • Frigo et al. [PLDI 1998]
  • OpenMP

PPoPP 2009

conclusions
Conclusions
  • Sequential program with annotations
    • No explicit synchronization, no locks
  • Programmers focus on keeping computation private to object state
    • Consistent with OO programming practices
  • Dependence-based model
    • Deterministic race-free parallel execution
  • Performance close to, and sometimes better, than multithreading

PPoPP 2009

questions
Questions

PPoPP 2009

ad