A Distributed Abstraction Algorithm for Online Predicate Detection - - PowerPoint PPT Presentation

a distributed abstraction algorithm for online predicate
SMART_READER_LITE
LIVE PREVIEW

A Distributed Abstraction Algorithm for Online Predicate Detection - - PowerPoint PPT Presentation

A Distributed Abstraction Algorithm for Online Predicate Detection Himanshu Chauhan 1 Vijay K. Garg 1 Aravind Natarajan 2 Neeraj Mittal 2 1 Parallel & Distributed Systems Lab, Department of Electrical & Computer Engineering University of


slide-1
SLIDE 1

A Distributed Abstraction Algorithm for Online Predicate Detection

Himanshu Chauhan 1 Vijay K. Garg 1 Aravind Natarajan 2 Neeraj Mittal 2

1Parallel & Distributed Systems Lab,

Department of Electrical & Computer Engineering University of Texas at Austin

2Department of Computer Science,

University of Texas at Dallas

slide-2
SLIDE 2

Outline

Himanshu (UT Austin) Distributed Online Abstraction 1 / 1

slide-3
SLIDE 3

Outline

Himanshu (UT Austin) Distributed Online Abstraction 2 / 1

slide-4
SLIDE 4

Motivation & Problem Definition

Why Online Predicate Detection?

Large Parallel Computations

Non-terminating executions, e.g. server farms Debugging, Runtime validation

Himanshu (UT Austin) Distributed Online Abstraction 3 / 1

1 1

slide-5
SLIDE 5

Motivation & Problem Definition

Other Applications

General predicate detection algorithms, such as Cooper-Marzullo [1991]

Perform abstraction with respect to simpler predicate Detect remaining conjunct in the abstracted structure Reduced complexity by using abstraction based detection

Himanshu (UT Austin) Distributed Online Abstraction 4 / 1

slide-6
SLIDE 6

Motivation & Problem Definition

Predicate Detection in Distributed Computations

Find all global states in a computation that satisfy a predicate a 1 b 2 c −1 d e f 2 g 1 h 3 u 4 v 1 w 2 x 4 P1 P2 P3 x1 x2 x3 Predicate (x1 ∗ x2 + x3 < 5) ∧ (x1 ≥ 1) ∧ (x3 ≤ 3): O(k3) steps O(kn) complexity for n processes, and k events per process Compute intensive for large computations

Himanshu (UT Austin) Distributed Online Abstraction 5 / 1

slide-7
SLIDE 7

Motivation & Problem Definition

Exploiting Predicate Structure Using Abstractions

Predicate (x1 ∗ x2 + x3 < 5)∧ (x1 ≥ 1) ∧ (x3 ≤ 3) a 1 b 2 c −1 d e f 2 g 1 h 3 u 4 v 1 w 2 x 4 P1 P2 P3 x1 x2 x3

(a) Original Computation

a, e, f , u, v b w g

(b) Slice w.r.t.

(x1 ≥ 1) ∧ (x3 ≤ 3)

Himanshu (UT Austin) Distributed Online Abstraction 6 / 1

slide-8
SLIDE 8

Motivation & Problem Definition

Paper Focus

Offline and Online algorithms for abstracting computations for regular predicates exist [Mittal et al. 01 & Sen et al. 03] This paper: Efficient distributed online algorithm to abstract a computation with respect to regular predicates.

Himanshu (UT Austin) Distributed Online Abstraction 7 / 1

slide-9
SLIDE 9

Outline

Himanshu (UT Austin) Distributed Online Abstraction 8 / 1

slide-10
SLIDE 10

Model

System Model

Asynchronous message passing n reliable processes FIFO, loss-less channels Denote a distributed computation with (E, →)

E: Set of all events in the computation →: happened-before relation [Lamport 78]

Himanshu (UT Austin) Distributed Online Abstraction 9 / 1

slide-11
SLIDE 11

Consistent Cuts and Lattices, Regular Predicates

Consistent Cuts

