Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ParT abstraction

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Kiko Kiko
June 30, 2016

ParT abstraction

Presentation for OPLSS (Oregon Programming Language Summer School) where I explained how the ParT abstraction works. This presentation includes an introduction to the Encore language, how the actor model (with futures) work in Encore and a brief explanation of the ParT abstraction with a SAT-solver follow-along example.

Avatar for Kiko

Kiko

June 30, 2016
Tweet

More Decks by Kiko

Other Decks in Research

Transcript

  1. Pre-ParT: Encore Encore threads Tasks … Futures ParT Standard Library

    Concurrent GC Actors Work stealing PonyRT EncoreRT Compiler: Haskell RunTime: C def main(): void let w = new World in { w.add( …) } .enc 0001100011110 101010011001 executable
  2. Actors ↝ :: Fut t → (t → t’) →

    Fut t’ Asynchronous Yes
  3. ParT: Basic Idea Bunch Futures & values • How can

    we create non-blocking complex parallel coordination patterns? • What about speculative computations?
  4. ParT & combinators Abstraction that encapsulate parallel and asynchronous computations

    Functional data structure Async Parallel Combinators to control the abstraction Automatically kill-off computations (when not needed) [Combinators borrowed from Orc]
  5. Example Parallel Portfolio-based SAT solver Goal: is a Formula satisfiable

    or not? Input: Array of Strategies, Formula, Assignment Output: Maybe Assignment
  6. Example [Strategies] each( ( ParT >>= closure each: [t] →

    Par t λ strategy: Strategy → solve(strategy, formula, assignment) Formula Assignments >>= :: Par t → (t → Par t’) → Par t’
  7. Example [Strategies] each( ( ParT solve each: [t] → Par

    t >>= :: Par t → (t → Par t’) → Par t’ solve solve (strategy, formula, assignment)
  8. Example [Strategies] each( ( ParT solve each: [t] → Par

    t >>= :: Par t → (t → Par t’) → Par t’ solve solve Strategy 1. Take variable 2. Split variable (strategy, formula, assignment)
  9. Example solve (t → Par t’) → Par t’ solve

    solve Strategy Take variable Split variable
  10. Example solve (t → Par t’) → Par t’ solve

    solve Strategy Take variable Split variable Split variable: v1 = ( v, ) v2 = (v, ) {evalFormula(…, v1)} false true evalFormula :: … → (Maybe Bool, Assignment) { • } :: t → Par t
  11. Example solve (t → Par t’) → Par t’ solve

    solve Strategy Take variable Split variable Split variable: v1 = ( v, ) v2 = (v, ) {evalFormula(…, v1)} || {evalFormula(…, v2)} false true evalFormula :: … → (Maybe Bool, Assignment) { • } :: t → Par t
  12. Example solve (t → Par t’) → Par t’ solve

    solve Strategy Take variable Split variable Split variable: v1 = ( v, ) v2 = (v, ) {evalFormula(…, v1)} || {evalFormula(…, v2)} false true evalFormula :: … → (Maybe Bool, Assignment) { • } :: t → Par t || :: Par t → Par t → Par t
  13. Example solve (t → Par t’) → Par t’ solve

    solve Strategy Take variable Split variable Split variable: v1 = ( v, ) v2 = (v, ) {evalFormula(…, v1)} || {evalFormula(…, v2)} false true evalFormula :: … → (Maybe Bool, Assignment) { • } :: t → Par t || :: Par t → Par t → Par t || doesn’t spawn new tasks! It declares that these can be evaluated in parallel
  14. Example solve (t → Par t’) → Par t’ solve

    solve Strategy Take variable Split variable || :: Par t → Par t → Par t evalFormula evalFormula ||
  15. satisfiable? Example solve ) → Par t’ solve solve le

    e || :: Par t → Par t → Par t evalFormula evalFormula || satisfiable? :: (Maybe Bool, Assignment) → Par Assignment >>=
  16. satisfiable? Example solve ) → Par t’ solve solve le

    e || :: Par t → Par t → Par t evalFormula evalFormula || satisfiable? satisfiable? :: (Maybe Bool, Assignment) → Par Assignment >>= Nothing
  17. Example << function << :: (Fut (Maybe t) → Par

    t’) → Par t → Par t’ ParT
  18. Example << function ParT << :: (Fut (Maybe t) →

    Par t’) → Par t → Par t’
  19. Conclusions • Future: handle to an asynchronous computation • ParT:

    handle to a collection of parallel computations • Asynchronous combinators (compute on demand) • Kill-off speculative computations when not needed
  20. Future work • From prototype to fast implementation • Multiversioning

    compiler for Task-fusion • Cache-efficient scheduling • Type-based optimisations • Add rich set of (non-blocking) combinators (LinQ, Spark, MapReduce, etc)
  21. References • Fully concurrent garbage collection of actors on many-core

    machines (OOPSLA 2013) Sylvan Clebsch and Sophia Drossopoulou • Parallel Objects for Multicores: A Glimpse at the Parallel Language Encore. SFM 2015: 1-56 • Ownership and Reference Counting based Garbage Collection in the Actor World (ICOOOLPS 2015) Sylvan Clebsch, Sebastian Blessing, Juliana Franco, Sophia Drossopoulou • Reference Capabilities for Concurrency Control (ECOOP’16) Elias Castegren and Tobias Wrigstad • ParT: An Asynchronous Parallel Abstraction for Speculative Pipeline Computations (COORDINATION’16) Kiko Fernandez-Reyes, Dave Clarke, Daniel S. McCain • Kappa: Insights, Current Status and Future Work (IWAKO’16) Elias Castegren and Tobias Wrigstad • Towards Enabling Low-Level Memory Optimisations at the High-Level with Ownership Annotations (IWAKO’16) Juliana Franco, Tobias Wrigstad, Sophia Drossopoulou