Probabilistic Real-Time Systems Liliana Cucu-Grosjean, INRIA Nancy-Grand Est liliana.cucu@inria.fr The results presented are joint work with PROARTIS partners / 3 Luxembourg June 9th, 202
Outline Probabilistic Real-Time Systems Probabilistic Worst-Case Execution Time Ø PROARTIS: measurement based approach Static probabilistic timing analysis Measurement based timing analysis Conclusion Luxembourg June 9th, 202 2
Model Probabilistic Real-Time Model Systems Model A periodic task τ i =(O i,c i,t i,d i ) is characterized by : periodic task release τ i =(O O i i,c i,t i,d i ) is characterized by : A periodic task τ release(worst-case) O i =(O i,c i,t i,d i ) is characterized by : i O i execution time C i (worst-case) (minimal) (worst-case) execution inter-arrival execution time time C i CT i i (minimal) deadline (minimal) inter-arrival Dinter-arrival i time time T i T i τ deadline deadline D =(,2,5,4) i D i τ =(,2,5,4) R τ 0 5 6 time Liliana 3 / 3 Cucu, Actriss - 0.03.20 3 Liliana Cucu, Actriss - 0.03.20 Luxembourg June 9th, 202 iliana Cucu, Actriss - 0.03.20
One processor, preemptive fixed-priority scheduling τ =(0,,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 τ =(0, τ i =(O i,c i,t i,d i ),3,3) τ 2 =(3, 5 6 2 τ 0.50.0.4 3 =(2, (0,,3,3) (3,2 (2, 7 8 Liliana Cucu, Actriss - 0.03.20 4 / 3 4 Luxembourg June 9th, 202
One processor, preemptive fixed-priority scheduling τ =(0,,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 τ =(0, τ i =(O i,c i,t i,d i ),3,3) τ 2 =(3, 5 6 2 τ 0.50.0.4 3 =(2, (0,,3,3) (3,2 (2, 7 8 Liliana Cucu, Actriss - 0.03.20 5 / 3 5 Luxembourg June 9th, 202
One processor, preemptive fixed-priority scheduling τ =(0,,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 τ =(0, τ i =(O i,c i,t i,d i ),3,3) τ 2 =(3, 5 6 2 τ 0.50.0.4 3 =(2, (0,,3,3) (3,2 (2, 7 8 Liliana Cucu, Actriss - 0.03.20 6 / 3 6 Luxembourg June 9th, 202
One processor, preemptive fixed-priority scheduling τ =(0,,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 τ =(0, τ i =(O i,c i,t i,d i ),3,3) τ 2 =(3, 5 6 2 τ 0.50.0.4 3 =(2, (0,,3,3) (3,2 (2, 7 8 Liliana Cucu, Actriss - 0.03.20 7 / 3 7 Luxembourg June 9th, 202
One processor, preemptive fixed-priority scheduling τ =(0, τ 2 =(3, 0.50.0.4 2 τ 3 =(2, Liliana Cucu, Actriss - 0.03.20 8 / 3 8,3,3) 0 5 6 7 8 9 0 τ =(0, τ i =(O i,c i,t i,d i ),3,3) τ 2 =(3, 5 6 2 τ 0.50.0.4 3 =(2, (0,,3,3) (3,2 (2, R = Luxembourg June 9th, 202 7 8
Probabilistic Probabilistic real-time analysis and systems real-time systems τ i =(O i,c i,t i,d i ) (O i,c i,t i,d i ) R i D i with the notation for the discret cas x X = k P(X = x k ) O i O i + T i time Uncertainties from the system and the environnement Probabilistic guarantees P(R i > D i ) < ε Liliana Cucu, Actriss - 0.03.20 9 / 3 9 Luxembourg June 9th, 202
τ =(0, What a schedule What a schedule looks like? looks like?,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 5 6 τ =(0, (O i,c i,t i,d i ),3,3) τ 2 =(3, 0.50.0.4 7 8 τ 3 =(2, (2, 2 Liliana Cucu, Actriss - 0.03.20 0 / 3 0 Luxembourg June 9th, 202
τ =(0, What a schedule What a schedule looks like? looks like?,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 5 6 τ =(0, (O i,c i,t i,d i ),3,3) τ 2 =(3, 0.50.0.4 7 8 τ 3 =(2, (2, 2 Liliana Cucu, Actriss - 0.03.20 / 3 Luxembourg June 9th, 202
τ =(0, What a schedule What a schedule looks like? looks like?,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 5 6 τ =(0, (O i,c i,t i,d i ),3,3) τ 2 =(3, 0.50.0.4 7 8 τ 3 =(2, (2, 2 Liliana Cucu, Actriss - 0.03.20 2 / 3 2 Luxembourg June 9th, 202
τ =(0, What a schedule What a schedule looks like? looks like?,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 5 6 τ =(0, (O i,c i,t i,d i ),3,3) τ 2 =(3, 0.50.0.4 7 8 τ 3 =(2, (2, 2 Liliana Cucu, Actriss - 0.03.20 3 / 3 3 Luxembourg June 9th, 202
τ =(0, What a schedule What a schedule looks like? looks like?,3,3) τ 2 =(3, 0.50.0.4 2 τ 3 =(2, 0 5 6 7 8 9 0 5 6 τ =(0, (O i,c i,t i,d i ),3,3) τ 2 =(3, 0.50.0.4 7 8 τ 3 =(2, (2, 2 Liliana Cucu, Actriss - 0.03.20 4 / 3 4 Luxembourg June 9th, 202
τ =(0, What a schedule What a schedule looks like? looks like? τ 2 =(3, 0.50.0.4 2 τ 3 =(2, Liliana Cucu, Actriss - 0.03.20 5 / 3 5,3,3) 0 5 6 7 8 9 0 5 6 τ =(0, (O i,c i,t i,d i ),3,3) τ 2 =(3, 0.50.0.4 R average Luxembourg June 9th, 202 7 8 τ 3 =(2, (2, 2 2 =6 2 =4 R worst case
Outline Probabilistic Real-Time Systems Probabilistic Worst-Case Execution Time Ø PROARTIS: measurement based approach Static probabilistic timing analysis Measurement based timing analysis Conclusion Luxembourg June 9th, 202 6
PROARTIS: Probabilistically Analysable Real-Time Systems http://proartis-project.eu/ The research leading to these results has received funding from the European Community's Seventh Framework Programme [FP7/2007-203] under grant agreement n 24900. www.proartis-project.eu
PROARTIS PROARTIS (3/3) 8 8 / 3 Luxembourg June 9th, 202
Outline Probabilistic Real-Time Systems Probabilistic Worst-Case Execution Time Ø PROARTIS: measurement based approach Static probabilistic timing analysis Measurement based timing analysis Conclusion Luxembourg June 9th, 202 9
SPTA* Static Probabilistic Timing Analysis The pwcet estimate is obtaining by convolving the ETPs of each instruction {(2, 3, 8, ), (0.2, 0.7, 0.05, 0.05)} 2 3 8 0.2 0.7 0.05 0.05 *ACM TECS 202 «Probabilistically analysable real-time systems» 20 Luxembourg June 9th, 202
SPTA/2: convolution and requirements Static Probabilistic Timing Analysis! # " 2 0.7 0.3 $! & ' # 7 % " $ & = %! # " + 7 2 + 7 ( 0.7 ( 0.3 $ & = %! # " 8 9 0.7 0.3 $ & % Requirements of SPTA Ø The convolution requires independent random variables Ø The ETPs must be defined by a single distribution Independent and identically distributed random variables 2 Luxembourg June 9th, 202
I.i.d. random variables Independent random variables Ø Random variables that describe events which are not related Ø Event A: my laptop died and Event B: the beamer does not like my laptop Identically distributed random variables Ø Random variables that have the same distribution function Ø Event A: arrival of a client in a bank and Event B: arrival of a car at a gas station Both properties checked through statistical tests 22 Luxembourg June 9th, 202
Required properties: Independence Data must be independent Ø Hypothesis testing with Wald-Wolfowitz test A parameter P is obtained to quantify how often consecutive execution times are higher/lower than the median If the data are random, P should fall in the central part of a Gaussian distribution Threshold (0.05) is chosen based on experience/common practice. P should fall in the central 95% part of the distribution P should be in this range 23 / 3 Luxembourg June 9th, 202
Required properties: Identically distributed Data must be identically distributed Ø Hypothesis testing with Kolmogorov-Smirnov test Two subsets of data randomly obtained from the trace Distributions compared. A parameter P obtained based on the maximum distance among both data sets If P is above a given threshold, data are identically distributed Threshold (0.05) is chosen based on experience/common practice Maximum distance Whole distribution Parameter P 24 / 3 Luxembourg June 9th, 202
SPTA: I.i.d. random variables Static Probabilistic Timing Analysis Ensured at the level of processor instructions Example: randomisation at cache level, evict on access Pathological eviction patterns are bounded pessimistically (N is the number of cache entries, K is the number of memory accesses between two consecutive accesses to the same cache entry) Ø Some numbers i for instruction cache, d for data cache Luxembourg June 9th, 202 25
Outline Probabilistic Real-Time Systems Probabilistic Worst-Case Execution Time Ø PROARTIS: measurement based approach Static probabilistic timing analysis Measurement based timing analysis Conclusion Luxembourg June 9th, 202 26
MBPTA*/ Measurement Based Probabilistic Timing Analysis The pwcet estimate is obtained by applying Extreme Value Theory *ECRTS 202 «Measurement based probabilistic timing analysis for multi-path programs» 27 Luxembourg June 9th, 202
MBPTA/2 Measurement Based Probabilistic Timing Analysis First sound utilisation of EVT to pwcet estimating Ø The hypothesis of independence and identical distribution is checked before any EVT utilisation I.i.d. hypothesis is ensured at the level of processor instructions Ø Block maxima applied with a proper definition of minimum number of runs Ø Utilisation of a (proven) correct statistical test to check that data belong to the Gumbel domain 28 Luxembourg June 9th, 202
Required properties: Gumbel Data must fit a Gumbel distribution Ø Hypothesis testing with exponential tail test A parameter P is obtained for the actual data A confidence interval CI is obtained for the actual data assuming it fits a Gumbel distribution If P belongs to CI then the data fit a Gumbel distribution Execution times 6372 3728 632 8328 823 9827 : : + Gumbel Confidence interval CI Parameter P 29 / 3 Luxembourg June 9th, 202
MBPTA/3 Steps of applying EVT (single-path programs) Ø Observations Ø Grouping Ø Fitting Ø Comparison Ø Tail extension Convergence Ø Continuous rank probability score EVT Observations More runs EVT Convergence criteria CRPS Gumbel Fitting (ET) I.i.d tests passed/not passed passed/not passed Luxembourg June 9th, 202 30
MBPTA/4 Measurement Based Probabilistic Timing Analysis Multi-path programs Ø Independent and identical distributions Identical distributions ensured by the convergence process Ø Minimum number of observations Each path must be observed a minimum number of times and it is ensured by the convergence process Ø Path coverage pwcet estimate is obtained for the observed paths Luxembourg June 9th, 202 3
Conclusions and future work SPTA offers a tight pwcet estimate, but impractical for complex programs MBPTA is a sound utilisation of EVT, but limited by the path coverage Ø Proof of the limited pessimism of EVT application Proposition of hybrid approaches Extending the probabilistic techniques proposed for the single-core case to the multi-core case Ø Identify the existing probabilistic techniques for multi-core Ø Ensure the requirements of the PROARTIS single-core Ø Modify accordingly the probabilistic techniques for the multi-core Luxembourg June 9th, 202 32