Presentation is loading. Please wait.

Presentation is loading. Please wait.

Janus: exploiting parallelism via hindsight

Similar presentations


Presentation on theme: "Janus: exploiting parallelism via hindsight"— Presentation transcript:

1 Janus: exploiting parallelism via hindsight
Roman Manevich Omer Tripp John Field Mooly Sagiv

2 the PMD code analyzer

3 popular open-source code analyzer (~2,000 weekly downloads)
the PMD code analyzer popular open-source code analyzer (~2,000 weekly downloads)

4 the PMD code analyzer popular open-source code analyzer (~2,000 weekly downloads) scans source files modularly => parallelization opportunity

5 the main loop of PMD (simplified)

6 the main loop of PMD analyze files in parallel

7 the main loop of PMD but.. (shared as local)

8 the main loop of PMD hmm.. can’t we “localize” ctx?

9 the main loop of PMD not so fast.. (happens sometimes, deep down the stack)

10 the main loop of PMD no cloning =>

11 the main loop of PMD reuse

12 the main loop of PMD to summarize..

13 the main loop of PMD to summarize.. available parallelism

14 the main loop of PMD to summarize.. available parallelism
missed by write-set approach

15 Janus: sequence-based detection
/* offline */

16 Janus: sequence-based detection
/* offline */ T1 ctx.sourceCodeFilename = …; String fname=ctx.sourceCodeFilename; T2

17 Janus: sequence-based detection
/* offline */ T1 ctx.sourceCodeFilename = …; String fname=ctx.sourceCodeFilename; T2

18 Janus: sequence-based detection
/* offline */ T1 ctx.sourceCodeFilename = …; ctx.setAttribute(s, …); T2 … = ctx.getAttribute(s);

19 Janus: sequence-based detection
/* offline */ T1 ctx.sourceCodeFilename = …; ctx.setAttribute(s, …); T2 … = ctx.getAttribute(s);

20 Janus: sequence-based detection
/* offline */ T1 ctx.sourceCodeFilename = …; ctx.setAttribute(s, …); T2 … = ctx.getAttribute(s);

21 the main loop of PMD in paper: more real-world examples
more coding patterns encouraging refined conflict detection

22

23 running example Reverse-Delete MST G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’

24 running example ordered Reverse-Delete MST G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’

25 running example heavy Reverse-Delete MST G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’

26 running example identity if edge restored (available parallelism)
Reverse-Delete MST G’ = G (e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’

27 take I: blind parallelism
Reverse-Delete MST G’ = G (e1 … en) = SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’ // broken  but fast  parallel for Give a concrete example.

28 take II: write-set speculation
/* with boosting */ Reverse-Delete MST G’ = G (e1 … en)= SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’ Before we jump to boosting, we might want to talk about the concrete write-set approach. @atomic // exploit graph semantics: node ≈ location

29 take II: write-set speculation
/* with boosting */ can we exploit the available parallelism with this approach?

30 the write-set approach in action
G: v1 v2 u T1 T2 Replace directed edges with lines.

31 the write-set approach in action
G: v1 v2 u T1 T2 RemoveEdge(u,v1) RemoveEdge(u,v2)

32 the write-set approach in action
G: v1 v2 u T1 T2 RemoveEdge(u,v1) RemoveEdge(u,v2)

33 the write-set approach in action
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2)

34 the write-set approach in action
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2)

35 the write-set approach in action
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b RemoveEdge(u,v2) b = HasPath(u,v2) test b

36 the write-set approach in action
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2)

37 the write-set approach in action
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2)

38 take III: online commutativity checking
/* with boosting */ Reverse-Delete MST G’ = G (e1 … en)= SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’ @atomic // full commutativity checking

39 precise checking in action
v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2)

40 precise checking in action
v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2)

41 precise checking in action
v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1) RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2) RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2) RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1)

42 precise checking in action
v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1) RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2) RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2) RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1)

43 but.. can we really afford this?
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2)

44 but.. can we really afford this?
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) expensive instrumentation