Consistent Cut: Possible global state of the system during its execution.

Himanshu (UT Austin) Distributed Online Abstraction 10 / 1

slide-12
SLIDE 12

Consistent Cuts and Lattices, Regular Predicates

Consistent Cuts

Consistent Cut: Possible global state of the system during its execution. Formally: Given a distributed computation (E, →), a subset of events C ⊆ E is a consistent cut if C contains an event e only if it contains all events that happened-before e. e ∈ C ∧ f → e ⇒ f ∈ C

Himanshu (UT Austin) Distributed Online Abstraction 10 / 1

slide-13
SLIDE 13

Consistent Cuts and Lattices, Regular Predicates

Consistent Cuts

Consistent Cut: Possible global state of the system during its execution. i.e. if a message receipt event has happened, the corresponding message send event must have happened.

Himanshu (UT Austin) Distributed Online Abstraction 10 / 1

slide-14
SLIDE 14

Consistent Cuts and Lattices, Regular Predicates

Consistent Cuts

Consistent Cut: Possible global state of the system during its execution. For conciseness, we represent a consistent cut by its maximum elements

  • n each process.

a b c e f g P1 P2 {}

  • {a}
  • [b, e]
  • [c, e]
  • [a, f ]

X Use vector clocks for checking consistency/finding causual dependency

Himanshu (UT Austin) Distributed Online Abstraction 10 / 1

slide-15
SLIDE 15

Consistent Cuts and Lattices, Regular Predicates

Lattice of Consistent Cuts

Set of all consistent cuts of a computation (E, →), forms a lattice under the relation ⊆. [Mattern 89]

Himanshu (UT Austin) Distributed Online Abstraction 11 / 1

slide-16
SLIDE 16

Consistent Cuts and Lattices, Regular Predicates

Lattice of Consistent Cuts

a b c e f g P1 P2

