Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan...

16
Banyan Chris, David, Michelle A Framework for Distribu:ng TreeStructured Problems

Transcript of Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan...

Page 1: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Banyan  

Chris,  David,  Michelle  

A  Framework  for  Distribu:ng  Tree-­‐Structured  Problems  

Page 2: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Context  •  From  class:  MapReduce  and  Dryad  •  Simple  interfaces  for  distributed  programming  

Page 3: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

But  what  about  …  

fun divide_conquer (problem) {!!subproblems = divide(problem)!!subanswers = !! map divide_conquer subproblems!!combine subanswers!}!

•  It’s  recursive!  

Page 4: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Our  contribu4on:  Banyan  

•  Framework  for  distribu:ng  tree-­‐structured  recursive  programs  •  Begins  computa:on  on  one  processor;  ships  subproblems  as  they  arise  •  Uses  Fly  tuplespace  for  memoiza:on  •  Theorem  prover  case  study  

Page 5: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Outline  

•  Programmer  interface  •  Implementa:on  •  Case  study:  theorem  prover  •  Results  •  Future  work  and  conclusion  

Page 6: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Programmer  interface  

•  Implement  two  primary  func:ons:  • workHere,  to  generate  subproblems  •  childReturned,  to  combine  answers  

•  Also  •  Generic  message  handler  •  Coopera:ve  scheduling  func:ons  •  Subproblem  iden:fier  for  shared  memory  indexing  

Page 7: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Architecture  overview  

9  

8   8  

7   7   7  6   6  

5   5  

4  

4  

4  

3  

2  

1  

1  

Coordinator   Client  

Worker   Worker  Worker  

1  

Shared  Memory  

6  

Page 8: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Scheduling  nodes  •  Node  priority  expressed  in  4ckets  •  Job  starts  with  fixed  :ckets;  parents  donate  to  children  •  Ac:ve  local  nodes  scheduled  round-­‐robin  •  Subtrees  shipped  when  local  :ckets  exceed  target  •  Coordinator  keeps  workers  balanced  

Page 9: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Shared  memory  

•  Fly  tuple-­‐space  •  Read,  write,  take  •  Read,  take  match  on  keyed  template  

• We  use  it  to  avoid  duplica:ng  work  •  Store  node  results  •  Check  store  on  child  create  •  Programmer  supplies  indexing  scheme  

Page 10: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Case  study:  Differen4al  dynamic  logic  

•  Interac:ng  discrete  and  con:nuous  components  •  Hard  parts:    •  Invariant  genera:on  •  Quan:fier  elimina:on  

Page 11: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

DL  as  a  Banyan  Applica4on  •  Three  concrete  objects  extending  TreeNode  •  Code  snippet  from  AndNode:  def childReturned(child: Int, v: ReturnType): Unit = ! v match {!!case Proved(rl) => !! numOpenChildren -= 1!

if(numOpenChildren <= 0) returnNode(Proved(rule))!

case GaveUp() =>! returnNode(GaveUp())! }!

•  It  works!  

Page 12: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Water  tank  example  

Proved   Gave  up   Aborted  

Page 13: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Results  –  Water  tank  

Workers   Time  (s)  1   2978  4   1213  

2.4x  speedup  

Page 14: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Workers   T1  (s)   T2  (s)  

1   209   147  

4   50   62  

Results  –  Bouncing  ball  

3.2x  speedup  (avg)  

Page 15: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Future  work  

•  Op:mize  node  distribu:on  •  Pause/resume  •  Dynamically  add  jobs,  workers  •  Fault  tolerance  •  Improve  shared  memory  •  Inexact  matching  • Mul:-­‐host  flyspace  

•  Compare  to  simpler  models  

Page 16: Banyan - Carnegie Mellon School of Computer Science./renshaw/banyan/talk.pdf · Banyan Chris,’David,’Michelle’ A’Framework’for’Distribu:ng’ Tree>Structured’Problems

Conclusion  

• We  made  a  framework  to  facilitate  distribu:on  of  tree-­‐structured  problems  •  You  can  play  with  it:    www.cs.cmu.edu/~renshaw/banyan