Statistical Statistical Statistical Model Statistical Model Model - - PowerPoint PPT Presentation

statistical statistical statistical model statistical
SMART_READER_LITE
LIVE PREVIEW

Statistical Statistical Statistical Model Statistical Model Model - - PowerPoint PPT Presentation

Statistical Statistical Statistical Model Statistical Model Model Checking Model Checking Checking Checking for Timed Automata Timed Automata Coll C l C ll b llabora orators: t ors: Peter Bulychev, Alexandre David Axel Legay, Marius


slide-1
SLIDE 1

Statistical Statistical Model Model Checking Checking Statistical Statistical Model Model Checking Checking for Timed Automata Timed Automata

C l C ll b t Coll llabora

  • rators:
  • rs: Peter Bulychev,

Alexandre David Axel Legay, Marius Mikucionis g y, Wang Zheng Jonas van Vliet, Danny Poulsen CAV 2011, PDMC CAV 2011, PDMC 2011, 2011, FORMAT FORMATS 2011 2011

slide-2
SLIDE 2

UPPAAL UPPAAL

A[] forall (i : id_t) forall (j : id_t) Train(i).Cross && Train(j).Cross imply i == j Safety E<> Train(0).Cross and Train(1).Stop Reachability ( ) ( ) p Train(0) Appr --> Train(0) Cross Liveness Train(0).Appr > Train(0).Cross A<> .. E[] .. sup: inf: Limited quantitative analysis sup: .. inf: .. Performance properties

Pr[ <> Time ≤ 500 and Train(0).Cross] ≥ 0.7 Pr[Train(0).Appr -->Time ≤ 100 Train(0).Cross] ≥ 0.4

ARTIST Design PhD School, Beijing, 2011 2

State-space explosion

slide-3
SLIDE 3

UPPAAL UPPAAL SMC SMC

P [ 200]( T i (5) C ) Performance properties Pr[ <= 200](<> Train(5).Cross) Pr[ <= 100](<> Train(0).Cross) >= 0.8 Pr[ <= 100](<> Train(5).Cross) >= Pr[ <= 100](<> Train(1).Cross) State-space explosion Generate runs Performance properties Generate runs

ARTIST Design PhD School, Beijing, 2011 3

State-space explosion

slide-4
SLIDE 4

Overview Overview

  • Statistical Model Checking in UPPAAL
  • Estimation
  • Testing
  • Distributed SMC for Parameterized Models

P S

  • Parameter Sweeps
  • Optimization
  • Nash Equilibria

q

  • Distributing Statistical Model Checking
  • Estimation
  • Testing
  • Testing
  • Parameter Analysis of DSMC
  • Conclusion

Conclusion

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Lars Kim Larsen [4] en [4]

slide-5
SLIDE 5

Overview Overview

  • Statistical Model Checking in UPPAAL

Statistical Model Checking in UPPAAL

  • Estimation
  • Testing
  • Distributed SMC for Parameterized Models

P S

  • Parameter Sweeps
  • Optimization
  • Nash Equilibria

q

  • Distributing Statistical Model Checking
  • Estimation
  • Testing
  • Testing
  • Parameter Analysis of DSMC
  • Conclusion

Conclusion

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Lars Kim Larsen [5] en [5]

slide-6
SLIDE 6

The Hammer Game The Hammer Game

Alex Alex Axel

Kim Lars Kim Larsen [6] en [6] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-7
SLIDE 7

Stochastic Semantics of TA Stochastic Semantics of TA

Uniform Distribution Exponential Distribution Input enabled Compositio Composition = n = Repeated races between components

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Lars Kim Larsen [7] en [7]

Input enabled Repeated races between components

slide-8
SLIDE 8

Stochastic Semantics of Stochastic Semantics of Timed Automata Timed Automata

g1 2 g2 s

D l D it F ti Delay Density Function μs: R→ R Output Probability Function

  • μs uniform on [ dmin, dmax]

p y γs: Σo→ [0,1]

  • γs uniform over enabled outputs

Kim Lars Kim Larsen [8] en [8] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-9
SLIDE 9

Pr[time<=2](<> T T3) ?

Stochastic Semantics of Stochastic Semantics of Timed Automata Timed Automata

Pr[time<=2](<> T.T3) ? Pr[C<=6](<> T.T3) ? Composition = Race between components p p for outputting

Kim Lars Kim Larsen [9] en [9] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-10
SLIDE 10

Stochastic Semantics of Stochastic Semantics of Timed Automata Timed Automata

Assumptions: Component TAs are:

  • Input enabled

D t i i ti

  • Deterministic
  • Disjoint set of output actions

π ( s a a a ) : π ( s , a1 a2 …. an ) : the set of maximal runs from s with a prefix t1 a1 t2 a2 … tn ak for some t1,…,tn ∈ R.

Kim Larsen [10] Kim Larsen [10] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-11
SLIDE 11

Logical Properties Logical Properties

Kim Larsen [11] Kim Larsen [11] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-12
SLIDE 12

