Auto-Parallelizing Stateful Distributed Streaming Applica9ons - - PowerPoint PPT Presentation

auto parallelizing stateful distributed streaming
SMART_READER_LITE
LIVE PREVIEW

Auto-Parallelizing Stateful Distributed Streaming Applica9ons - - PowerPoint PPT Presentation

Auto-Parallelizing Stateful Distributed Streaming Applica9ons Sco$ Schneider * , Mar9n Hirzel * , Bugra Gedik + and Kun-Lung Wu * * IBM Research


slide-1
SLIDE 1

Auto-­‑Parallelizing ¡Stateful ¡ Distributed ¡Streaming ¡Applica9ons ¡

Sco$ ¡Schneider*, ¡Mar9n ¡Hirzel*, ¡ Bugra ¡Gedik+ ¡and ¡Kun-­‑Lung ¡Wu* ¡

*IBM ¡Research ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡+Bilkent ¡University ¡

1

slide-2
SLIDE 2

Big ¡Data ¡

2 ¡

! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡ ? ¡ ! ¡

slide-3
SLIDE 3

3 ¡

Programming ¡Model ¡

  • Streams ¡applica9ons ¡ ¡

– Described ¡as ¡data-­‑flow ¡graphs ¡

  • An ¡instance ¡of ¡a ¡flow ¡graph ¡is ¡a ¡job ¡in ¡the ¡system ¡

– Flow ¡graphs ¡consist ¡of ¡ ¡

  • Tuples: ¡structured ¡data ¡item ¡
  • Operators: ¡Reusable ¡stream ¡analy9cs ¡
  • Streams: ¡Series ¡of ¡tuples ¡with ¡a ¡given ¡schema ¡
slide-4
SLIDE 4

Streaming ¡Programming ¡Models ¡

Synchronous ¡

  • Sta9c ¡selec9vity ¡

– e.g., ¡1 ¡: ¡3 ¡

for i in range(3): result = f(i) submit(result)

– In ¡general, ¡m ¡: ¡n ¡where ¡m ¡and ¡ n ¡are ¡sta9cally ¡known ¡

  • Always ¡has ¡sta9c ¡schedule ¡

Asynchronous ¡

  • Dynamic ¡selec9vity ¡

– e.g., ¡1 ¡: ¡[0,1] ¡

if input.value > 5: submit(result)

– In ¡general, ¡1 ¡: ¡* ¡ ¡

  • In ¡general, ¡schedules ¡cannot

¡ be ¡sta9c ¡

4 ¡

slide-5
SLIDE 5

5

SPL source

InfoSphere Streams Runtime

x86 host x86 host x86 host x86 host x86 host

PE PE PE PE PE PE PE PE

Connections

Source Sink PE

SPL compiler Streams Runtime

slide-6
SLIDE 6

6

InfoSphere Streams Runtime

x86 host x86 host x86 host x86 host x86 host

PE PE Sink Source Source PE PE PE PE Sink Sink PE PE PE PE PE PE PE PE

Connections

Source Sink PE

SPL compiler Streams Runtime

(Job management, Security, Continuous Resource Management)

slide-7
SLIDE 7

What ¡we ¡do ¡

composite Main { type Entry = int32 uid, rstring server, rstring msg; Sum = uint32 uid, int32 total; graph stream<Entry> Msgs = ParSource() { param servers: "logs.*.com"; partitionBy: server; } stream<Sum> Sums = Aggregate(Msgs) { window Msgs: tumbling, time(5), partitioned; param partitionBy: uid; } stream<Sum> Suspects = Filter(Sums) { param filter: total > 100; } () as Sink = FileSink(Suspects) { param file: "suspects.csv"; } } 7 ¡

ParSrc Aggr Filter Sink ParSrc Aggr Filter ParSrc Aggr Filter Sink ParSrc Aggr Filter

slide-8
SLIDE 8

Overview ¡

8 ¡

Run:me: ¡

  • Replicate ¡segment ¡into ¡channels ¡
  • Add ¡split/merge/shuffle ¡as ¡needed ¡
  • Enforce ¡ordering ¡

Compiler: ¡

  • Apply ¡parallel ¡transforma9ons ¡
  • Pick ¡rou9ng ¡mechanism ¡(e.g., ¡hash ¡by ¡key) ¡
  • Pick ¡ordering ¡mechanism ¡(e.g., ¡seq. ¡numbers) ¡

Stream ¡graph ¡descrip9on ¡

slide-9
SLIDE 9

Transforma9ons ¡& ¡Safety ¡Condi9ons ¡

Parallelize ¡ non-­‑source/sink ¡ Parallelize ¡sources ¡ and ¡sinks ¡ Combine ¡parallel ¡ regions ¡ Rotate ¡ merge ¡and ¡split ¡

  • stateless ¡or ¡

par99oned ¡state ¡

  • selec9vity ¡≤ ¡1 ¡
  • simple ¡chain ¡
  • stateless ¡or ¡

par99oned ¡state ¡

  • stateless ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡or ¡

  • compa9ble ¡keys ¡
  • forwarding ¡
  • incompa9ble ¡