{} {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Computation and its Lattice of Consistent Cuts

Himanshu (UT Austin) Distributed Online Abstraction 11 / 1

slide-17
SLIDE 17

Consistent Cuts and Lattices, Regular Predicates

Regular Predicates

A predicate is regular if for any two consistent cuts C and D that satisfy the predicate, the consistent cuts given by (C ∪ D) and (C ∩ D) also satisfy the predicate.

Himanshu (UT Austin) Distributed Online Abstraction 12 / 1

slide-18
SLIDE 18

Consistent Cuts and Lattices, Regular Predicates

Regular Predicates

A predicate is regular if for any two consistent cuts C and D that satisfy the predicate, the consistent cuts given by (C ∪ D) and (C ∩ D) also satisfy the predicate. a b c e f g P1 P2

Himanshu (UT Austin) Distributed Online Abstraction 12 / 1

slide-19
SLIDE 19

Consistent Cuts and Lattices, Regular Predicates

Regular Predicates

A predicate is regular if for any two consistent cuts C and D that satisfy the predicate, the consistent cuts given by (C ∪ D) and (C ∩ D) also satisfy the predicate. a b c e f g P1 P2 {b, g} ∩ {c, f } = {b, f }, {b, g} ∪ {c, f } = {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 12 / 1

slide-20
SLIDE 20

Consistent Cuts and Lattices, Regular Predicates

Regular Predicates - Examples

Local Predicates Conjunctive Predicates − conjunctions of local predicates Monotonic Channel Predicates

All channels are empty/full There are at most m messages in transit from Pi to Pj

Himanshu (UT Austin) Distributed Online Abstraction 13 / 1

slide-21
SLIDE 21

Consistent Cuts and Lattices, Regular Predicates

Regular Predicates - Examples

Local Predicates Conjunctive Predicates − conjunctions of local predicates Monotonic Channel Predicates

All channels are empty/full There are at most m messages in transit from Pi to Pj

Not Regular: There are even number of messages in a channel

Himanshu (UT Austin) Distributed Online Abstraction 13 / 1

slide-22
SLIDE 22

Consistent Cuts and Lattices, Regular Predicates

Regular Predicates

Predicate: “all channels are empty” a b c e f g P1 P2

{} {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 14 / 1

slide-23
SLIDE 23

Consistent Cuts and Lattices, Regular Predicates

Regular Predicates

Predicate: “all channels are empty” a b c e f g P1 P2

{} {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 14 / 1

slide-24
SLIDE 24

Outline

Himanshu (UT Austin) Distributed Online Abstraction 15 / 1

slide-25
SLIDE 25

Abstractions of Computations - Slicing

Why use Abstractions?

Goal: Find all global states that satisfy a given predicate. Key Benefit of Abstraction When B is regular: we can “get away” with only enumerating cuts that satisfy B, and are not joins of other consistent cuts. Due to Birkhoff’s Representation Theorem for Lattices [Birkhoff 37]

Himanshu (UT Austin) Distributed Online Abstraction 16 / 1

slide-26
SLIDE 26

Abstractions of Computations - Slicing

Abstractions for Regular Predicates

Slice: A subset of the set of all global states of a computation that satisfies the predicate.

Himanshu (UT Austin) Distributed Online Abstraction 17 / 1

slide-27
SLIDE 27

Abstractions of Computations - Slicing

Abstractions for Regular Predicates

Slice: A subset of the set of all global states of a computation that satisfies the predicate. start end

Consistent Cuts Satisfying B Slice for B

Himanshu (UT Austin) Distributed Online Abstraction 17 / 1

slide-28
SLIDE 28

Abstractions of Computations - Slicing

Abstractions for Regular Predicates

Slice: A subset of the set of all global states of a computation that satisfies the predicate.

Himanshu (UT Austin) Distributed Online Abstraction 17 / 1

slide-29
SLIDE 29

Abstractions of Computations - Slicing

Abstractions for Regular Predicates

Slice: A subset of the set of all global states of a computation that satisfies the predicate.

a b c e f g {} {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g} {a} {e} {b, f } {c, f } {b, g}

B: “all channels are empty”

Himanshu (UT Austin) Distributed Online Abstraction 17 / 1

slide-30
SLIDE 30

Abstractions of Computations - Slicing

How do we do that?

Exploit JB(e)

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-31
SLIDE 31

Abstractions of Computations - Slicing

How do we do that?

Given a predicate B, and event e in a computation JB(e): The least consistent cut that satisfies B and contains e.

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-32
SLIDE 32

Abstractions of Computations - Slicing

How do we do that?

Given a predicate B, and event e in a computation JB(e): The least consistent cut that satisfies B and contains e.

a b c e f g P1 P2 {} Not in Slice In Slice {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-33
SLIDE 33

Abstractions of Computations - Slicing

How do we do that?

Given a predicate B, and event e in a computation JB(e): The least consistent cut that satisfies B and contains e.

a b c e f g P1 P2 {} Not in Slice In Slice {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-34
SLIDE 34

Abstractions of Computations - Slicing

How do we do that?

Given a predicate B, and event e in a computation JB(e): The least consistent cut that satisfies B and contains e.

a b c e f g P1 P2 {} Not in Slice In Slice {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-35
SLIDE 35

Abstractions of Computations - Slicing

How do we do that?

Given a predicate B, and event e in a computation JB(e): The least consistent cut that satisfies B and contains e.

a b c e f g P1 P2 {} Not in Slice In Slice {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-36
SLIDE 36

Abstractions of Computations - Slicing

How do we do that?

Given a predicate B, and event e in a computation JB(e): The least consistent cut that satisfies B and contains e.

a b c e f g P1 P2 {} Not in Slice In Slice {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-37
SLIDE 37

Abstractions of Computations - Slicing

How do we do that?

Given a predicate B, and event e in a computation JB(e): The least consistent cut that satisfies B and contains e.

a b c e f g P1 P2 {} Not in Slice In Slice {a} {e} {b} {a, e} {c} {b, e} {c, e} {b, f } {c, f } {b, g} {c, g}

Himanshu (UT Austin) Distributed Online Abstraction 18 / 1

slide-38
SLIDE 38

Abstractions of Computations - Slicing

Slice for Regular Predicates

For a computation (E, →), and regular predicate B

Slice for B is defined as: JB = {JB(e) | e ∈ E}

Himanshu (UT Austin) Distributed Online Abstraction 19 / 1

slide-39
SLIDE 39

Abstractions of Computations - Slicing

Bored with definitions?

Enough with the definitions Enough with notation Just tell us the crux of it

Himanshu (UT Austin) Distributed Online Abstraction 20 / 1

slide-40
SLIDE 40

Abstractions of Computations - Slicing

Bored with definitions?

It comes down to a two line pseudo-code foreach event e in computation: find the least consistent cut that satisfies B and includes e

Himanshu (UT Austin) Distributed Online Abstraction 20 / 1

slide-41
SLIDE 41

Slicing Algorithm

Centralized Online Slicing

One process acts as the central slicer - CS Each process Pi sends details (state/vector clock etc.) of relevant events to CS [Mittal et al. 07]

Himanshu (UT Austin) Distributed Online Abstraction 21 / 1

Slicer P1 P2 1 1

slide-42
SLIDE 42

Outline

Himanshu (UT Austin) Distributed Online Abstraction 22 / 1

slide-43
SLIDE 43

Basic Algorithm

Challenges

Simple decomposition of centralized algorithm into n independent executions is inefficient Results in large number of redundant communications Multiple computations lead to identical results

Himanshu (UT Austin) Distributed Online Abstraction 23 / 1

slide-44
SLIDE 44

Basic Algorithm

Distributed Online Slicing

Each process Pi has an additional slicer thread Si Pi sends details (state/vector clock etc.) of relevant events locally to Si

Himanshu (UT Austin) Distributed Online Abstraction 24 / 1

S1 P1 P2 S2 T2 T1 S2 1 1

slide-45
SLIDE 45

Basic Algorithm

Distributed Algorithm at Si

Each slicer, Si, has a token, Ti, that computes JB(e) where e ∈ Ei Tokens are sent to other slicers to progress on JB(e) For each event make use of: e → f ⇒ JB(e) ⊆ JB(f )

Himanshu (UT Austin) Distributed Online Abstraction 25 / 1

slide-46
SLIDE 46

Basic Algorithm

Distributed Algorithm at Si

B = “all channels are empty” T1 @ S1 T2 @ S2 e P1.1 P2.1 cut [1, 0] [0, 1] dependency [1, 0] [0, 1] cut consistent?

  • satisfies B?
  • utput cut?
  • wait for

P1.2 P2.2

Himanshu (UT Austin) Distributed Online Abstraction 25 / 1

S1 P1 P2 S2 T2 T1 S2 1 1

slide-47
SLIDE 47

Basic Algorithm

What happens in non-trivial cases?

B= “all channels are empty”

Himanshu (UT Austin) Distributed Online Abstraction 26 / 1

S1 P1 P2 S2 T2 T1 S2 1 1 1 1

slide-48
SLIDE 48

Basic Algorithm

What happens in non-trivial cases?

B= “all channels are empty” 1 2 1 P1 P2 S1 T1 S2 T2 Suppose, P1 just reported its 2nd event to S1

Himanshu (UT Austin) Distributed Online Abstraction 26 / 1

slide-49
SLIDE 49

Basic Algorithm

What happens in non-trivial cases?

B= “all channels are empty” 1 2 1 P1 P2 S1 T1 S2 T2 Suppose, P1 just reported its 2nd event to S1 T1 @ S1 e P1.2 cut [2, 0] dependency [2, 0] cut consistent?

  • satisfies B?

X wait for P2.1 send T1 to S2

Himanshu (UT Austin) Distributed Online Abstraction 26 / 1

slide-50
SLIDE 50

Basic Algorithm

S2 receives T1

Regular predicate structure Exact knowledge of which event to wait for Which states to evaluate predicate on 1 2 1 2 P1 P2 S1 T1 wait for P2.1 S2

Himanshu (UT Austin) Distributed Online Abstraction 27 / 1

slide-51
SLIDE 51

Basic Algorithm

S2 receives T1

Regular predicate structure Exact knowledge of which event to wait for Which states to evaluate predicate on 1 2 1 2 P1 P2 S1 T1 wait for P2.1 S2 B would not be even evaluated on any state unless S2 is told about a message ‘receipt’

Himanshu (UT Austin) Distributed Online Abstraction 27 / 1

slide-52
SLIDE 52

Basic Algorithm

S2 receives T1

Regular predicate structure Exact knowledge of which event to wait for Which states to evaluate predicate on 1 2 1 2 P1 P2 S1 T1 S2 B would not be even evaluated on any state unless S2 is told about a message ‘receipt’ T1 would wait at S2 till P2.2 is reported

Himanshu (UT Austin) Distributed Online Abstraction 27 / 1

slide-53
SLIDE 53

Basic Algorithm

P2.2 is reported to S2

After P2.2 is reported to S2 1 2 1 2 P1 P2 S1 T1 T2 S2 T1 @ S2 T2 @ S2 e P1.2 P2.2 cut [2, 2] [2, 2] dependency [2, 2] [2, 2] cut consistent?

  • satisfies B?
  • utput cut?
  • wait for

P1.3 P2.3 S2 sends T1 back to S1

Himanshu (UT Austin) Distributed Online Abstraction 28 / 1

slide-54
SLIDE 54

Optimizations

Optimizations - I

a b c e f g P1 P2 S1 T1 computing for b S2 T2 computing for f Send only if needed - ie. before sending your token to Sk, check if you have token Tk containing the required information.

Himanshu (UT Austin) Distributed Online Abstraction 29 / 1

slide-55
SLIDE 55

Optimizations

Optimizations - I

a b c e f g P1 P2 S1 T1 computing for b S2 T2 computing for f Send only if needed - ie. before sending your token to Sk, check if you have token Tk containing the required information.

Himanshu (UT Austin) Distributed Online Abstraction 29 / 1

slide-56
SLIDE 56

Optimizations

Optimizations - II

Stall computations that would lead to duplicate computations a b c e f g P1 P2 S1 T1 computing for b S2 T2 computing for f

Himanshu (UT Austin) Distributed Online Abstraction 30 / 1

slide-57
SLIDE 57

Optimizations

Optimizations - II

Stall computations that would lead to duplicate computations a b c e f g P1 P2 S1 T1 computing for b S2 T2 computing for f Allow only one computation to progress if there is a possibility of duplicates (see paper for details)

Himanshu (UT Austin) Distributed Online Abstraction 30 / 1

slide-58
SLIDE 58

Outline

Himanshu (UT Austin) Distributed Online Abstraction 31 / 1

slide-59
SLIDE 59

Comparison with Centralized Approach

Distributed vs Centralized

n: # of processes, |S|: # bits required to store state data |E|: # of events in computation |Ei|: # of events on process Pi Centralized Distributed Work/Process O(n2|E|) O(n|E|) Space/Process O(|E|.|S|) O(|Ei|.|S|) O(n) savings in work per process O(n) savings in storage space per process For conjunctive predicates: The optimized version has O(n) savings in message load per process

Himanshu (UT Austin) Distributed Online Abstraction 32 / 1

slide-60
SLIDE 60

Questions

Questions?

Thanks!

Himanshu (UT Austin) Distributed Online Abstraction 33 / 1

slide-61
SLIDE 61

Questions

Future Work

Even with optimizations, there can be degenerate cases with O(|E|) messages on a single process Is there a distributed algorithm that guarantees reduced messages (by O(n)) per process? Total work performed is still O(n|E|) Is there a distributed algorithm that reduces this bound?

Himanshu (UT Austin) Distributed Online Abstraction 34 / 1