SMC Algorithms in UPPAAL SMC Algorithms in UPPAAL

Quantitative (Estimation) Qualitative (Hypothesis Testing)

r Accept H

Quantitative (Estimation)

= ?

Qualitative (Hypothesis Testing)

Accept H1

1 1

Algorithm I: Probability Estimation α: prob of acc H0 when H1 β: prob of acc H1 when H0 Algorithm II: Sequential Probability Ratio Testing (Wald)

runs #

Algorithm II: Sequential Probability Ratio Testing (Wald)

Accept H0

Chernoff‐Hoeffding Bound Alternatives, e.g. Clopper‐Pearson

10 11

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [12] Kim Larsen [12]

10 11

slide-13
SLIDE 13

Queries in UPPAAL Queries in UPPAAL SMC SMC

Pr[ <= 200](<> Train(5).Cross)

++precision

ARTIST Design PhD School, Beijing, 2011 13

slide-14
SLIDE 14

Queries in UPPAAL Queries in UPPAAL SMC SMC

P [ 100]( T i (0) C ) 0 8 Pr[ <= 100](<> Train(0).Cross) >= 0.8 Pr[ <= 100](<> Train(0).Cross) >= 0.5

ARTIST Design PhD School, Beijing, 2011 14

slide-15
SLIDE 15

Queries in UPPAAL Queries in UPPAAL SMC SMC

P [ 100]( T i (5) C ) Pr[ <= 100](<> Train(5).Cross) >= Pr[ <= 100](<> Train(1).Cross) T<=100 Pr[<=T](<> Train(5) Cross) >= Pr[<=T](<> Train(5).Cross) >= Pr[<=T](<> Train(1).Cross)

ARTIST Design PhD School, Beijing, 2011 15

slide-16
SLIDE 16

Analysis Tool: Plot Composer Analysis Tool: Plot Composer

ARTIST Design PhD School, Beijing, 2011 16

slide-17
SLIDE 17

SMC in UPPAAL SMC in UPPAAL

  • Constant Slope Timed Automata
  • Clocks may have different (integer) slope in different