45 but.. can we really afford this?
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) + expensive instrumentation

46 but.. can we really afford this?
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) + expensive instrumentation expensive conflict detection

47 but.. can we really afford this?
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) + expensive instrumentation expensive conflict detection

48 but.. can we really afford this?
G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) + expensive instrumentation expensive conflict detection poor performance 

49 take III: Janus /* with boosting */ Reverse-Delete MST G’ = G
(e1 … en)= SortEdgesByDecreasingWeight() for i=1 … n G’.RemoveEdge(ei) if (!G’.HasPath(ei.u, ei.v)) G’.AddEdge(ei) return G’ @atomic // accurate checking utilizing offline data!

50 the Janus approach G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1)
test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2)

51 sequence-based detection
the Janus approach G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) sequence-based detection

52 sequence-based detection
the Janus approach G: v1 v2 u T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) sequence-based detection => accurate

53 the Janus approach => accurate G: v1 v2 u T1 T2 RemoveEdge(u,v1)
b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) sequence-based detection => accurate candidate sequences learned ahead of production runs, in profiling

54 the Janus approach => accurate G: v1 v2 u T1 T2 RemoveEdge(u,v1)
b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) sequence-based detection => accurate candidate sequences learned ahead of production runs, in profiling commutativity testing done offline

55 the Janus approach => accurate => cheap G: v1 v2 u T1 T2
RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) sequence-based detection => accurate candidate sequences gleaned ahead of production runs, in profiling => cheap commutativity testing done offline

56

57 the Janus flow offline

58 find candidate sequences via profiling
the Janus flow find candidate sequences via profiling *ST runs *single locations offline

59 low instrumentation overhead
the Janus flow find candidate sequences via profiling *ST runs *single locations offline low instrumentation overhead

60 offline the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity offline

61 offline the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline

62 cheap conflict detection
the Janus flow find candidate sequences via profiling *ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline cheap conflict detection

63 offline the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline

64 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline online

65 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline consult sequence cache when attempting to commit a transaction online

66 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline consult sequence cache when attempting to commit a transaction perform write-set detection miss online

67 online the Janus flow soundness
consult sequence cache when attempting to commit a transaction perform write-set detection miss online

68

69 offline online the Janus flow user input
find candidate sequences via profiling *ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline consult sequence cache when attempting to commit a transaction perform write-set detection miss online

70 the Janus spec: data n1:v1 n2:v2 n3:v2 n4:v1

71 the Janus spec: data n1:v1 n2:v2 n3:v2 n4:v1 node data n1 v1 …
neighbor node n2 n1 n3 n4:v1

72 the Janus spec: operations
n1:v1 node data n1 V1 n2 v2 n2:v2

73 the Janus spec: operations
n1:v1 node data n1 V1 n2 v2 n2:v2 public void addnode(n) { nodes.add(n); }

74 the Janus spec: operations
n1:v1 node data n1 V1 n2 v2 n2:v2 public void addnode(n) { nodes.add(n); } insert <n.d,n> into “nodes”

75 the Janus spec: operations
n1:v1 node data n1 V1 n2 v2 n2:v2 public void addnode(n) { nodes.add(n); } insert <n.d,n> into “nodes” n1:v1 n2:v2 n.d:n

76 the Janus spec: operations
n1:v1 node data n1 V1 n2 v2 n2:v2 public void addnode(n) { nodes.add(n); } insert <n.d,n> into “nodes” n1:v1 node data n1 v1 n2 v2 n n.d n2:v2 n.d:n

77 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline consult sequence cache when attempting to commit a transaction perform write-set detection miss online

78 sequence mining G: v1 v2 u Explain that per-location sequences are mined, the motivating being to be able to utilize the write-set instrumentation scheme.

79 sequence mining G: v1 v2 u G’ = G

80 sequence mining G: v1 v2 u G’ = G
(e1 … en) = SortEdgesByDecreasingWeight()

81 sequence mining G: v1 v2 u G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() T1 RemoveEdge(u,v1)