keys ¡

9

slide-10
SLIDE 10

Select ¡Parallel ¡Segments ¡

10 ¡

  • Can't ¡parallelize ¡

– Operators ¡with ¡>1 ¡fan-­‑in ¡or ¡fan-­‑out ¡ – Punctua9on ¡dependecy ¡later ¡on ¡

  • Can't ¡add ¡operator ¡to ¡parallel ¡segment ¡if ¡

– Another ¡operator ¡in ¡segment ¡has ¡co-­‑loca9on ¡ constraint ¡ – Keys ¡don't ¡match ¡

  • 8
  • 1
  • 7

n.p.

  • 2
  • 9

k

  • 10

k,l

  • 12

l

  • 11

l

  • 13
  • 14
  • 3

n.p.

  • 4
  • 5
  • 6

k

slide-11
SLIDE 11

Compiler ¡to ¡Run9me ¡

11 ¡

Compiler ¡ Graph ¡+ ¡unexpanded ¡ parallel ¡regions ¡ ¡ Fully ¡expanded ¡ ¡ graph ¡ Run9me ¡ graph ¡ fragment ¡ Run9me ¡ graph ¡ fragment ¡ Run9me ¡ graph ¡ fragment ¡ PE ¡ PE ¡ PE ¡ compile-time submission-time run-time

slide-12
SLIDE 12

Run9me ¡

selec:vity ¡= ¡1 ¡ selec:vity ¡≤ ¡1 ¡ selec:vity ¡unknown ¡ no ¡state ¡ round-­‑robin ¡ seqnos ¡& ¡pulses ¡ don't ¡parallelize ¡ par::oned ¡state ¡ seqnos ¡ seqnos ¡& ¡pulses ¡ don't ¡parallelize ¡ unknown ¡state ¡ don't ¡parallelize ¡ don't ¡parallelize ¡ don't ¡parallelize ¡

12

Split: ¡

  • Insert ¡seqno ¡& ¡pulse ¡
  • Rou9ng ¡

Merge: ¡

  • Apply ¡ordering ¡

policy ¡

  • Remove ¡seqno ¡(if ¡

there) ¡and ¡drop ¡ pulse ¡(if ¡there) ¡ Operators ¡in ¡parallel ¡segments: ¡

  • Forward ¡seqno ¡& ¡pulse ¡
slide-13
SLIDE 13

Merger ¡Ordering ¡

13 ¡ next ¡

1 2

Round-­‑Robin ¡

next-­‑heap ¡

1 2 7 10 13 6 9 12 15

last ¡= ¡4 ¡

5

Sequence ¡Numbers ¡

next-­‑heap ¡ seen-­‑heap ¡

1 2 10 16 22 6 12 18 24

last ¡= ¡4 ¡

8

Sequence ¡Numbers ¡and ¡Pulses ¡

slide-14
SLIDE 14

Scalability ¡

14 ¡

Aggr Src Aggr Aggr Sink SplitMergeStateful ¡ Aggr Aggr Src Aggr Aggr Aggr Aggr Sink SplitShuffleMerge ¡

slide-15
SLIDE 15

Applica9on ¡Kernels ¡

15 ¡

21.1 14.4 12.8 11.4 3.2 2 4 6 8 10 12 14 16 18 20 22 1 2 4 8 16 32 Speedup vs. 1 channel Number of parallel channels Network monitoring PageRank Twitter NLP Twitter CEP Finance

Parse Match

Twitter CEP

≤1 NLP

Twitter NLP

≤1 MulAdd Add Chop While Sink Init

PageRank

≤1 ParSrc Aggr Filter Aggr Filter ParSink

Network monitoring

≤1 ≤1 ≤1 ≤1 Vwap Project Combine Bargains Trades Quotes

Finance

slide-16
SLIDE 16

Ques9ons? ¡

16

slide-17
SLIDE 17

Backups ¡

17

slide-18
SLIDE 18

Compiler ¡Changes ¡

18 ¡

Select ¡parallel ¡ segments ¡ Operator ¡ model ¡ Write ¡ADL ¡ Fuse ¡ Analyze ¡SPL ¡ code ¡ Segments ¡ Par99ons ¡ Infer ¡par99on ¡ coloca9on ¡

slide-19
SLIDE 19

Transport ¡Changes ¡

  • TCPSender ¡

– Added ¡the ¡ability ¡to ¡send ¡to ¡a ¡subset ¡of ¡ connec9ons ¡on ¡an ¡output ¡port ¡

  • Handshake ¡

– Modified ¡to ¡include ¡sender ¡iden99es ¡

  • TCPReciever ¡

– Added ¡support ¡for ¡iden9fying ¡which ¡connec9on ¡ has ¡delivered ¡a ¡tuple ¡

slide-20
SLIDE 20

Overhead ¡

20 ¡

slide-21
SLIDE 21

Scalability ¡

21 ¡

slide-22
SLIDE 22

Scalability ¡

22 ¡

Aggr Aggr Src Aggr Aggr Aggr Aggr Sink