verifying safety and accuracy of approximate parallel
play

Verifying Safety and Accuracy of Approximate Parallel Programs via - PowerPoint PPT Presentation

Verifying Safety and Accuracy of Approximate Parallel Programs via Canonical Sequentialization Vimuth Fernando , Keyur Joshi, Sasa Misailovic University of Illinois at Urbana-Champaign CCF-1629431 CCF-1703637 CCF-1846354 Compression


  1. Verifying Safety and Accuracy of Approximate Parallel Programs via Canonical Sequentialization Vimuth Fernando , Keyur Joshi, Sasa Misailovic University of Illinois at Urbana-Champaign CCF-1629431 CCF-1703637 CCF-1846354

  2. Compression

  3. Compression Skip communication

  4. Compression Low energy (noisy) Skip communication

  5. How safe is the program? Approximate program should not crash, get stuck, or produce unacceptable results How accurate are the results? Approximate program should produce results with acceptable accuracy/ reliability

  6. • Types – Non-interference of approximate and precise data [Sampson et al. 2011] Safety after approximations • Relative safety - Transfer reasoning about original program to approximate programs [Carbin et al. 2012] • Reliability - probability of getting the correct result [Carbin et al. 2013] Accuracy after approximations • Accuracy – combines reliability with distance from correct result [Misailovic et al. 2014]

  7. How do we proceed? • Types – Non-interference of approximate and • Completely new versions of precise data [Sampson et al. 2011] all analyses? • Relative safety - Transfer reasoning about original program to approximate programs [Carbin et al. 2012] • Reliability - probability of getting the correct result [Carbin et al. 2013] • Accuracy – combines reliability with distance from correct result [Misailovic et al. 2014]

  8. Approximate Parallel Program … Existing Sequential Analysis

  9. Approximate Parallel Program Canonical Sequentialization Existing Approximate Sequential Sequential Program Analysis

  10. How do we express parallel Approximate Parallel approximations? Program How to enforce and verify safety/accuracy properties? Existing Approximate Sequential Under what conditions will the Sequential Program existing analyses apply? Analysis

  11. Parallely! Language with support for modeling parallel approximations • Software-level approximation • Environment-level noise Verification of safety and accuracy using canonical sequentialization • Type-safety (Non-Interference) • Deadlock-freeness • Relative safety • Reliability • Accuracy • And more

  12. Programs in Parallely Asynchronous distributed message passing processes Two types of data : precise and approx. Communicates through typed channels a = receive(0, precise int) send(1, precise int, input) || 0: 1 : result = computation(a) out = receive(1, approx int ) send(0, approx int , result)

  13. Programs in Parallely a = receive(0, precise int) send(1, precise int, input) || 0: 1 : result = computation(a) out = receive(1, approx int ) send(0, approx int , result)

  14. Programs in Parallely a = receive(0, precise int) send(1, precise int, input) || 0: 1 : result = computation(a) out = receive(1, approx int ) send(0, approx int , result) Two processes

  15. Programs in Parallely a = receive(0, precise int) send(1, precise int, input) || 0: 1 : result = computation(a) out = receive(1, approx int ) send(0, approx int , result) Parallel

  16. Programs in Parallely a = receive(0, precise int) send(1, precise int, input) || 0: 1 : result = computation(a) out = receive(1, approx int ) send(0, approx int , result)

  17. Symmetric Process Groups Group of processes for q in Q: a = receive(0, precise int) send(q, precise int, input) || 0: ෑ 𝑟: 𝑅: result = computation(a) for q in Q: send(0, precise int, result) out[q] = receive(q, precise int) Iteration over a group of processes

  18. Symmetric Non-determinism All receive statements have a unique matching send statement [Bakst et al. OOPSLA 2017]

  19. Map-Reduce Pattern for q in Q: a = receive(0, precise int) send(q, precise int, input) || 0: ෑ 𝑟: 𝑅: result = computation(a) for q in Q: send(0, precise int, result) out[q] = receive(q, precise int)

  20. Communication Patterns easily expressible in Parallely Map Scatter/Gather Reduce Stencil Scan Partition Covers all the patterns in [M. Samadi, D. A. Jamshidi, J. Lee, and S. Mahlke. 2014. Paraprox: Pattern-based Approximation for Data Parallel Applications. In ASPLOS. ​]

  21. Approximation Primitives – Probabilistic Choice input = val [p] randVal() p 1 - p input val input randVal()

  22. Approximation Primitives – Probabilistic Choice input = val [p] randVal() • Low energy channels that may corrupt the data being transmitted input = val [p] randVal() 0: || 1 : a = receive(0, approx int) send(1, approx int, input)

  23. Approximation Primitives- Precision Conversion • Casting to reducing the precision of data that has primitive numeric types sVal = ( approx float32) val • Communicate in low precision tmp = receive(0, approx float32) sVal = ( approx float32) val 0: || 1 : a = ( approx float64) tmp send(1, approx float32, sVal)

  24. Approximation Primitives – Conditional Communication 0: cond-send( condition , 1, approx int, data) 1: flag, a = cond-receive(0, approx int) condition = True condition = False flag True flag False a data a a

  25. Approximation Primitives – Conditional Communication 0: cond-send( condition , 1, approx int, data) 1: flag, a = cond-receive(0, approx int) • Skip sending some data skip = 1 [0.99] 0 || 1 : flag, a = cond-receive(0, approx int) 0: cond-send(skip, 1, approx int, data)

  26. What approximations can be modelled with Parallely • Failing tasks – probabilistic-choice + conditional communication • Noisy channel – probabilistic-choice • Precision reduction – casting • Memoization – probabilistic-choice + conditional communication • Approximate reduce – probabilistic-choice + conditional communication • Loop perforation – probabilistic-choice

  27. How do we analyze Parallely programs? Approximate Parallel Program Canonical Sequentialization Existing Approximate Sequential Sequential Program Analysis

  28. Canonical Sequentialization (Bakst et al. OOPSLA 2017) Generate an equivalent sequential program using rewriting Works for programs with symmetric nondeterminism We show how sequentialization works for Conditional Communication Probabilistic choice Casting cond-send (b, tid, type, val) x = y [p] z x = (float32) y

  29. Sequentialization through rewrites Parallel program ; || || 𝑄 𝑄 seq 𝑄 0 1 1 𝑄 0 Remaining parallel program Sequential prefix

  30. Sequentialization through rewrites Parallel program ; || || 𝑄 𝑄 seq 𝑄 0 1 1 𝑄 0 ; ; || 𝑄 𝑄 1 0

  31. Sequentialization through rewrites Parallel program ; || || 𝑄 𝑄 seq 𝑄 0 1 1 𝑄 0 * ; ; ; ; ; || 𝑄 𝑄 1 0

  32. Generating a Canonical Sequentialization input = readData() a = receive(0, precise int) 0: || 1 : result = computation(a) send(1, precise int, input) cond = 1 [0.99] 0 pass, out = cond-receive(1, precise int) cond-send(cond, 0, precise int, result) input = readData() a = input result = computation(a) cond = 1 [0.99] 0 pass = cond out = cond ? result : out

  33. Rewrite Soundness – Intuition Parallel program || || 1 𝑄 𝑄 2 0 1 S

  34. Rewrite Soundness – Intuition Parallel program * || State 𝑄 𝑄 0 1 S

  35. Rewrite Soundness – Intuition Parallel program * || State 𝑄 𝑄 0 1 * State’ S

  36. Rewrite Soundness – Intuition Parallel program * || State 𝑄 𝑄 0 1 For halted processes * State’ S

  37. Non-Interference • Set of type rules that block explicit and implicit flows in each individual process approx precise precise approx • Typed channels and sequentialization detects illegal flows across process boundaries || 0: 1 : send(1, approx int, result) out = receive(0, precise int)

  38. Relative Safety Approximate Parallel program Parallel program || || 𝐵 𝐵 𝑄 𝑄 𝑄 𝑄 0 0 1 1 If the original program satisfies a property , then the transformed program also satisfies that property

  39. Relative Safety Parallel program Approximate Parallel program || || 𝐵 𝐵 𝑄 𝑄 𝑄 𝑄 0 1 0 1 𝑇 𝐵 𝑇 We can use the sequentialized programs to prove relative safety for process local safety property

  40. Program type checks No Deadlocks (Bakst et al. OOPSLA 2017) Non-interference There is a canonical Relative safety sequentialization

  41. Reliability/Accuracy analysis Reliability – Probability that an approximate execution produces the same result as an exact one Accuracy – Probability that an approximate execution produces a result close to an exact one

  42. Reliability/Accuracy analysis Parallel program || 1 2 Sequential S Analysis

  43. Reliability/Accuracy analysis Parallel program || 1 2 Sequential S Analysis

  44. Rewrite Equivalence Parallel program || 𝑄 𝑄 0 1 p Final State p S

  45. Rewrite Soundness Parallel program Final * || 𝑄 𝑄 0 1 State For halted processes Final * S State’

  46. Rewrite Equivalence Parallel program Final * || 𝑄 𝑄 0 1 State For halted processes Final * S State’

  47. Rewrite Equivalence Parallel program p Final * || 𝑄 𝑄 0 1 State For halted processes p Final * S State’

Recommend


More recommend