82 sequence mining G: v1 v2 u G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() T1 RemoveEdge(u,v1) b = HasPath(u,v1)

83 RemoveEdge/T1; HasPath/T1
sequence mining G: v1 v2 u G’ = G (e1 … en) = SortEdgesByDecreasingWeight() T1 RemoveEdge(u,v1) b = HasPath(u,v1) RemoveEdge/T1; HasPath/T1

84 RemoveEdge/T1; HasPath/T1
sequence mining G: v1 v2 u G’ = G (e1 … en) = SortEdgesByDecreasingWeight() T1 RemoveEdge(u,v1) b = HasPath(u,v1) test b RemoveEdge/T1; HasPath/T1

85 RemoveEdge/T1; HasPath/T1
sequence mining G: v1 v2 u G’ = G (e1 … en) = SortEdgesByDecreasingWeight() T1 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge/T1; HasPath/T1

86 RemoveEdge/T1; HasPath/T1; AddEdge/T1
sequence mining G: v1 v2 u G’ = G (e1 … en) = SortEdgesByDecreasingWeight() T1 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge/T1; HasPath/T1; AddEdge/T1

87 RemoveEdge/T1; HasPath/T1; AddEdge/T1
sequence mining G: v1 v2 u G’ = G (e1 … en) = SortEdgesByDecreasingWeight() T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) RemoveEdge/T1; HasPath/T1; AddEdge/T1

88 RemoveEdge/T1; HasPath/T1; AddEdge/T1
sequence mining G: v1 v2 u G’ = G (e1 … en) = SortEdgesByDecreasingWeight() T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) RemoveEdge/T1; HasPath/T1; AddEdge/T1 RemoveEdge/T2

89 RemoveEdge/T1; HasPath/T1; AddEdge/T1
sequence mining G: v1 v2 u G’ = G (e1 … en) = SortEdgesByDecreasingWeight() T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) RemoveEdge/T1; HasPath/T1; AddEdge/T1 RemoveEdge/T2

90 sequence mining G: v1 v2 u G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b RemoveEdge/T1; HasPath/T1; AddEdge/T1 RemoveEdge/T2; HasPath/T2

91 sequence mining G: v1 v2 u G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) RemoveEdge/T1; HasPath/T1; AddEdge/T1 RemoveEdge/T2; HasPath/T2

92 sequence mining G: v1 v2 u G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) RemoveEdge/T1; HasPath/T1; AddEdge/T1 RemoveEdge/T2; HasPath/T2; AddEdge/T2

93 sequence mining G: v1 v2 u G’ = G
(e1 … en) = SortEdgesByDecreasingWeight() T1 T2 RemoveEdge(u,v1) b = HasPath(u,v1) test b AddEdge(u,v1) RemoveEdge(u,v2) b = HasPath(u,v2) test b AddEdge(u,v2) return G’ RemoveEdge/T1; HasPath/T1; AddEdge/T1 RemoveEdge/T2; HasPath/T2; AddEdge/T2

94 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline consult sequence cache when attempting to commit a transaction perform write-set detection miss online

95 commutativity checking
RemoveEdge(u,v1); HasPath(u,v1); AddEdge(u,v1) RemoveEdge(u,v2); HasPath(u,v2); AddEdge(u,v2)

96 commutativity checking
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z)

97 commutativity checking
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) ɸ0 = encode(G) ɸ1 = ɸ0 ˄ {x,y} ϵ “edges” ɸk = ɸk-1 ˄ {x,y} ϵ “edges” ɸk+1 = ɸk ˄ {x,y} ϵ “edges” ɸm = ɸm-1 ˄ {x,y} ϵ “edges” ψ0 = encode(G) ψ1 = ψ0 ˄ {x,z} ϵ “edges” ψk = ψk-1 ˄ {x,z} ϵ “edges” ψk+1 = ψk ˄ {x,y} ϵ “edges” ψm = ψm-1 ˄ {x,y} ϵ “edges”

