Dancing with Uncertainty

405 views
336 views

Published on

Presentation by Sasa Misailovic.
Paper and more information: http://soft.vub.ac.be/races/paper/dancing-with-uncertainty/

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
405
On SlideShare
0
From Embeds
0
Number of Embeds
209
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Dancing with Uncertainty

  1. 1. Dancing WithUncertaintySašaMisailovićSteliosSidiroglouMartinRinardMIT CSAIL
  2. 2. ExampleWater: Simulates system of water moleculesHHOHHOHHOHHOHHOHHOHHO
  3. 3. ExampleWater: Simulates system of water moleculesHHOHHOHHOHHOHHOHHOHHO
  4. 4. ExampleWater: Simulates system of water moleculesHHOHHOHHOHHOHHOHHOHHO
  5. 5. ExampleWater: Simulates liquid water moleculesHHOHHOHHOHHOHHOHHOHHO
  6. 6. ExampleWater: Simulates system of water moleculesHHOHHOHHOHHOHHOHHOHHO
  7. 7. ExampleWater: Simulates system of water moleculesHHOHHOHHOHHOHHOHHOHHO
  8. 8. DubstepExplores the effects ofselectively removingsynchronization
  9. 9. Dubstep Highlights1. Removing locks and opportunisticbarrierstrade accuracy for performance2. Automatically explores the tradeoffspace induced by candidatetransformations3. Uses statistical analysis to characterizeimpact of transformations on accuracy
  10. 10. Dubstep WorkflowPrepareFindTransformAnalyzeNavigate
  11. 11. Dubstep WorkflowPrepareFindTransformAnalyzeNavigate1. Prepare representative inputs2. Prepare accuracy model– Output abstraction (importantparts of output)– Accuracy bound (amount oftolerable error)
  12. 12. Dubstep WorkflowPrepareFindTransformAnalyzeNavigateLoops with parallel constructs• Profiling: performance &memory
  13. 13. Dubstep WorkflowPrepareFindTransformAnalyzeNavigateLoops with parallel constructs• Profiling: performance &memoryInterf (56.4%) Poteng (43.4%)
  14. 14. Dubstep WorkflowRemoving synchronizationPrepareFindTransformAnalyzeNavigatevoid scratchPad::updateForces(double R[3][3]) {mutex_lock(this->lock);this->H1force.vecAdd(R[0]);this->Oforce.vecAdd(R[1]);this->H2force.vecAdd(R[2]);mutex_unlock(this->lock);}
  15. 15. Dubstep WorkflowRemoving synchronizationPrepareFindTransformAnalyzeNavigatevoid scratchPad::updateForces(double R[3][3]) {mutex_lock(this->lock);this->H1force.vecAdd(R[0]);this->Oforce.vecAdd(R[1]);this->H2force.vecAdd(R[2]);mutex_unlock(this->lock);}
  16. 16. Dubstep WorkflowRemoving synchronizationPrepareFindTransformAnalyzeNavigatevoid scratchPad::updateForces(double R[3][3]) {this->H1force.vecAdd(R[0]);this->Oforce.vecAdd(R[1]);this->H2force.vecAdd(R[2]);}
  17. 17. Dubstep WorkflowOpportunistic barriersPrepareFindTransformAnalyzeNavigatevoid ensemble::interf(){parallel_for(interf_body, 0, NumMol-1);}
  18. 18. Dubstep WorkflowOpportunistic barriersPrepareFindTransformAnalyzeNavigatevoid ensemble::interf(){parallel_for(interf_body, 0, NumMol-1);}
  19. 19. Dubstep WorkflowOpportunistic barriersPrepareFindTransformAnalyzeNavigatevoid ensemble::interf(){parallel_for(interf_body, 0, NumMol-1);}• Schedule threads• Execute interf_body in parallel• Wait for all threads to complete
  20. 20. Dubstep WorkflowOpportunistic barriersPrepareFindTransformAnalyzeNavigatevoid ensemble::interf(){parallel_for*(interf_body, 0, NumMol-1);}• Schedule threads• Execute interf_body in parallel• Wait for half of threads tocompleteInstruct remaining threads to stop[Rinard, OOPSLA 2007]
  21. 21. Dubstep WorkflowAnalyze transformed program:• Criticality– Memory safety, integrity• Performance– Speedup comparison• Accuracy– Statistical analysisPrepareFindTransformAnalyzeNavigate
  22. 22. Dubstep WorkflowPrepareFindTransformAnalyzeNavigatecInputOriginalProgram OutputOutput Abstraction(Application-Specific)TransformedProgramDifference Boundδ<
  23. 23. Dubstep WorkflowNavigate the tradeoff space:• Transform and analyze onelocation at a time– 3 locations in water• Transform multiple locationsin the same candidateprogram– Guided by the results of theprevious stepPrepareFindTransformAnalyzeNavigate
  24. 24. Search Space Exploration11.051.11.151.21.250 0.02 0.04 0.06Average Accuracy Loss vs. SpeedupLI BIBRLI+BILI+BPBI+BPLI+BI+BPRelativeSpeedupAccuracylossLI – Synchronization InterfBI – Barrier InterfBP – Barrier PotengBaseline: original parallel program runs6.2 times faster than sequential on 8 cores
  25. 25. Search Space Exploration11.051.11.151.21.250 0.02 0.04 0.06Average Accuracy Loss vs. SpeedupLI BIBRLI+BILI+BPBI+BPLI+BI+BPRelativeSpeedupAccuracylossLI – Synchronization InterfBI – Barrier InterfBP – Barrier PotengHow confident can we beabout these observations?Baseline: original parallel program runs6.2 times faster than sequential on 8 cores
  26. 26. Execution ReliabilityThe probability p that the transformedprogram on the given input producesthe result with error less than bound δWhile we cannot model p, we canspecify minimum acceptable reliability r
  27. 27. Execution ReliabilityDetermine if program’s reliability p > r
  28. 28. Execution ReliabilityDetermine if program’s reliability p > rHow to pick N?
  29. 29. How Many Runs AreEnough?Procedure that determines that p > r :• Returns correct resultmost of the time– Wrong decision rate – Tolerance region • Quickly determinesextreme (very goodor bad) transformations
  30. 30. Statistical AnalysisSequential Probability Ratio Test
  31. 31. Statistical AnalysisSequential Probability Ratio Test
  32. 32. Statistical AnalysisSequential Probability Ratio TestBound (δ)BestTransformation0.01 LI0.05 LI0.10 LI+BI+BR0.15 LI+BI+BR
  33. 33. Statistical AnalysisSequential Probability Ratio TestBound (δ)BestTransformation0.01 LI0.05 LI0.10 LI+BI+BR0.15 LI+BI+BR
  34. 34. Exploring Tradeoff SpaceStart: Sequential program withfor loopsTransformations:• Parallel loop introduction• Synchronization, ReplicationQuickstep[MIT-TR-2010-38, TECS/PEC 2012]PrepareFindTransformAnalyzeNavigate
  35. 35. Exploring Tradeoff SpaceStart: Program with for loopsTransformations:• Skip loop iterations(multiple forms)Loop Perforation[ICSE 2010, ONWARD 2010, SAS 2011,FSE 2011]PrepareFindTransformAnalyzeNavigate
  36. 36. Exploring Tradeoff SpaceStart: Program with commandline parametersTransformations:• Alternate function versionsactivated by CL parametersDynamic Knobs[ASPLOS 2011]PrepareFindTransformAnalyzeNavigate
  37. 37. Exploring Tradeoff SpaceStart: Program is a tree ofMap-Reduce type tasksTransformations:• Function Substitution• Reduction SamplingNapRed[POPL 2012]PrepareFindTransformAnalyzeNavigate
  38. 38. Exploring Tradeoff SpaceStart: Parallel program withfor loopsTransformations:• Removing Locks• Opportunistic BarriersDubstep[Today: RACES 2012]PrepareFindTransformAnalyzeNavigate
  39. 39. Reasoning AboutAccuracyExploring levels ofaccuracy guarantees:• Logic-based• Probabilistic• Statistical• EmpiricalPrepareFindTransformAnalyzeNavigate

×