Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour Sorin Manolache ESLAB, IDA Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour Outline Introduction , , Analysis and optimisation Stochastic task execution times Applications implemented on NoC with unreliable network links Conclusions S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 2 Embedded Systems Computing systems encapsulated in the device they control Dedicated function, perform pre-defined tasks Resource constrained: Time Power consumption Memory Size, cost S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 3 System Design Flow Informal specification Functional simulation Formal verification Modelling Architecture selection System model System architecture Mapping Estimation Scheduling ok ok Mapped and scheduled model ok Simulation Formal verification Analysis Lower levels of design S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 4 Specification Informal specification Functional ”Baseband processing for a multi-standard simulation base station in a mobile Formal communication verification Modelling Architecture selection System model network” System architecture Mapping Estimation Scheduling Mapped and ok scheduled model ok ok Lower levels of design Simulation Formal verification Analysis Analogy: “One-floor, three-bedroom, twobathroom house” S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 5 Modelling Informal specification Functional simulation Formal verification Modelling Architecture selection System model System architecture Mapping Estimation Scheduling Mapped and ok scheduled model ok ok Lower levels of design Functionality is partitioned in communicating processes. Expressed as a set of task graphs, or process algebra, or SystemC, VHDL etc. specifications. Simulation Formal verification Analysis Analogy: Blue-prints of the house, expressed in e.g. AutoCAD S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 6 Architecture Selection Informal specification Functional Selecting the set of resources (processors, simulation buses) Formal verification Modelling Architecture selection System model System architecture Mapping Estimation Scheduling Mapped and ok scheduled model ok ok Lower levels of design Simulation Analogy: selecting the Formal professions needed to verification build a house Analysis (bricklayer, carpenter, unspecialised workers, civil engineer) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 7 Functionality Mapping Informal specification Functional Assigning tasks to processors and simulation messages to buses or Formal links verification Modelling Architecture selection System model System architecture Mapping Estimation Scheduling Mapped and ok scheduled model ok ok Lower levels of design Simulation Formal verification Analogy: assigning jobs to persons (foundation Analysis dug by unspecialised workers, roof structure built by carpenters) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 8 Task Scheduling Informal specification Functional Specifying when the tasks are executed simulation Formal verification Modelling Architecture selection System model System architecture Mapping Estimation Scheduling Mapped and ok scheduled model ok ok Lower levels of design Simulation Analogy: specifying that the construction of the Formal walls starts after the verification foundation has been Analysis laid, and that the roof is to be built after the walls have been erected S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 9 Outline Introduction Systems Real-time Stochastic behaviour Analysis and optimisation Stochastic task execution times Applications implemented on NoC with unreliable network links Conclusions S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 10 Real-Time Correctness defined not only in terms of functionality but also in terms of timeliness E.g. Deadlines, jitters, periods Analogy: House must be ready on the 30th of June S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 11 Hard vs. Soft Real-Time Hard real-time systems Soft real-time systems Missing a deadline is not tolerated Occasionally missing a deadline is not desired but accepted Their analysis provides yes/no answers Their analysis provides feasibility degrees Construction of the worst-case scenario Construction of a multitude of scenarios with associated likelihood S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 12 probability density Hard vs. Soft Real-Time Fast and expensive WCET deadline response time Slow but inexpensive deadline WCET response time S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 13 Outline Introduction Systems Real-time Stochastic behaviour Analysis and optimisation Stochastic task execution times Applications implemented on NoC with unreliable network links Conclusions S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 14 Execution Time Variability Execution time depends on: Input data MPEG-encoded motion-intensive video clips require more processing than videos surveying the night sky Features and dynamic state of the architecture Cache memories, branch predictions, pipeline bubbles Environment Component unreliability Network congestion S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 15 Execution Time Model probability density Task execution time is more realistically described by an execution time probability distribution computation time S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 16 Outline Introduction Systems Real-time Stochastic behaviour Analysis and optimisation Stochastic task execution times Applications implemented on NoC with unreliable network links Conclusions S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 17 Formulation of the Analysis Problem Probability 2s Task graphs Task periods Task execution time 2s 4s probability densities Deadlines 6s Processors, buses, interconnects 10s Mapping and scheduling policy Late task policy 10s Time S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 18 Formulation of the Analysis Problem Determine the expected deadline miss ratio for each task and task graph S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 19 Formulation of the Optimisation Problem Probability 2s Task graphs Task periods Task execution time 2s 4s probability densities Deadlines and miss thresholds 6s Processors, buses, miss 4% interconnects 10s Fixed priority scheduling Late task policy 10s Time miss 2% miss 10% S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 20 Formulation of the Optimisation Problem Find a task mapping and priority assignment such that the deviation of the expected deadline miss ratios from the imposed thresholds is minimised S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 21 Limitations of Previous Work Exponentially distributed execution time probability distributions Monoprocessor systems No data dependencies among the tasks Specific assumptions such as the existence of servers, admission control mechanisms, processor load close to one, FIFO scheduling policy Complexity makes that often only unrealistically small systems are amenable to analysis S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 22 Contributions to the Analysis Problem Generalised task execution time probability distributions functions Any widely used scheduling policy Generous assumptions regarding The applications (periods, deadlines, dependencies, no special treatment of soft tasks etc.) The hardware platform (multiprocessor systems, no restrictions on the interconnections between processors) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 23 Contributions to the Analysis Problem 1. Approach giving exact deadline miss ratios Efficient for monoprocessor systems While applicable to multiprocessor systems, its application is limited by complexity issues 2. Approach giving approximations of the deadline miss ratios Applicable to multiprocessor systems Too slow to be put inside a design optimisation loop 3. Fast approximate approach Fast enough to be put inside optimisation loops S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 24 Exact Approach The deadline miss ratios are obtained by constructing and analysing the stochastic process underlying the application Two approaches to manage complexity Clustering of individual completion times into time intervals Concurrent construction and analysis of the stochastic process S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 25 Clustering of Completion Times p=d=3 A p=d=5 B Earliest deadline first, non-preemptive execution A, 0, {B} B, [0, 3), B,{}t1, {} B, t0, {} 0 t0 t1 3 tk tk+1 5 [3, 5), {A} B, tkB, , {A} 6 9 10 B, tk+1, {A} 12 S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 15 26 Concurrent Construction and Analysis [0, 3) [3, 5) [5, 6) [6, 9) [9, 10) [10, 12) [12, 15) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 27 Size(Number of Tasks) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 28 Sliding Window Size(Number of Tasks) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 29 Contributions to the Analysis Problem 1. Approach giving exact deadline miss ratios Efficient for monoprocessor systems While applicable to multiprocessor systems, its application is limited by complexity issues 2. Approach giving approximations of the deadline miss ratios Applicable to multiprocessor systems Too slow to be put inside an design optimisation loop 3. Fast approximate approach Fast enough to be put inside optimisation loops S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 30 Approximate Approach Relies upon the analysis of a continuous-time Markov chain that approximates the stochastic process underlying the application Two approaches to manage complexity: The generalised execution time probability distribution functions are approximated by Coxian distributions, i.e. weighted sums of convoluted exponentials Structural properties of the Markov chain are exploited for low-memory analysis S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 31 Probability density Coxian Approximation Real density P( s ) Q( s ) Computation time Find and such that r j i i 1 G ( s) i (1 j ) s i j 1 s j i 1 S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 32 CTMC Construction X, Y X, Y GSMP X CTMC approximating the GSMP S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 33 CTMC Construction The global generator of the Markov chain becomes then M ( Aj ) I jen ( I j ) Bi ( I j ) D j ien j i , jen j i , jen M is expressed in terms of small matrices and can be generated on the fly – memory savings S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 34 Analysis Time(Number of Tasks) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 35 Analysis Time(Number of Processors) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 36 Accuracy Accuracy vs analysis complexity compared to the exact approach for monoprocessors Stages Relative error 2 3 4 8.7% 4.1% 1.04% 5 0.4% S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 37 Contributions to the Analysis Problem 1. Approach giving exact deadline miss ratios Efficient for monoprocessor systems While applicable to multiprocessor systems, its application is limited by complexity issues 2. Approach giving approximations of the deadline miss ratios Applicable to multiprocessor systems Too slow to be put inside an design optimisation loop 3. Fast approximate approach Fast enough to be put inside optimisation loops S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 38 Fast Approximate Analysis Task completion times are expressed as functions of task start times and execution times The probability distributions of completion times are approximated by considering some weakly dependent random variables as independent Polynomial analysis time S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 39 Fast Approximation Exponential, =1/7s-1 A Fixed, 0.5s Fixed, 4s C Exponential, =1/2s-1 B E Fixed, 6s Highest priority D Fixed, 5s Lowest priority S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 40 Fast Approximation S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 41 Formulation of the Optimisation Problem Find a task mapping and priority assignment such that the deviation of the expected deadline miss ratios from the imposed thresholds is minimised S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 42 Deadline Miss Ratio Minimisation System model System platform Mapping Priority assignment ok Fast approximate analysis Mapped and scheduled model ok S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 43 Deadline Miss Ratio Minimisation Stochastic task execution times Average task execution times Use a heuristic for task mapping and priority assignment Use the same heuristic for task mapping and priority assignment Drive the heuristic by an analysis that considers the average task execution times and minimises task response time Apply the same deadline miss ratio analysis on the design obtained by the heuristic Drive the heuristic by the fast analysis that considers stochastic task execution times and minimises deadline miss ratios Apply a deadline miss ratio analysis on the design obtained by the heuristic The deadline miss ratio deviation from the imposed thresholds is one order of magnitude larger in the case of average task execution times S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 44 Outline Introduction Systems Real-time Stochastic behaviour Analysis and optimisation Stochastic task execution times Applications implemented on NoC with unreliable network links Conclusions S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 45 Transient Faults Technological advances increased miniaturisation of integrated circuits higher packing density more functionality decreased cost and power consumption per transistor But… Increased total power consumption Appearance of submicron effects, leakage power, crosstalk, interference Increased vulnerability to transient faults S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 46 NoC Networks-on-chip Links may fail temporarily with known probability S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 47 Problem Formulation Communication synthesis, i.e. mapping of messages to network links and setting their release times such that: Reliable communication (message arrival probability above an imposed threshold) Satisfaction of timeliness constraints Satisfaction of communication buffer constraints or buffer space minimisation Minimisation of communication energy consumption S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 48 Solution Outline 1. Reliable communication Combination of temporally and spatially redundant communication while keeping energy overhead at minimum 2. Satisfaction of timeliness constraints Based on a worst-case timing analysis 3. Satisfaction of buffer space constraints Based on a worst-case buffer space analysis 4. Strategy to explore the set of possible message mappings S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 49 Communication Supports MAP=0.941<0.99 ECE~5.851 MAP=0.999>0.99 ECE~11.997 MAP=0.998>0.99 ECE~11.935 S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 50 Communication Supports Communication synthesis problem means selecting one communication support for each message Search problem in the space of communication supports Too large a search space search too slow Too small a search space low quality result Build the search space with only “good” communication support candidates S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 51 Communication Supports S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 52 Latency(Number of Tasks) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 53 Latency(MAP) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 54 Solution Outline 1. Reliable communication Combination of temporally and spatially redundant communication while keeping energy overhead at minimum 2. Satisfaction of timeliness constraints Based on a worst-case timing analysis 3. Satisfaction of buffer space constraints Based on a worst-case buffer space analysis 4. Strategy to explore the set of possible message mappings S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 55 Buffer Space Minimisation Problems Communication synthesis with extended objective: Application specific NoCs: the total amount of buffering space used by the application at the switches should be minimised Predefined buffer space: synthesize the communication such that no buffer overflow occurs during the execution of the application S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 56 Buffer Space Minimisation System model System platform Buffer space analysis Communication mapping and Packet release time ok Mapped and Packet release scheduled model time ok S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 57 Buffer Space Minimisation S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 58 Buffer Space Constraints S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 59 Conclusions Schedulability analysis of real-time systems with stochastic task execution times 1. Exact method, efficient for monoprocessors 2. Approximate method, efficient for multiprocessors 3. Fast approximate method, may be used for optimisation Deadline miss ratio minimisation by means of task mapping and priority assignment Communication synthesis for NoC with unreliable links, under reliability, timeliness, buffer space, and energy constraints S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 60 Related Work L. Abeni and G. Buttazzo, “Integrating Multimedia Applications in Hard RealTime Systems”, 1998 A. Burns, G. Bernat, I. Broster, “A Probabilistic Framework for Schedulability Analysis”, 2003 J. L. Diaz et al., “Stochastic Analysis of Periodic Real-Time Systems”, 2002 M. K. Gardner, “Probabilistic Analysis and Scheduling of Critical Soft Real-Time Systems”, 1999 X.S. Hu, T. Zhou, E. H.-M. Sha, “Estimating Probabilistic Timing Performance for Real-Time Embedded Systems”, 2001 J. Kim and K. G. Shin, “Execution Time Analysis of Communicating Tasks in Distributed Systems”, 1996 A. Kalavade, P. Moghe, “A Tool for Performance Estimation for Networked Embedded Systems”, 1998 J. Lehoczky, “Real Time Queueing Systems”, 1996 T. Tia et al., “Probabilistic Performance Guarantee for Real-Time Tasks with Varying Computation Times”, 1995 T. Zhou et al., “A Probabilistic Performance Metric for Real-Time System Design”, 1999 S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 61 Influence of Dependency Degree S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 62 Approximate Approach Task graphs Modelling Approximation GSPN Coxian distribs CTMC constr. CTMC Results Analysis S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 63 Fast Approximate Analysis A Z Y X Z Y X Z Y X P(AX t) = P(FY t) P(FZ t) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 64 Average vs. Probabilistic Execution Times S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 65 Latency Reduction(Communication Load) S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 66 Communication Supports S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 67 Buffer Space Analysis 0 15 27.5 35 S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 40 42.5 68 Coxian Approximation S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 69 Coxian Approximation 11 (11)1 22 33 (12)2 j i i 1 G ( s) i (1 j ) s i j 1 s j i 1 r S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 70 CTMC Construction X, Y X, Y X GSMP CTMC approximating the GSMP X Approximation of X S. Manolache, “Analysis and Optimisation of Real-Time Systems with Stochastic Behaviour” 71