310 likes | 498 Views
Rate Types for Stream Programs. Thomas W. Bartenstein Yu David Liu State University of New York (SUNY) at Binghamton. OOPSLA 2014. Data Intensive Applications. On the rise High-performance requirement. Motivating Question.
E N D
Rate Types for Stream Programs Thomas W. Bartenstein Yu David Liu State University of New York (SUNY) at Binghamton OOPSLA 2014
Data Intensive Applications • On the rise • High-performance requirement
Motivating Question Can program structures help understand and optimize performance of data-intensive software?
Performance Question 1 Is this data rate achievable and sustainable? ?
Performance Question 2 Given an Input data rate, what will the output rate be? ?
Performance Question 3 Given a desired output rate, what input rate is required? ?
Performance Question 4 Given unlimited Input data, how fast can the output rate be? ?
Rate Types A type system to reason about data rates in data intensive applications
Motivating Question Can program structures help understand and optimize data rate in data-intensive software? Stream Programming
Stream Programming Benefits • Friendliness to Big Data Applications • High Parallel EfficiencyTask Parallelism, Data Parallelism, and Pipelining • Programming Constructs Conducive to Data Oriented Analysis
Rate Types A type system to reason about data rates of stream programs
Stream Rate Insight Output Data rate depends on input data rate…
Stream Rate Insight … until …
Stream Rate Insight … input rate is faster than processing time; Output rate is proportional to processing time.
Input / Output Rate Graph Where does it plateau? What’s the slope?
Rate Types • Slope is the “throughput ratio” - • ratio between the output rate and input rate • Plateau is the “natural bound” - • output rate given unlimited input rate • Rate type is the tuple –
Input / Output Rate Graph ν = 3 θ = 1
Single Filter Type Check 3 2 filter time
Stream Programming: Combinators chain diamond circle
Chain Combination Type Check 2.5 PA PB 0.8 = 1.2
Diamond Combination Type Check 5 3 2 2.5 PA PB 1 2 3
Circle Combination Type Check 2.5 1 • Complicated because of feedback • Intuitively, inverted diamond • See paper for full details 1 2 PA PB 2 1 1
Data Rate Reasoning as a Typing Problem ? ? • Type Checking: • Type Inference: • Principal Typing: ? ?
Static/Dynamic Correspondence • Operational Semantics : Expressive & General • Supports Parallelism • Supports Arbitrary Schedules • No assumptions about synchronizing clocks • Soundness: if the type system says rate x can be achieved, a reduction sequence exists • Completeness: if the type system says rate x cannot be achieved, no reduction sequence with rate x exists
Rate Types Theoretical Results • Type inference is soundrelative to type checking • Type inference is completerelative to type checking • Principal typing exists
Implementation • StreamIt base • Calculate principal rate types • Control Input rate • Measure Output rate • Run benchmarks • 4 Micro-benchmarks • 6 StreamIt benchmarks • 200 input data rates • Graph Expected vs. Measured
Rate Types Generality • Potential Generalizations to Systems such as Aurora, Bamboo, StreamFlex,… • Limitations include… • Assumes declarative push and pop counts for filters • Assumes stable filter level profiling • Current/Future workincludes hybrid typing • handle dynamic fluctuations • improve adaptiveness
Summary Can program structures help understand performance of data-intensive software? • Rate Types: Unified solution to performance reasoning questions!