Balancing Specula-ve Loads in Parallel Discrete Event - - PowerPoint PPT Presentation
Balancing Specula-ve Loads in Parallel Discrete Event - - PowerPoint PPT Presentation
Balancing Specula-ve Loads in Parallel Discrete Event Simula-on Eric Mikida Brief PDES Descrip-on Simula-on made up of Logical Processes (LPs) LPs
Brief ¡PDES ¡Descrip-on ¡
- Simula-on ¡made ¡up ¡of ¡Logical ¡Processes ¡(LPs) ¡
- LPs ¡process ¡events ¡in ¡-mestamp ¡order ¡
- Synchroniza-on ¡is ¡conserva-ve ¡or ¡op-mis-c ¡
- Periodically ¡compute ¡global ¡virtual ¡-me ¡(GVT) ¡
2 ¡
Op-mis-c ¡Execu-on ¡
1 ¡
Pending ¡events ¡ Processed ¡events ¡
3 ¡
3 ¡ 6 ¡ 7 ¡ 9 ¡ 10 ¡
LP ¡
Op-mis-c ¡Execu-on ¡
1 ¡
4 ¡
3 ¡ 6 ¡ 7 ¡ 9 ¡ 10 ¡
LP ¡
Op-mis-c ¡Execu-on ¡
1 ¡
5 ¡
3 ¡ 6 ¡ 7 ¡ 9 ¡ 10 ¡ 4 ¡
LP ¡
Op-mis-c ¡Execu-on ¡
1 ¡
6 ¡
3 ¡ 6 ¡ 7 ¡ 9 ¡ 10 ¡ 4 ¡
LP ¡
Op-mis-c ¡Execu-on ¡
1 ¡
7 ¡
3 ¡ 4 ¡ 6 ¡ 7 ¡ 9 ¡ 10 ¡
LP ¡
Op-mis-c ¡Execu-on ¡
1 ¡
8 ¡
3 ¡ 4 ¡ 6 ¡ 7 ¡ 9 ¡ 10 ¡
GVT ¡
LP ¡
Performance ¡Metrics ¡
Event ¡Rate ¡= ¡ Event ¡Efficiency ¡= ¡ Load ¡Balance ¡= ¡ EcommiTed ¡/ ¡s ¡ EcommiTed ¡/ ¡Etotal ¡ ?? ¡
9 ¡
What ¡is ¡“load”? ¡
- Charm++ ¡automa-cally ¡measures ¡CPU ¡-me ¡
– Makes ¡sense ¡when ¡all ¡work ¡is ¡useful ¡work ¡ – Relies ¡on ¡principle ¡of ¡persistence ¡ – Balances ¡CPU ¡-me ¡per ¡PE ¡
10 ¡
What ¡is ¡“load”? ¡
- Charm++ ¡automa-cally ¡measures ¡CPU ¡-me ¡
– Makes ¡sense ¡when ¡all ¡work ¡is ¡useful ¡work ¡ – Relies ¡on ¡principle ¡of ¡persistence ¡ – Balances ¡CPU ¡-me ¡per ¡PE ¡
Does ¡this ¡make ¡sense ¡in ¡a ¡specula-ve ¡se^ng? ¡
11 ¡
Example ¡
12 ¡
Executed: ¡5 ¡ CommiTed: ¡4 ¡ Rolled ¡Back: ¡0 ¡
LP ¡1 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡4 ¡
LP ¡2 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡0 ¡
LP ¡3 ¡
Example ¡
13 ¡
Executed: ¡5 ¡ CommiTed: ¡4 ¡ Rolled ¡Back: ¡0 ¡
LP ¡1 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡4 ¡
LP ¡2 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡0 ¡
LP ¡3 ¡
Example ¡
14 ¡
Executed: ¡5 ¡ CommiTed: ¡4 ¡ Rolled ¡Back: ¡0 ¡
LP ¡1 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡4 ¡
LP ¡2 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡0 ¡
LP ¡3 ¡
Example ¡
15 ¡
Executed: ¡5 ¡ CommiTed: ¡4 ¡ Rolled ¡Back: ¡0 ¡
LP ¡1 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡4 ¡
LP ¡2 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡0 ¡
LP ¡3 ¡
Example ¡
Roughly ¡the ¡same ¡CPU ¡-me ¡spent ¡execu-ng ¡events ¡
16 ¡
Executed: ¡5 ¡ CommiTed: ¡4 ¡ Rolled ¡Back: ¡0 ¡
LP ¡1 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡4 ¡
LP ¡2 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡0 ¡
LP ¡3 ¡
Example ¡
Roughly ¡the ¡same ¡CPU ¡-me ¡spent ¡execu-ng ¡events ¡ How ¡does ¡the ¡load ¡balancer ¡differen-ate? ¡
17 ¡
Executed: ¡5 ¡ CommiTed: ¡4 ¡ Rolled ¡Back: ¡0 ¡
LP ¡1 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡4 ¡
LP ¡2 ¡
Executed: ¡5 ¡ CommiTed: ¡0 ¡ Rolled ¡Back: ¡0 ¡
LP ¡3 ¡
How ¡does ¡GVT ¡affect ¡balance? ¡
Count-‑Based ¡GVT ¡
- GVT ¡computed ¡every ¡X ¡
events ¡
- Doesn’t ¡aTempt ¡to ¡bound ¡
- p-mism ¡
- Can ¡lead ¡to ¡poor ¡event ¡
efficiency ¡ Leash-‑Based ¡GVT ¡
- GVT ¡computed ¡every ¡X ¡units ¡
- f ¡virtual ¡-me ¡
- Keeps ¡virtual ¡-mes ¡
balanced ¡across ¡PEs ¡
- Can ¡lead ¡to ¡poor ¡CPU ¡
balance ¡across ¡PEs ¡
18 ¡
Benchmarks ¡
PHOLD ¡
- Common ¡PDES ¡benchmark ¡
- Execu-ng ¡an ¡event ¡causes ¡a ¡
new ¡event ¡for ¡a ¡random ¡LP ¡
- Changing ¡event ¡distribu-on ¡
causes ¡imbalance ¡ Traffic ¡
- Simulates ¡a ¡grid ¡of ¡
intersec-ons ¡
- Events ¡are ¡cars ¡arriving, ¡
leaving, ¡and ¡changing ¡lanes ¡
- Cars ¡travel ¡from ¡source ¡to ¡
des-na-on ¡
19 ¡
GVT ¡Trigger ¡Event ¡Rates ¡
64 ¡nodes ¡of ¡Vesta ¡(BG/Q) ¡ PHOLD: ¡
- ‑
32 ¡LPs ¡per ¡rank ¡
- ‑
50% ¡remote ¡events ¡ Traffic: ¡
- ‑
64K ¡intersec-ons ¡
- ‑
1M ¡cars ¡
20 ¡
0 ¡ 5 ¡ 10 ¡ 15 ¡ 20 ¡ 25 ¡ 30 ¡ 35 ¡ 40 ¡ PHOLD ¡ Traffic ¡ Event ¡Rate ¡(millions/s) ¡ Count ¡ Leash ¡
GVT ¡Trigger ¡Comparison ¡
64 ¡nodes ¡of ¡Vesta ¡(BG/Q) ¡ PHOLD: ¡
- ‑
32 ¡LPs ¡per ¡rank ¡
- ‑
50% ¡remote ¡events ¡ Traffic: ¡
- ‑
64K ¡intersec-ons ¡
- ‑
1M ¡cars ¡
21 ¡
0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡ 80 ¡ 90 ¡ 100 ¡ PHOLD ¡ Traffic ¡ Efficiency ¡(%) ¡ Count ¡ Leash ¡
Our ¡Load ¡Balancing ¡Goal ¡
- Make ¡sure ¡all ¡PEs ¡have ¡useful ¡work ¡
– Balance ¡the ¡CPU ¡load ¡ – Only ¡count ¡useful ¡work ¡
- Maintain ¡a ¡high ¡event ¡efficiency ¡
– Balance ¡rate ¡of ¡progress ¡ – Leads ¡to ¡less ¡overall ¡work ¡
22 ¡
Redefine ¡“Load” ¡for ¡PDES ¡
Past-‑Looking ¡Metrics ¡
- CPU ¡Time ¡
- Current ¡Timestamp ¡
- CommiTed ¡Timestamp ¡
- CommiTed ¡Events ¡
- Poten-al ¡CommiTed ¡Events ¡
Future-‑Looking ¡Metrics ¡
- Next ¡Timestamp ¡
- Pending ¡Events ¡
- Weighted ¡Pending ¡Events ¡
- “Ac-ve” ¡Events ¡
23 ¡
PHOLD ¡Event ¡Rate ¡
24 ¡
0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡ 80 ¡ 90 ¡ 100 ¡ Count ¡ Leash ¡ Event ¡Rate ¡(millions/s) ¡ No ¡LB ¡ CPU ¡Time ¡ CommiTed ¡TS ¡ ¡Current ¡TS ¡ Next ¡TS ¡ CommiTed ¡Events ¡ Pending ¡Events ¡ Ac-ve ¡Events ¡ 4.5x ¡Speedup ¡ 2.5x ¡Speedup ¡
PHOLD ¡Efficiency ¡
25 ¡
0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡ 80 ¡ 90 ¡ 100 ¡ Count ¡ Leash ¡ Efficiency ¡(%) ¡ No ¡LB ¡ CPU ¡Time ¡ CommiTed ¡TS ¡ ¡Current ¡TS ¡ Next ¡TS ¡ CommiTed ¡Events ¡ Pending ¡Events ¡ Ac-ve ¡Events ¡
Traffic ¡Event ¡Rate ¡
26 ¡
0 ¡ 5 ¡ 10 ¡ 15 ¡ 20 ¡ 25 ¡ 30 ¡ 35 ¡ Count ¡ Leash ¡ Event ¡Rate ¡(millions/s) ¡ No ¡LB ¡ CPU ¡Time ¡ CommiTed ¡TS ¡ ¡Current ¡TS ¡ Next ¡TS ¡ CommiTed ¡Events ¡ Pending ¡Events ¡ Ac-ve ¡Events ¡ 3x ¡Speedup ¡ 3x ¡Speedup ¡
Traffic ¡Efficiency ¡
27 ¡
0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡ 80 ¡ 90 ¡ 100 ¡ Count ¡ Leash ¡ Efficiency ¡(%) ¡ No ¡LB ¡ CPU ¡Time ¡ CommiTed ¡TS ¡ ¡Current ¡TS ¡ Next ¡TS ¡ CommiTed ¡Events ¡ Pending ¡Events ¡ Ac-ve ¡Events ¡
What’s ¡next? ¡
- BeTer ¡visualiza-on/analysis ¡tools ¡
- More ¡diverse ¡set ¡of ¡models ¡
- Conserva-ve ¡synchroniza-on ¡
- Vector ¡load ¡balancing ¡strategies ¡
- Adap-ve ¡load ¡balancer ¡
- Combine ¡with ¡GVT ¡work ¡
28 ¡