98 commutativity checking
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) ɸ0 = encode(G) ɸ1 = ɸ0 ˄ {x,y} ϵ “edges” ɸk = ɸk-1 ˄ {x,y} ϵ “edges” ɸk+1 = ɸk ˄ {x,y} ϵ “edges” ɸm = ɸm-1 ˄ {x,y} ϵ “edges” ψ0 = encode(G) ψ1 = ψ0 ˄ {x,z} ϵ “edges” ψk = ψk-1 ˄ {x,z} ϵ “edges” ψk+1 = ψk ˄ {x,y} ϵ “edges” ψm = ψm-1 ˄ {x,y} ϵ “edges” test: ¬(ѱ ≡ ɸ)

99 commutativity checking
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) in paper: encoding rules “projection” : sound commutativity checking for sequences induced by individual memory locations ɸ0 = encode(G) ɸ1 = ɸ0 ˄ {x,y} ϵ “edges” ɸk = ɸk-1 ˄ {x,y} ϵ “edges” ɸk+1 = ɸk ˄ {x,y} ϵ “edges” ɸm = ɸm-1 ˄ {x,y} ϵ “edges” ψ0 = encode(G) ψ1 = ψ0 ˄ {x,z} ϵ “edges” ψk = ψk-1 ˄ {x,z} ϵ “edges” ψk+1 = ψk ˄ {x,y} ϵ “edges” ψm = ψm-1 ˄ {x,y} ϵ “edges” test: ¬(ѱ ≡ ɸ)

100 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline consult sequence cache when attempting to commit a transaction perform write-set detection miss online

101 generalization S1= S2= RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y)
RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) S2=

102 generalization S1= S2= [S1 S2]G // “concrete” seq.s commute
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) S1= RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) S2= [S1 S2]G // “concrete” seq.s commute

103 generalization S1= S2= [S1 S2]G // “concrete” seq.s commute
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) S1= RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) S2= [S1 S2]G // “concrete” seq.s commute S1(G) = S1∙S1(G) // idempotent S2(G) = S2∙S2(G) // idempotent

104 generalization S1= S2= [S1 S2]G // “concrete” seq.s commute
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) S1= RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) S2= [S1 S2]G // “concrete” seq.s commute S1(G) = S1∙S1(G) // idempotent S2(G) = S2∙S2(G) // idempotent

105 generalization S1= S2= [S1 S2]G // “concrete” seq.s commute
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) S1= RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) S2= [S1 S2]G // “concrete” seq.s commute S1(G) = S1∙S1(G) // idempotent S2(G) = S2∙S2(G) // idempotent [S1+ S2+]G // Kleene-cross generalization

106 generalization + + S1= S2= [S1 S2]G // “concrete” seq.s commute
RemoveEdge(x,y); HasPath(x,y); AddEdge(x,y) S1= + RemoveEdge(x,z); HasPath(x,z); AddEdge(x,z) S2= [S1 S2]G // “concrete” seq.s commute S1(G) = S1∙S1(G) // idempotent S2(G) = S2∙S2(G) // idempotent [S1+ S2+]G // Kleene-cross generalization

107 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences specialized spec offline consult sequence cache when attempting to commit a transaction perform write-set detection miss online

108 specialized commutativity spec
state operation

109 specialized commutativity spec
state operation any AddEdge(x,z)/ff AddEdge(x,y)/tt

110 specialized commutativity spec
state operation any AddEdge(x,z)/ff AddEdge(x,y)/tt HasPath(z,w)/tt AddEdge(x,y)/ff

111 specialized commutativity spec
state operation any AddEdge(x,z)/ff AddEdge(x,y)/tt HasPath(z,w)/tt AddEdge(x,y)/ff

112 specialized commutativity spec
state operation any AddEdge(x,z)/ff AddEdge(x,y)/tt HasPath(z,w)/tt AddEdge(x,y)/ff [ RemoveEdge(x,z)/tt; HasPath(x,z)/ff; AddEdge(x,z)/tt ]+ [ RemoveEdge(x,y)/tt; HasPath(x,y)/ff; AddEdge(x,y)/tt ]+