y ( g ) p locations.

  • Branching edges with discrete probabilities (weights).
  • Beyond Priced TA Energy TA Equal LHA in (non-

Beyond Priced TA, Energy TA. Equal LHA in (non stochastic) expressive power.

  • Beyond DTMC, beyond CTMC (with multiple rewards)
  • All features of UPPAAL supported
  • All features of UPPAAL supported
  • User defined functions and types
  • Expressions in guards, invariants, clock-rates, delay-

rates (rationals), and weights.

  • New GUI for plot-composing and exporting.

ARTIST Design PhD School, Beijing, 2011 17 17

slide-18
SLIDE 18

Case Studies Case Studies

FIREWIRE BLUETOOTH

DPA

18 18

LMAC

ARTIST Design PhD School, Beijing, 2011

slide-19
SLIDE 19

Benchmarking Benchmarking Duration Probabilistic Automata Duration Probabilistic Automata

ARTIST Design PhD School, Beijing, 2011 19 19

slide-20
SLIDE 20

Overview Overview

  • Statistical Model Checking in UPPAAL
  • Estimation
  • Testing
  • Distributed SMC for

Distributed SMC for Parameterized Models arameterized Models

P S

  • Parameter Sweeps
  • Optimization
  • Nash Equilibria

q

  • Distributing Statistical Model Checking
  • Estimation
  • Testing
  • Testing
  • Parameter Analysis of DSMC
  • Conclusion

Conclusion

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [20] Kim Larsen [20]

slide-21
SLIDE 21

UPPAAL UPPAAL & PDMC PDMC’05 ’05

PDMC’05 Gerd Behrman, Kim G Larsen

Architecture

GRID H t Cl

  • Het. Cl
  • Hom. Cl

1-CPU

Properties Modeling

10t 10th h International Workshop rnational Workshop on

  • n Parallel and

rallel and Distr Distributed ted Methods Methods in in verifi verifiCati tion Kim Larsen [21] Kim Larsen [21]

g Formalism

slide-22
SLIDE 22

UPPAAL UPPAAL & PDMC PDMC’11 ’11

Architecture

GRID

Alexandre David Axel Legay Marius Micusionis Jonas van de Vliet

H m Cl

Alexandre David Marius Micusionis

  • Hom. Cl.

1-CPU

Wang Zheng Peter Bulychev Kim G Larsen Danny Poulsen

Properties Modeling

10t 10th h International Workshop rnational Workshop on

  • n Parallel and

rallel and Distr Distributed ted Methods Methods in in verifi verifiCati tion Kim Larsen [22] Kim Larsen [22]

g Formalism

slide-23
SLIDE 23

Parameterized Models in Parameterized Models in UPPAAL UPPAAL

Exte Extend nded ed Sy Syntax ntax constants declared with a range are treated as parameter

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [23] Kim Larsen [23]

slide-24
SLIDE 24

Parameterized Analysis of Trains Parameterized Analysis of Trains

Pr[time<=100]( <>Train(0).Cross )

“Embarrassingly Parallelizable”

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [24] Kim Larsen [24]

slide-25
SLIDE 25

Lightweight ightweight Media edia Access ccess Control

  • ntrol
  • Problem domain:
  • communication
  • Initialization

Initialization (listen until a neighbor is heard)

  • Waiti

Waiting (delay a random

communication scheduling

  • Targeted for:
  • Waiti

Waiting (delay a random amount of time frames)

  • Discovery

Discovery (wait for entire frame and note used slots)

  • self-configuring

networks,

  • collision avoidance,
  • Active

Active

  • choose free slot,
  • use it to transmit, including

info about detected collisions

collision avoidance,

  • low power

consumption

A li i d i

  • listen on other slots
  • fallback to Discovery if

collision is detected

  • Only neighbors can detect
  • Application domain:
  • wireless sensor

networks

y g collision and tell the user- node that its slot is used by

  • thers

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [25] Kim Larsen [25]

slide-26
SLIDE 26

can_hear[id][aux_node] t==1 can_hear[id][aux_node] id!=0 id==0 initial t<=1 t<=1 curr=0, power[id]=SEND sendWM? sendWM? curr=slot_no[aux_node], power[id]=RECV, t=0 t=0, power[id]=LISTEN

adopted from A.Fehnker, L.v.Hoesel, A.Mader

initialization initialization

t==1 t<=1 t<=1 k:frame_t weight[k] counter=k*frame, t=0 curr=(curr+1)%frame, power[id]=SLEEP, t=0

added power

random wait random wait

..used UPPAAL to explore 4- and 5-node topologies and found cases with

can_hear[id][aux_node] t==2*counter listening0 waiting rec_one0 t<=2*counter t<=2 t<=2 sendWM? rec_vec=first[aux_node], first[id][curr]=1, counter=0, power[id]=LISTEN, t=0

topologies and found cases with perpetual collisions (8.000 MC problems)

counter<frame-1 t==2 && (col==slot_no[id] || (rec_vec[slot_no[id]] && !sent_info)) t==2 t==2 t==2 can_hear[id][aux_node] counter>=frame-1 t<=2 t 2 t<=2 done0 counter=0, curr=(curr+1)%frame, col=-1, detected=-1, curr=(curr+1)%frame, t=0 sendWM? curr=(curr+1)%frame, acc(second[id], rec_vec), rec_vec=zero_vec, t=0 counter++, power[id]=LISTEN [ ][ ] , power[id]=RECV curr=(curr+1)%frame, t=0 detected=(detected<0)?curr:detected, rec vec=zero vec,

discov discovery ery

Statistical MC offers an insight by calculating the probability over the number of collisions.

!aux_vec[slot] && aux_vec != zero_vec counter> frame 1 aux_vec==max_vec || aux_vec==zero_vec choice slot: int[0,frame-1] , slot_no[id]=-1, first[id]=zero_vec, sent_info=0, rec_vec=zero_vec, t=0, power[id]=LISTEN aux_vec=first[id], acc(aux_vec,second[id]), second[id]=zero_vec slot_no[id]=slot, counter=-1, aux_vec=zero_vec, first[id]=zero_vec, second[id]=zero_vec, detected=-1 t 0 counter=-1, detected=-1, slot_no[id]=-1, aux_vec=zero_vec, first[id]=zero_vec, curr==slot_no[id] && first[id]==zero_vec && id!=0 rec_vec zero_vec, col_count++, collisions=col_count

+ estimated cost in terms of energy.

t==2 && col!=slot_no[id] can_hear[id][aux_node]==1 curr!=slot_no[id] t==2 curr==slot_no[id] && (first[id]!=zero_vec || id==0) t<=2 t<=2 t<=1 ready normal listening rec_one power[id]=LISTEN power[id]=SEND col=aux_slot, first[id][curr]=1, rec_vec=sent_info? zero_vec : first[aux_node], power[id]=RECV aux_vec=zero_vec sent_info=0 curr=(curr+1)%frame, first[id][curr]=0, t=0 t==1 sendWM?

active usage active usage

Kim Larsen [26] Kim Larsen [26] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

_ [ ] t==2 can_hear[id][aux_node] t==2 t<=2 t<=2 sending sent done aux_node=id, aux_slot=detected detected=-1, sent_info=1 curr=(curr+1)%frame, t=0, rec_vec=zero_vec curr=(curr+1)%frame, first[id]=zero_vec, t=0 detected=(detected<0)?curr:detected, rec_vec=zero_vec, col_count++, collisions=col_count curr=(curr+1)%frame, t=0 sendWM? sendWM!

slide-27
SLIDE 27

SMC of LMAC with SMC of LMAC with 4 Nodes 4 Nodes

Probability density of Collision Count in a Chain

  • Wait distribution:
  • geometric

nsity 0.55 0.66 0.77 0.88

no collisions

  • geometric
  • uniform
  • Network topology:

exp-chain uni-chain probability den 0 11 0.22 0.33 0.44

Network topology:

  • chain
  • ring

collisions 0.11 1.0 2.0 3.0 4.0 5.0 6.0 7.0

Probability Distribution of Collisions in a Ring

g

  • Collision probability
  • Collision count

ty 0.050 0.060 0.070 0.080

<12 collisions

Pr[energy <= 50000] (<> time>=1000)

Collision count

  • Power consumption

Pr[<=160] (<> col_count>0)

uni-ring exp-ring probabilit 0 010 0.020 0.030 0.040

zero Pr[collisions<=50000] (<> time>=1000)

collisions 0.010 70 140 210 280 350

zero

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [27] Kim Larsen [27]

slide-28
SLIDE 28

LMAC with Parameterized Topology LMAC with Parameterized Topology Distributed SMC Distributed SMC

Collision probability in a 4 node network: sweep over all topologies. 32 core cluster: - 8xIntel Core2 2.66GHz CPU

topology collision probability topology collision probability

Pr[time<=200] (<> col_count>0)

[0.36; 0.39] p gy probability p gy probability [0.08; 0.19] (star) [0.29; 0.36] [0 26; 0 30] [0.11; 0.13 ] [0 08; 0 15] (ring) [0.26; 0.30] [0.19; 0.21] [0.08; 0.15] [0.049; 0.050] (chain)

Kim Larsen [28] Kim Larsen [28] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-29
SLIDE 29

10-Node Star 10-Node Star

P b bilit D it Di t ib ti Probability Density Distribution

y 0 008 0.009 0.010 0.011 0.012

Probability Density Distribution

The first collision: h b f 500t

y 0 066 0.077 0.088 0.099

Probability Density Distribution

Collision counts after 1000tu

probability density 0.003 0.004 0.005 0.006 0.007 0.008

happens before 500tu

probability density 0 022 0.033 0.044 0.055 0.066 time 0.001 0.002 40 90 140 190 240 290 340 390 440 collisions 0.011 0.022 8 16 24 32 40 48 56 64 72 80 88 96

Probability Density Distribution

y 0 066 0.077 0.088 0.099

Probability Density Distribution

Collision counts after 2000tu: the numbers are doubled – perpetual collisions

The first collisions happen before 500tu

probability density 0.033 0.044 0.055 0.066

  • The first collisions happen before 500tu.
  • It is unlikely (8.2%) that

there will be 0 collisions.

  • And if they happen, they are perpetual.

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [29] Kim Larsen [29]

collisions p 0.011 0.022 20 40 60 80 100 120 140 160 180 200

y y

slide-30
SLIDE 30

10-Node Ring 10-Node Ring

Probability Density Distribution

0 90

Probability Density Distribution

sity 2.4E-4 2.8E-4 3.2E-4 3.6E-4

The first collision: happens before 1000tu

sity 0.60 0.70 0.80 0.90

Collision counts after 1000tu

probability dens 8.0E-5 1.2E-4 1.6E-4 2.0E-4 probability dens 0.20 0.30 0.40 0.50 time 4.0E-5 8.0E 5 40 150 260 370 480 590 700 810 920 collisions 0.10 3 6 9 12 15 18 21 24 27 30 33 36

Probability Density Distribution

y 0.60 0.70 0.80 0.90

y y

Collision counts after 2000tu: the numbers are doubled – perpetual collisions

  • The first collisions can be as late as 920tu

probability density 0 20 0.30 0.40 0.50

  • The first collisions can be as late as 920tu.
  • It is very likely (>90%) that

there will be 0 collisions.

  • But if they happen, they are perpetual.

Kim Larsen [30] Kim Larsen [30]

collisions 0.10 0.20 6 12 18 24 30 36 42 48 54 60 66 72

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-31
SLIDE 31

10-Node Chain 10-Node Chain

2.7E-4 3.0E-4 3.3E-4

Probability Density Distribution

0.70 0.80 0.90

Probability Density Distribution

The first collision: happens before 800tu Collision counts after 1000tu

robability density 9 0E 5 1.2E-4 1.5E-4 1.8E-4 2.1E-4 2.4E-4 robability density 0.30 0.40 0.50 0.60 time pr 3.0E-5 6.0E-5 9.0E-5 40 130 220 310 400 490 580 670 760 collisions p 0.10 0.20 2 4 6 8 10 12 14 16 18 20 22 24

P b bilit D it Di t ib ti

0.70 0.80 0.90

Probability Density Distribution

The first collisions can be as late as 800tu Collision counts after 2000tu: the numbers are doubled,

robability density 0.30 0.40 0.50 0.60

  • The first collisions can be as late as 800tu.
  • It is very likely (>94%) that

there will be 0 collisions.

  • But if they happen, some are perpetual.

there’s gap of zeros – collision count is diverging

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

collisions p 0.10 0.20 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48

y

Kim Larsen [31] Kim Larsen [31]

slide-32
SLIDE 32

10-Node Star 10-Node Star

P b bilit D it Di t ib ti Probability Density Distribution

y 0 008 0.009 0.010 0.011 0.012

Probability Density Distribution

The first collision: h b f 500t

y 0 066 0.077 0.088 0.099

Probability Density Distribution

Collision counts after 1000tu

probability density 0.003 0.004 0.005 0.006 0.007 0.008

happens before 500tu

probability density 0 022 0.033 0.044 0.055 0.066 time 0.001 0.002 40 90 140 190 240 290 340 390 440 collisions 0.011 0.022 8 16 24 32 40 48 56 64 72 80 88 96

Probability Density Distribution

y 0 066 0.077 0.088 0.099

Probability Density Distribution

Collision counts after 2000tu: the numbers are doubled – perpetual collisions

The first collisions happen before 500tu

probability density 0.033 0.044 0.055 0.066

  • The first collisions happen before 500tu.
  • It is unlikely (8.2%) that

there will be 0 collisions.

  • And if they happen, they are perpetual.

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [32] Kim Larsen [32]

collisions p 0.011 0.022 20 40 60 80 100 120 140 160 180 200

y y

slide-33
SLIDE 33

10-Node Random Topologies 10-Node Random Topologies Distributed SMC Distributed SMC

Generated 10.000 random topologies (out of some 1014 topologies) Checked the property: Pr[time<=2.000](<> col_count>42) ( t l lli i lik l ) (perpetual collisions are likely) One instance on a laptop takes ~3,5min All 10.000 instances on 32-core cluster: 409,5min There were: There were: 6.091 with >0 probability (shown in histogram) 3.909 instances with 0 probability (removed) The highest probability was 0,63 The highest probability was 0,63

Kim Larsen [33] Kim Larsen [33] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-34
SLIDE 34

Nash Eq Nash Eq in Wireless Ad in Wireless Ad Hoc Hoc Networks Networks Consider a wireless network, where there are nodes that can independently adapt their parameters to achieve better performance

persistence=0.1 p persistence=0.1 persistence=0.1 p

Kim Larsen [34] Kim Larsen [34] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-35
SLIDE 35

Nash Eq Nash Eq in Wireless Ad in Wireless Ad Hoc Hoc Networks Networks Consider a wireless network, where there are nodes that can independently adapt their parameters to achieve better performance

persistence=0.1 p persistence=0.1 persistence=0.3 p

Kim Larsen [35] Kim Larsen [35] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-36
SLIDE 36

Nash Eq Nash Eq in Wireless Ad in Wireless Ad Hoc Hoc Networks Networks Consider a wireless network, where there are nodes that can independently adapt their parameters to achieve better performance

persistence=0.1 p

Nash equilibrium (NE): e.g. parameter values such that it’s

persistence=0.3

parameter values such that it s not profitable for a node to change value.

persistence=0.3 p

Kim Larsen [36] Kim Larsen [36] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-37
SLIDE 37

Aloha CSMA/CD protocol Aloha CSMA/CD protocol

Trans TransmitProb=0.2 / itProb=0.2 / Utility=0.91 Utility=0.91 Trans TransmitProb=0.5 / itProb=0.5 / Utility=0.29 Utility=0.29 Si l d l (b d i ALOHA) Pr[Node.time <= 3000](<>(Node.Ok && Node.ntransmitted <= 5))

  • Simple random access protocol (based on p-persistent ALOHA)
  • several nodes sharing the same wireless medium
  • each node has always data to send, and it sends data after a random delay
  • delay geometrically distributed with parameter p=TransmitProb
  • delay geometrically distributed with parameter p=TransmitProb

Kim Larsen [37] Kim Larsen [37] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-38
SLIDE 38

Distributed Algoritm Distributed Algoritm for Computing

  • r Computing

Nash Equilibrium Nash Equilibrium

Input: S={si} – finite set of strategies, U(si, sk) – utility function Goal: find si s.t. sk U(si, si)≥U(si, sk), where si, sk S

i k

( i

i)

( i

k) i k

Algorithm: 1. for every siS compute U(si,si) 2 candidates := S 2. candidates := S 3. while len(candidates)>1: 4. pick some unexplored pair (si,sk)candidates×S 5. compute U(si, sk) 6. if U(si,sk)>U(si,si): 7. remove si from candidates

i

8. if sk U(si, sk) is already computed: 9. return si

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [38] Kim Larsen [38]

We can apply statistics to prove that (si,si) satisfies Nash equilibrium

slide-39
SLIDE 39

Distributed algorithm for computing Distributed algorithm for computing Nash equilibrium Nash equilibrium

Input: S={s1, s2, …, s10} – finite set of strategies, U(si, sj) – utility function Goal: find si s.t. sk U(si, si)≥U(si, sk), where si, sk S

U(s1,s10) U(s10,s10) U(s1,s1) U(s10,s1)

Kim Larsen [39] Kim Larsen [39] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-40
SLIDE 40

Distributed algorithm for computing Distributed algorithm for computing Nash equilibrium Nash equilibrium

Input: S={s1, s2, …, s10} – finite set of strategies, U(si, sj) – utility function Goal: find si s.t. sk U(si, si)≥U(si, sk), where si, sk S

U(s1,s10) U(s10,s10) U(s1,s1) U(s10,s1)

Kim Larsen [40] Kim Larsen [40] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-41
SLIDE 41

Distributed algorithm for computing Distributed algorithm for computing Nash equilibrium Nash equilibrium

Input: S={s1, s2, …, s10} – finite set of strategies, U(si, sj) – utility function Goal: find si s.t. sk U(si, si)≥U(si, sk), where si, sk S

U(s1,s10) U(s10,s10) U(s8,s8) ≥ U(s8,s6) U(s6,s6) < U(s6,s3) U(s1,s1) U(s10,s1)

Kim Larsen [41] Kim Larsen [41] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-42
SLIDE 42

Distributed algorithm for computing Distributed algorithm for computing Nash equilibrium Nash equilibrium

Input: S={s1, s2, …, s10} – finite set of strategies, U(si, sj) – utility function Goal: find si s.t. sk U(si, si)≥U(si, sk), where si, sk S

U(s1,s10) U(s10,s10) U(s8,s8) ≥ U(s8,s6) U(s1,s1) U(s10,s1)

Kim Larsen [42] Kim Larsen [42] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-43
SLIDE 43

Distributed algorithm for computing Distributed algorithm for computing Nash equilibrium Nash equilibrium

Input: S={s1, s2, …, s10} – finite set of strategies, U(si, sj) – utility function Goal: find si s.t. sk U(si, si)≥U(si, sk), where si, sk S

U(s1,s10) U(s10,s10) skS U(s8,s8) ≥ U(s8,sk) “Embarrassingly Parallelizable” U(s1,s1) U(s10,s1)

Kim Larsen [43] Kim Larsen [43] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-44
SLIDE 44

Results (3 nodes) Results (3 nodes)

Value of utility function for the cheater node

Kim Larsen [44] Kim Larsen [44] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-45
SLIDE 45

Results (3 nodes) Results (3 nodes)

Diagonal slice of utility function

Kim Larsen [45] Kim Larsen [45] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-46
SLIDE 46

Results Results

N=2 N=2 N=3 =3 N=4 N=4 N=5 =5 N=6 N=6 N=7 =7 Nash Nash Eq Eq (TrnPr) (TrnPr) 0.32 .32 0.36 .36 0.36 .36 0.35 .35 0.32 .32 0.32 .32 U(s U(sNE

NE,s

,sNE

NE)

0.91 .91 0.57 .57 0.29 .29 0.15 .15 0.10 .10 0.05 .05 Opt Opt (TrnPr) TrnPr) 0.25 0.25 0.19 0.19 0.14 0.14 0.11 0.11 0.09 0.09 0.07 0.07 U( U(s s ) 0 9 0 93 0 8 0 80 0 6 0 68 0 5 0 58 0 5 0 50 0 4 0 44 U( U(sop

  • pt,

, sop

  • pt)

0.93 93 0.80 80 0.68 68 0.58 58 0.50 50 0.44 44 Symmetric Nash Equilibrium and Optimal strategies for different number of network nodes #cores #cores 4 8 12 12 16 16 20 20 24 24 28 28 32 32 Time 38m 19m 13m 9m46s 7m52s 7m04s 6m03s 5m Time required to find Nash Equilibrium for N=3 N=3 100x100 parameter values (8xIntel Core2 2.66GHz CPU)

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [46] Kim Larsen [46]

(8xIntel Core2 2.66GHz CPU)

slide-47
SLIDE 47

Overview Overview

  • Statistical Model Checking in UPPAAL
  • Estimation
  • Testing
  • Distributed SMC for Parameterized Models

P S

  • Parameter Sweeps
  • Optimization
  • Nash Equilibria

q

  • Distributing Statistical Model Checking

Distributing Statistical Model Checking

  • Estimation
  • Testing
  • Testing
  • Parameter Analysis of DSMC
  • Conclusion

Conclusion

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [47] Kim Larsen [47]

slide-48
SLIDE 48

Bias Problem Bias Problem

  • Suppose that generating

accepting runs is fast and non-accepting runs is

r Accept H

non accepting runs is slow.

  • 1-node exploration:
  • Generation is sequential,

Accept H1

q ,

  • nly the outcomes count.
  • N-node exploration:
  • There may be an unusual

peak of accepting runs

runs # Accept H0

peak of accepting runs generated more quickly by some nodes that will arrive long before the non- accepting runs have a

p

Rejecting runs

Solving Bias [Youn Solving Bias [Younes’05 05]

accepting runs have a chance to be counted!

  • The decision will be biased

toward accepting runs.

Accepting runs

Queue the results at a master, use Round-Robin between nodes to accept the results.

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [48] Kim Larsen [48]

slide-49
SLIDE 49

Our Implementation Our Implementation

  • Use a batch of B (e.g 10) runs, transmit one

count per batch. count per batch.

  • Use asynchronous communication (MPI)
  • Queue results at the master and wait only
  • Queue results at the master and wait only

when the buffer (size=K) is full.

Incoming messages from cores!

5 2 1 1 1 7

2

4 6 1 2 8 2

K Master waits if needed

4 5 5 2 1 2 5 3 7

Kim Larsen [49] Kim Larsen [49] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-50
SLIDE 50

Our Implementation Our Implementation

  • Senders have a buffer of (K)

asynchronously sent messages and blocks asynchronously sent messages and blocks

  • nly when the buffer is full.
  • The master periodically add results in the

e aste pe od ca y add esu ts t e buffer.

Update “r” if can’t decide continue Update “r” if can’t decide next Update “r”, if can’t decide, next Update “r”, if can’t decide, next Update r , if can t decide, continue

5 2 1 4 5 5 1 1 7 2 1

2

2 4 5 6 1 3 7 2 8 2

Update r , if can t decide, next

Kim Larsen [50] Kim Larsen [50] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

4 5 5 2 1 2 5 3 7

slide-51
SLIDE 51

Experiment on Multi-Core Experiment on Multi-Core

  • Machine: i7 4*cores HT, 4GHz.
  • Hyperthreading is an interesting twist:

Hyperthreading is an interesting twist:

  • threads share execution units,
  • have unpredictable running times

(may run on same physical core if < 8 threads). y p y

  • Model: Train Gate with 20 trains.
  • Configuration – B=40, K=64
  • Property:

“mutual exclusion on the bridge within time ≤ 1000”

H0: accept if Pr ≥ 0.9999 H1: accept if Pr ≤ 0.9997 α=0.001, β=0.001.

Kim Larsen [51] Kim Larsen [51] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-52
SLIDE 52

Performance Performance

  • Compared to base non-MPI version.
  • Min average max *

Min, average, max .

  • 4.99 max speedup on a quad-core.

S d Effi i B ti Speedup Efficiency 1 0.95 0.98 1.00 95% 98% 100% 2 1.86 1.94 1.98 93% 97% 99% Base time Min=44.35s Avg=44.62s 3 2.78 2.89 2.96 93% 96% 99% 4 3.33 3.76 3.90 83% 94% 98% 5 2 97 3 22 3 66 59% 64% 73% g Max=45.49s 5 2.97 3.22 3.66 59% 64% 73% 6 3.61 3.74 3.87 60% 62% 65% 7 4.09 4.31 4.47 58% 62% 64% 8 3 65 4 73 4 99 46% 59% 62% 8 3.65 4.73 4.99 46% 59% 62%

Kim Larsen [52] Kim Larsen [52] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-53
SLIDE 53

Early Cluster Experiments Early Cluster Experiments

1x1 1x2 1x4 1x8

  • Xeons 5335, 8 cores/node.
  • Estimation

1, 100% 1.8, 92% 3.5, 88% 6.7, 84% 16min 2x1 2x2 2x4 2x8 4x8 1 8 92% 3 9 98% 6 8 85% 12 3 77% 19 6 61%

Estimation

Firewire protocol 22 properties node x cores

1x1 1x2 1x4 1, 100% 1.7, 86% 3.3, 83%

1.8, 92% 3.9, 98% 6.8, 85% 12.3, 77% 19.6, 61%

speed-up, efficiency

6m30s 2x1 2x4 4x2 1.7, 84% 5.9, 74% 7.1, 89%

  • Estimation

Lmac protocol 1 property

  • Encouraging results despite simple distribution.

Thanks to Jaco van de Pol Axel Belifante Martin Rehr and Stefan Blom for providing support on the cluster of the Kim Larsen [53] Kim Larsen [53] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Thanks to Jaco van de Pol, Axel Belifante, Martin Rehr, and Stefan Blom for providing support on the cluster of the University of Twente

slide-54
SLIDE 54

Overview Overview

  • Statistical Model Checking in UPPAAL
  • Estimation
  • Testing
  • Distributed SMC for Parameterized Models

P S

  • Parameter Sweeps
  • Optimization
  • Nash Equilibria

q

  • Distributing Statistical Model Checking
  • Estimation
  • Testing
  • Testing
  • DSMC of

DSMC of DSMC DSMC

  • Conclusion

Conclusion

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [54] Kim Larsen [54]

slide-55
SLIDE 55

Distributed SMC Distributed SMC

  • SMC simulations can be distributed across a cluster
  • f machines with N number of cores.
  • The simulations are grouped into batches of B

B number of simulations in each to avoid bias. Each core is not allowed to be ahead by more than K

  • Each core is not allowed to be ahead by more than K

batches than any other core.

Core0 is computing 4th batch Core0 is computing 4th batch Core2 is computing 1st batch Core1 is computing 3rd batch Core9 is blocked, waiting for Core2+10

5 2 1 1 1 7

2

4 6 1 2 8 2

K=4 Core3 is blocked, waiting for Core2+10 Only complete row of batches is used

5 2 4 5 5 1 2 1

2

2 4 5 6 3 7 2

Cores: 0 1 2 3 4 5 6 7 8 9 10

Kim Larsen [55] Kim Larsen [55] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-56
SLIDE 56

Distributed SMC: Model of a Core Distributed SMC: Model of a Core

start

Safe x>=3 Cross leave[id]! x<=5 (1+id):N*N Safe x>=3 Cross leave[id]! x<=5 (1+id):N*N Safe x>=3 Cross leave[id]! x<=5 (1+id):N*N

t i t

start i:bucket t

x=0 Stop x=0 x=0 x=0 x<=10 Appr x>=10 Start x>=7 stop[id]? appr[id]! x<= 15 x<=20 go[id]? (1+id):N N x=0 Stop x=0 x=0 x=0 x<=10 Appr x>=10 Start x>=7 stop[id]? appr[id]! x<= 15 x<=20 go[id]? (1+id):N N x=0 Stop x=0 x=0 x=0 x<=10 Appr x>=10 Start x>=7 stop[id]? appr[id]! x<= 15 x<=20 go[id]? ( ) Safe x>=3 Cross leave[id]! x<=5 (1+id):N*N Safe x>=3 Cross leave[id]! x<=5 (1+id):N*N f t() Free len == 0 e : id_t

train gate model

w[i] x<=H offset+H step*j i:bucket_t compute j=i+1, x=0, busy[id]=1

Computing one batch Computing one batch

x=0 Stop x=0 x=0 x=0 x<=10 Appr x>=10 Start x>=7 stop[id]? appr[id]! x<= 15 x<=20 go[id]? x=0 Stop x=0 x=0 x=0 x<=10 Appr x>=10 Start x>=7 stop[id]? appr[id]! x<= 15 x<=20 go[id]? enqueue(e) dequeue() enqueue(e) e == front() len > 0 Stopping Occ leave[e]? stop[tail()]! appr[e]? appr[e]? go[front()]! e : id_t e:id_t

counter<B x>=H_offset+H_step*(j-1) x<=H_offset+H_step j counter++, runs++, x=0

Pr[# <= Pr[# <= 100](< 100](<> Train(5).Cr > Train(5).Cross ss)

counter<B counter==B ( (batches[id]<K) || forall(i:node_t) batches[i]>=batches[id]) batches[id]++, counter=0 iterate

5500 6600 7700

Frequency Histogram

batches[id]==K && exists(i:node_t) b t h [i] < b t h [id] batches[i] batches[id]) decrement() counter 0 done! decide

Wait if Wait if ahead by ahead by K batches batches

count 1100 2200 3300 4400 5500

batches[i] < batches[id] done? wait busy[id]=0

run length in steps 1100 3 8 13 18 23 28 33 38 43 48 53

generation time ~ simulation steps

Kim Larsen [56] Kim Larsen [56] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-57
SLIDE 57

DSMC: CPU Usage DSMC: CPU Usage Time Time

Property used: Property used: E[time<=1000; 25000] (max: usage) E[time<=1000; 25000] (max: usage) Parameter instantiation: Parameter instantiation: N=8, B=100, K=2 N=8, B=100, K=2

0,045 0,050

Probability Density Distribution

nsity 0,030 0,035 0,040 average density robability den 0,015 0,020 0,025 pr 0,005 0,010 7880 7900 7920 7940 7960 7980 8000 Average: 7983.02. Probability sums: 1 displayed, 0 remaining. Runs: 25000 in total, 25000 displayed, 0 remaining. max: usage

Kim Larsen [57] Kim Larsen [57] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

slide-58
SLIDE 58

DSMC Performance Analysis DSMC Performance Analysis

N=16 B=1..10 K=1,2,4,8 N=16 B=20..200 K=1,2,4,8

Property used:

B=100,

Property used: E[time<=1000; 1000] (max: usage) Conclusions: K=1 has huge effect and should be

, N=1..32 K=1,2,4,8

K 1 has huge effect and should be avoided. K=2 has effect if B<20. K>2 are indistinguishable on homogeneous cluster.

Kim Larsen [58] Kim Larsen [58] ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011

cluster. K>2 and B>20: number of simulations scale linearly to the number of cores used.

slide-59
SLIDE 59

Conclusion Conclusion

  • Preliminary experiments indicate that

distributed SMC in UPPAAL scales very nicely distributed SMC in UPPAAL scales very nicely.

  • More work to identify impact of parameters
  • More work to identify impact of parameters

for distributing individual SMC?

  • How to assign statistical confidence to
  • How to assign statistical confidence to

parametric analysis, e.g. optimum or NE?

  • UPPAAL 4.1.4 available

(support for SMC, DSMC, 64-bit,..) (support for SMC, DSMC, 64 bit,..)

ARTIST Design PhD School, Beijing, 2011 ARTIST Design PhD School, Beijing, 2011 Kim Larsen [59] Kim Larsen [59]