Martin Pépin Joint work with Antoine Genitrini & Frédéric Peschanski Accepted for publication at ICTAC’20 October 13, 2020 Sorbonne Université — LIP6 — Paris Statistical Analysis of Non-Deterministic Fork-Join Processes
task 1 task 1 task 1 task 2 task 2 task 2 task 3 task 3 Time One computation unit shared by several processes: → Possible dependencies between processes → Scheduling 1/15 What is concurrency?
“ all schedulings ” → Combinatorics! correct. • Many possible schedulings: combinatorial explosion • Can we (effjciently) count them? • Can we (effjciently) sample among them? 2/15 Why is it diffjcult? You would like to check that all possible schedulings are
correct. • Many possible schedulings: combinatorial explosion • Can we (effjciently) count them? • Can we (effjciently) sample among them? 2/15 Why is it diffjcult? You would like to check that all possible schedulings are “ all schedulings ” → Combinatorics!
correct. • Many possible schedulings: combinatorial explosion • Can we (effjciently) count them? • Can we (effjciently) sample among them? 2/15 Why is it diffjcult? You would like to check that all possible schedulings are “ all schedulings ” → Combinatorics!
So we cannot count effjciently… in the general case. Counting the linear extensions of a partial order is a #- P complete problem. I.e. it is as hard as counting the number of solutions in SAT. But we can have some restrictions on the programs. 3/15 Why is it diffjcult? (2) Negative result (Brightwell & Winkler ’91)
Counting the linear extensions of a partial order is a #- P complete problem. I.e. it is as hard as counting the number of solutions in SAT. But we can have some restrictions on the programs. 3/15 Why is it diffjcult? (2) Negative result (Brightwell & Winkler ’91) So we cannot count effjciently… in the general case.
Frédéric Peschanski, … problems 4/15 The long-term project “Quantitative and algorithmic aspects of concurrency” > Olivier Bodini, Matthieu Dien, Antoine Genitrini, MP, > Identify fundamental components of concurrency and interpret them as combinatorial objects > Algorithmic solutions for the counting and sampling > Analytical results (when possible)
Algorithmic aspects A class of concurrent programs Conclusion and perspective Outline
5/15 of an execution of P and an followed by an execution of Q . task 1 task 2 Q P execution of Q . Q task 1 task 2 P Fork-Join parallelism Parallel composition Sequential composition ∥ ; task 1 task 2 task 3 task 1 task 2 task 3 ↓ ↓ task 1 task 1 task 2 task 3 task 2 task 1 task 2 task 3 task 1 task 2 Execution = any interleaving Execution = an execution of P
6/15 task 1 task 2 P Q executions of Q task 1 task 2 task 1 task 2 task 1 task 2 or task 1 task 2 or task 1 task 2 or or an execution of Q . Non-determinism and loops Non-deterministic choice Loop ( ) ⋆ + task 1 task 2 task 3 ↓ ↓ task 1 task 2 task 3 Execution = an execution of P . . . Execution = sequence of
7/15 | (empty program) 0 | (atomic action) a | (loop) (non-deterministic choice) | (sequential composition) | (parallel composition) Non-deterministic Fork-Join programs (NFJ) P , Q ::= P ∥ Q P ; Q P + Q P ⋆
! ! ! 8/15 Labelled and Q 0 P SEQ P 0 unlabelled operators P in the same grammar; P Q might contain the empty execution; P 0 non-empty executions of P . 0 Q 0 P P Q P Q P Q P Q Q P Q P SEQ P P Combinatorial interpretation Defjne the executions of P as a combinatorial class � P � : � 0 � = E � a � = Z
! ! ! 8/15 unlabelled operators 0 P SEQ P 0 in the same grammar; 0 P Q might contain the empty execution; P 0 non-empty executions of P . Q P P Q Q P P SEQ P P Q 0 Combinatorial interpretation Defjne the executions of P as a combinatorial class � P � : � 0 � = E • Labelled and � a � = Z � P ; Q � = � P � × � Q � • � P ∥ Q � = � P � ⋆ � Q � •
! ! ! SEQ P 0 unlabelled operators in the same grammar; 8/15 0 P Q might contain the empty execution; P 0 non-empty executions of P . P 0 Q P SEQ P P Q 0 P Combinatorial interpretation Defjne the executions of P as a combinatorial class � P � : � 0 � = E • Labelled and � a � = Z � P ; Q � = � P � × � Q � • � P ∥ Q � = � P � ⋆ � Q � • � P + Q � = � P � + � Q �
! ! ! 8/15 P 0 unlabelled operators in the same grammar; P P Q might contain the empty execution; P 0 non-empty executions of P . SEQ Q 0 Q 0 P 0 P Combinatorial interpretation Defjne the executions of P as a combinatorial class � P � : � 0 � = E • Labelled and � a � = Z � P ; Q � = � P � × � Q � • � P ∥ Q � = � P � ⋆ � Q � • � P + Q � = � P � + � Q � � P ⋆ � = SEQ ( � P � )
8/15 P executions of P . non-empty 0 P the empty execution; in the same grammar; unlabelled operators 0 P SEQ P 0 Q 0 0 P Q Combinatorial interpretation Defjne the executions of P as a combinatorial class � P � : � 0 � = E • Labelled and � a � = Z � P ; Q � = � P � × � Q � • � P ∥ Q � = � P � ⋆ � Q � • △ ! � P � , � Q � might contain △ � P + Q � = � P � + � Q � ! △ � P ⋆ � = SEQ ( � P � ) !
8/15 unlabelled operators executions of P . the empty execution; in the same grammar; Combinatorial interpretation Defjne the executions of P as a combinatorial class � P � : � 0 � = E • Labelled and � a � = Z � P ; Q � = � P � × � Q � • � P ∥ Q � = � P � ⋆ � Q � • △ ! � P � , � Q � might contain △ � P + Q � = � P � + � Q � ! △ � P ⋆ � = SEQ ( � P � ) ! • � P � ̸ = 0 = non-empty � P + Q � ̸ = 0 = � P � ̸ = 0 + � Q � ̸ = 0 • � P ⋆ � = SEQ ( � P � ̸ = 0 ) •
Algorithmic aspects A class of concurrent programs Conclusion and perspective Outline
n a n z n and n z n n a n z n n z n 9/15 q z p z p 0 1 All operation are taken z n 1 p z COUNT P q z COUNT Q p z COUNT P p z q z where n a n n a n 1 p 0 q 0 1 Q prev. slide COUNT 0 q z COUNT a z COUNT P p z GF q z COUNT P Q p z q z COUNT P Q p z symbolic method Counting executions [ z n ] Algorithm : P − → � P � − → − → count
n a n z n and n z n n a n z n n z n 9/15 taken a n n a n n where q z p z q z p z All operation are prev. slide symbolic method GF Counting executions [ z n ] Algorithm : P − → � P � − → − → count COUNT ( 0 ) = 1 COUNT ( a ) = z mod z n + 1 COUNT ( P ∥ Q ) = p ( z ) ⊚ q ( z ) COUNT ( P ; Q ) = p ( z ) · q ( z ) p ( z ) = COUNT ( P ) COUNT ( P + Q ) = p ( z ) + q ( z ) − p ( 0 ) q ( 0 ) q ( z ) = COUNT ( Q ) COUNT ( P ⋆ ) = ( 1 − ( p ( z ) − p ( 0 ))) − 1
9/15 All operation are prev. slide a n n a n symbolic method n taken GF Counting executions [ z n ] Algorithm : P − → � P � − → − → count COUNT ( 0 ) = 1 COUNT ( a ) = z mod z n + 1 COUNT ( P ∥ Q ) = p ( z ) ⊚ q ( z ) • COUNT ( P ; Q ) = p ( z ) · q ( z ) p ( z ) = COUNT ( P ) COUNT ( P + Q ) = p ( z ) + q ( z ) − p ( 0 ) q ( 0 ) q ( z ) = COUNT ( Q ) COUNT ( P ⋆ ) = ( 1 − ( p ( z ) − p ( 0 ))) − 1 • p ( z ) ⊚ q ( z ) = L ( B ( p ( z )) · B ( q ( z ))) (∑ n ! z n ) = ∑ n a n z n and B ( ∑ n a n z n ) = ∑ where L n ! z n
operations on big integers. of degree n . O P M n M n n bit-complexity. 10/15 Counting executions — complexity Theorem The counting algorithm performs O ( | P | M ( n )) arithmetic The coeffjcients of the polynomial have O ( n ln n ) bits. • | P | is the syntactic size of P . • M ( n ) is the cost of the multiplication of two polynomials
operations on big integers. of degree n . 10/15 Counting executions — complexity Theorem The counting algorithm performs O ( | P | M ( n )) arithmetic The coeffjcients of the polynomial have O ( n ln n ) bits. • | P | is the syntactic size of P . • M ( n ) is the cost of the multiplication of two polynomials = ⇒ O ( | P | M ( n ) M ( n ln n )) bit-complexity.
11/15 2 24 0 1 2 1 2 0 0 1 2 1 0 3 1 1 1 2 1 2 1 2 0 + 1 + 1 = 2 3 8 0 Rule: prev. slides 3 4 1 1 3 2 2 0 3 1 0 2 uniform execution Random sampling of executions Algorithm : P − → � P � recursive method − → [ FZC ′ 93 ]
11/15 2 1 3 24 0 1 2 1 2 0 0 1 2 8 0 0 1 1 1 2 1 2 1 2 0 + 1 + 1 = 2 3 2 prev. slides 4 1 1 3 2 2 0 3 1 0 Rule: 3 uniform execution Random sampling of executions Algorithm : P − → � P � recursive method − → [ FZC ′ 93 ] SAMPLE (( a + b ) ⋆ ∥ ( c + ( d ; e ) + ( f ; g )) , 3 )
11/15 0 0 1 2 1 3 0 1 2 1 0 2 Rule: k 1 uniform execution 1 1 2 1 2 1 2 0 + 1 + 1 = 2 prev. slides 2 Random sampling of executions Algorithm : P − → � P � recursive method − → [ FZC ′ 93 ] SAMPLE (( a + b ) ⋆ ∥ ( c + ( d ; e ) + ( f ; g )) , 3 ) ( n ) ( n ) ( n ) P n = Q 0 R 0 + Q 1 R n − 1 + Q 2 R n − 2 + · · · ( n ) Pick k ∈ � 0 ; n � with probability Q k R n − k / P n ( 3 ) ( 3 ) ( 3 ) ( 3 ) 1 · 0 · + 2 · 2 · + 4 · 1 · + 8 · 0 · = 24 · ( 0 + 1 / 2 + 1 / 2 + 0 )
Recommend
More recommend