113 specialized commutativity spec
state operation any AddEdge(x,z)/ff AddEdge(x,y)/tt HasPath(z,w)/tt AddEdge(x,y)/ff [ RemoveEdge(x,z)/tt; HasPath(x,z)/ff; AddEdge(x,z)/tt ]+ [ RemoveEdge(x,y)/tt; HasPath(x,y)/ff; AddEdge(x,y)/tt ]+ tailored for given application

114 offline online the Janus flow find candidate sequences via profiling
*ST runs *single locations test sequences for commutativity cache (generalized version) of commutative sequences offline consult sequence cache when attempting to commit a transaction perform write-set detection miss online

115 parallelization protocol
shared state [k] a1 a2 . an privatized state [k] b1 b2 . bm shared state [k+1] privatized state [k’] shared state [k+2] (a1 … an) ∙ (b1 … bm) Sk ≡ (b1 … bm) ∙ (a1 … an) Sk

116 parallelization protocol
shared state [k] a1 a2 . an privatized state [k] b1 b2 . bm shared state [k+1] privatized state [k’] shared state [k+2] (a1 … an) ∙ (b1 … bm) Sk ≡ (b1 … bm) ∙ (a1 … an) Sk

117 parallelization protocol
shared state [k] privatized state [k] shared state [k+1] privatized state [k’] shared state [k+2] replay on shared state bi shared state [k+3]

118 parallelization protocol
shared state [k] a1 a2 . an privatized state [k] b1 b2 . bm shared state [k+1] privatized state [k’] shared state [k+2] (a1 … an) ∙ (b1 … bm) Sk ≡ (b1 … bm) ∙ (a1 … an) Sk

119 parallelization protocol
shared state [k] privatized state [k+2] shared state [k+1] retry shared state [k+2]

120 parallel reverse-delete MST

121 parallel reverse-delete MST

122 parallel reverse-delete MST

123 parallel reverse-delete MST

124 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1)

125 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1)

126 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2)

127 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2)

128 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2) RemoveEdge(u,v3) HasPath(u,v3) AddEdge(u,v3)

129 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v3) HasPath(u,v3) AddEdge(u,v3) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2) ?

130 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v3) HasPath(u,v3) AddEdge(u,v3) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2) x.f = y; || z = x.f;

131 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v3) HasPath(u,v3) AddEdge(u,v3) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2) dope!

132 parallel reverse-delete MST
b state operation any [ RemoveEdge(x,z)/tt; HasPath(x,z)/ff; AddEdge(x,z)/tt ]+ [ RemoveEdge(x,y)/tt; HasPath(x,y)/ff; AddEdge(x,y)/tt ]+ RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v3) HasPath(u,v3) AddEdge(u,v3) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2)

133 parallel reverse-delete MST
RemoveEdge(u,v1) HasPath(u,v1) AddEdge(u,v1) RemoveEdge(u,v3) HasPath(u,v3) AddEdge(u,v3) RemoveEdge(u,v2) HasPath(u,v2) AddEdge(u,v2) that’s better..

134

135 benchmarks description name
utility for synchronizing pairs of directories JFileSync greedy graph-coloring algorithm JGraphT-1 (coloring) saturation-degree node-ordering algorithm for heuristic graph coloring JGraphT-2 (ordering) Java source code analyzer PMD machine-learning library for data-mining tasks Weka

136 JGraphT-1 JGraphT-2 speedup PMD JFileSync Weka

137 retries JGraphT-1 JGraphT-2 PMD JFileSync Weka

138 misses W/ seq. abstraction W/O seq. abstraction JGraphT-2 JGraphT-1
JFileSync PMD Weka W/ seq. abstraction W/O seq. abstraction

139 conclusions profiling is useful for speculation
prevalent behaviors (dependencies) => effective specialization speculation = safety net Janus enables practical accuracy boosting lifts commutativity checking to sequences of operations runtime overhead comparable to write-set approach

140


Download ppt "Janus: exploiting parallelism via hindsight"

Similar presentations


Ads by Google