Knowledge Discovery Toolbox kdt.sourceforge.net Our - - PowerPoint PPT Presentation

knowledge discovery toolbox
SMART_READER_LITE
LIVE PREVIEW

Knowledge Discovery Toolbox kdt.sourceforge.net Our - - PowerPoint PPT Presentation

Adam Lugowski Knowledge Discovery Toolbox kdt.sourceforge.net Our users: Domain Experts 2 1 4 Build 3 Cull input Interpret relevant graph


slide-1
SLIDE 1

Knowledge ¡ Discovery ¡ Toolbox ¡

kdt.sourceforge.net ¡

Adam ¡Lugowski ¡

slide-2
SLIDE 2

Our ¡users: ¡Domain ¡Experts ¡ KDT ¡

Data ¡ filtering ¡ technologies ¡ Build ¡ input ¡ graph ¡ Analyze ¡ graph ¡ Cull ¡ relevant ¡ data ¡ Interpret ¡ results ¡ Graph ¡ viz ¡ engine ¡ 3 ¡ 2 ¡ 1 ¡ 4 ¡

slide-3
SLIDE 3

!"#$%&'( )*+,*-%-'( .#",/(*0( )12&'%#&( 3"#4*5( )12&'%#6-$( 7-,2'(.#",/(

Example ¡workflow ¡

slide-4
SLIDE 4

How ¡to ¡target ¡Domain ¡Experts? ¡

  • Conceptually ¡simple ¡
  • Customizable ¡
  • High ¡Performance ¡
slide-5
SLIDE 5

Domain ¡Experts ¡ Algorithm ¡Experts ¡ HPC ¡Experts ¡

slide-6
SLIDE 6

centrality(‘approxBC’) ¡ pageRank ¡ . ¡. ¡. ¡ cluster(‘Markov’) ¡ contract ¡

Complex ¡methods ¡

  • SpMV, ¡SpMV_SemiRing ¡
  • SpGEMM, ¡SpGEMM_SemiRing ¡

Sparse-­‑matrix ¡classes/methods ¡

(e.g., ¡Apply, ¡EWiseApply, ¡Reduce) ¡

Underlying ¡infrastructure ¡(Combinatorial ¡BLAS) ¡ Building ¡blocks ¡

DiGraph ¡ Vec ¡ Mat ¡

  • bfsTree,neighbor ¡
  • degree,subgraph ¡
  • load,UFget ¡
  • +, ¡-­‑, ¡sum, ¡scale ¡
  • SpMV ¡
  • SpGEMM ¡
  • load, ¡eye ¡
  • reduce, ¡scale ¡
  • +, ¡[] ¡
  • max, ¡norm,sort ¡
  • abs, ¡any, ¡ceil ¡ ¡
  • range, ¡ones ¡
  • +,-­‑,*,/,>,==,&,[] ¡
slide-7
SLIDE 7

Why ¡(sparse) ¡adjacency ¡matrices? ¡

TradiHonal ¡graph ¡ computaHons ¡ Graphs ¡in ¡the ¡language ¡of ¡ linear ¡algebra ¡ Data ¡driven, ¡ unpredictable ¡communicagon ¡ Fixed ¡communicagon ¡paherns ¡ Irregular ¡and ¡unstructured, ¡ poor ¡locality ¡of ¡reference ¡ Operagons ¡on ¡matrix ¡blocks ¡ exploit ¡memory ¡hierarchy ¡ Fine ¡grained ¡data ¡accesses, ¡ dominated ¡by ¡latency ¡ Coarse ¡grained ¡parallelism, ¡ bandwidth ¡limited ¡

slide-8
SLIDE 8

!"#$%&'( )*+,*-%-'( .#",/(*0( )12&'%#&( 3"#4*5( )12&'%#6-$( 7-,2'(.#",/(

Example ¡workflow ¡

slide-9
SLIDE 9
  • 1. ¡Largest ¡

Component ¡ # ¡the ¡variable ¡bigG ¡contains ¡the ¡input ¡graph ¡ # ¡find ¡and ¡select ¡the ¡giant ¡component ¡ comp ¡= ¡bigG.connComp() ¡ giantComp ¡= ¡comp.hist().argmax() ¡ G ¡= ¡bigG.subgraph(comp==giantComp) ¡

slide-10
SLIDE 10
  • 2. ¡Markov ¡

Clustering ¡ # ¡cluster ¡the ¡graph ¡ clus ¡= ¡G.cluster(’Markov’) ¡

slide-11
SLIDE 11
  • 3. ¡Graph ¡
  • f ¡Clusters ¡

# ¡contract ¡the ¡clusters ¡ smallG ¡= ¡G.contract(clus) ¡

slide-12
SLIDE 12

# ¡the ¡variable ¡bigG ¡contains ¡the ¡input ¡graph ¡ # ¡find ¡and ¡select ¡the ¡giant ¡component ¡ comp ¡= ¡bigG.connComp() ¡ giantComp ¡= ¡comp.hist().argmax() ¡ G ¡= ¡bigG.subgraph(comp==giantComp) ¡ # ¡cluster ¡the ¡graph ¡ clus ¡= ¡G.cluster(’Markov’) ¡ # ¡contract ¡the ¡clusters ¡ smallG ¡= ¡G.contract(clus) ¡

Example ¡workflow ¡KDT ¡code ¡

slide-13
SLIDE 13

!" #" $" %" &" '" (" )" #$$'" $'!!" '!&#"

GTEPS Number of cores

*+,"

  • ./01234"

BFS ¡on ¡a ¡Scale ¡29 ¡RMAT ¡graph ¡

(500M ¡vergces, ¡8B ¡edges) ¡

Machine: ¡NERSC’s ¡Hopper ¡

slide-14
SLIDE 14

Breadth-­‑First ¡Search ¡

1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡

G ¡

1 2 3 4 7 6 5

slide-15
SLIDE 15

1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡

G ¡

1 2 3 4 7 6 5

7 ¡

fin ¡

distance ¡1 ¡from ¡vertex ¡7 ¡

Breadth-­‑First ¡Search ¡

slide-16
SLIDE 16

Breadth-­‑First ¡Search ¡

1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡

G ¡

1 2 3 4 7 6 5

7 ¡

fin ¡

× ¡ = ¡

7 ¡ 7 ¡ 7 ¡

fout ¡

distance ¡1 ¡from ¡vertex ¡7 ¡

slide-17
SLIDE 17

Breadth-­‑First ¡Search ¡

1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡

G ¡

1 2 3 4 7 6 5

3 ¡ 4 ¡ 5 ¡

fin ¡

distance ¡2 ¡from ¡vertex ¡7 ¡

slide-18
SLIDE 18

Breadth-­‑First ¡Search ¡

1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡ 1 ¡

G ¡

1 2 3 4 7 6 5

3 ¡ 4 ¡ 5 ¡

fin ¡

× ¡ = ¡

4 ¡ 4 ¡ 5 ¡

fout ¡

distance ¡2 ¡from ¡vertex ¡7 ¡

slide-19
SLIDE 19

# initialization parents = Vec(self.nvert(), -1, sparse=False) frontier = Vec(self.nvert(), sparse=True) parents[root] = root frontier[root] = root # 1st frontier is just the root # the semiring mult and add ops simply return the 2nd arg semiring = sr((lambda x,y: y), (lambda x,y: y)) # loop over frontiers while frontier.nnn() > 0: frontier.spRange() # frontier[i] = i self.e.SpMV(frontier, semiring=semiring, inPlace=True) # remove already discovered vertices from the frontier. frontier.eWiseApply(parents, op=(lambda f,p: f), doOp=(lambda f,p: p == -1), inPlace=True) # update the parents parents[frontier] = frontier

KDT ¡BFS ¡rougne ¡

slide-20
SLIDE 20

BFS ¡comparison ¡with ¡PBGL ¡

Performance ¡comparison ¡of ¡KDT ¡and ¡PBGL ¡breadth-­‑first ¡search. ¡The ¡reported ¡ numbers ¡are ¡in ¡MegaTEPS, ¡or ¡106 ¡traversed ¡edges ¡per ¡second. ¡The ¡graphs ¡are ¡ Graph500 ¡RMAT ¡graphs ¡with ¡2scale ¡vergces ¡and ¡16*2scale ¡edges. ¡ Core ¡Count ¡ (Machine) ¡ Code ¡ Problem ¡Size ¡ Scale ¡19 ¡ Scale ¡22 ¡ Scale ¡24 ¡ 4 ¡ (Neumann) ¡ PBGL ¡ 3.8 ¡ 2.5 ¡ 2.1 ¡ KDT ¡ 8.9 ¡ 7.2 ¡ 6.4 ¡ 16 ¡ (Neumann) ¡ PBGL ¡ 8.9 ¡ 6.3 ¡ 5.9 ¡ KDT ¡ 33.8 ¡ 27.8 ¡ 25.1 ¡ 128 ¡ (Carver) ¡ PBGL ¡ 25.9 ¡ 39.4 ¡ KDT ¡ 237.5 ¡ 262.0 ¡ 256 ¡ (Carver) ¡ PBGL ¡ 22.4 ¡ 37.5 ¡ KDT ¡ 327.6 ¡ 473.4 ¡

slide-21
SLIDE 21

Connecgvity ¡only. ¡

Plain ¡graph ¡

slide-22
SLIDE 22

(T, F, 0) (F, T, 1) (T, F, 3) (T, F, 2) (T, T, 3) (T, T, 1) (F, T, 1) (F, T, 4) (T, T, 5) (T, F, 0) (T, F, 2) (F, F, 0)

Edge ¡Ahributes ¡(semangc ¡graph) ¡ ¡

class edge_attr: isText isPhoneCall weight

slide-23
SLIDE 23

(F, T, 1) (T, F, 3) (T, F, 2) (T, T, 3) (T, T, 1) (F, T, 1) (F, T, 4) (T, T, 5) (T, F, 2)

Edge ¡Ahribute ¡Filter ¡

class edge_attr: isText isPhoneCall weight

G.addEFilter( lambda e: e.weight > 0)

slide-24
SLIDE 24

Edge ¡Ahribute ¡Filter ¡Stack ¡

class edge_attr: isText isPhoneCall weight

(F, T, 1) (T, T, 3) (T, T, 1) (F, T, 1) (F, T, 4) (T, T, 5)

G.addEFilter( lambda e: e.weight > 0) G.addEFilter( lambda e: e.isPhoneCall)

slide-25
SLIDE 25

Filter ¡implementagon ¡details ¡

  • Filter ¡defined ¡as ¡a ¡unary ¡predicate ¡

– operates ¡on ¡edge ¡or ¡vertex ¡value ¡ – wrihen ¡in ¡Python ¡ – predicates ¡checked ¡in ¡order ¡they ¡were ¡added ¡

  • Each ¡KDT ¡object ¡maintains ¡a ¡stack ¡of ¡filter ¡

predicates ¡

– all ¡operagons ¡respect ¡filter ¡

  • enables ¡filter-­‑ignorant ¡algorithm ¡design ¡
  • enables ¡algorithm ¡designers ¡to ¡use ¡filters ¡
slide-26
SLIDE 26

Two ¡filter ¡modes ¡

  • On-­‑The-­‑Fly ¡filters ¡

– predicate ¡checked ¡each ¡gme ¡an ¡operagon ¡touches ¡ vertex ¡or ¡edge ¡

  • Materialized ¡filters ¡

– make ¡copy ¡of ¡graph ¡which ¡excludes ¡filtered ¡ elements ¡

  • predicate ¡checked ¡only ¡once ¡for ¡each ¡element ¡
slide-27
SLIDE 27

Performance ¡of ¡On-­‑The-­‑Fly ¡filter ¡

  • vs. ¡Materialized ¡filter ¡
  • For ¡restricgve ¡filter ¡

– OTF ¡can ¡be ¡cheaper ¡since ¡fewer ¡edges ¡are ¡touched ¡

  • corpus ¡can ¡be ¡huge, ¡but ¡only ¡traverse ¡small ¡pieces ¡
  • For ¡non-­‑restricgve ¡filter ¡

– OTF ¡Saves ¡space ¡(no ¡need ¡to ¡keep ¡two ¡large ¡copies) ¡ – OTF ¡Makes ¡each ¡operagon ¡more ¡computagonally ¡ expensive ¡

slide-28
SLIDE 28

texts ¡and ¡phone ¡calls ¡

# ¡draw ¡graph ¡ draw(G) ¡ # ¡Each ¡edge ¡has ¡this ¡a:ribute: ¡ class ¡edge_ahr: ¡ ¡ ¡ ¡ ¡isText ¡ ¡ ¡ ¡ ¡isPhoneCall ¡ ¡ ¡ ¡ ¡weight ¡

slide-29
SLIDE 29

Betweenness ¡Centrality ¡

bc ¡= ¡G.centrality(“approxBC”) ¡ # ¡draw ¡graph ¡with ¡node ¡sizes ¡ # ¡propor=onal ¡to ¡BC ¡score ¡ draw(G, ¡bc) ¡

slide-30
SLIDE 30

Betweenness ¡Centrality ¡on ¡texts ¡

# ¡BC ¡only ¡on ¡text ¡edges ¡ G.addEFilter( ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡lambda ¡e: ¡e.isText) ¡ bc ¡= ¡G.centrality(“approxBC”) ¡ # ¡draw ¡graph ¡with ¡node ¡sizes ¡ # ¡propor=onal ¡to ¡BC ¡score ¡ draw(G, ¡bc) ¡

slide-31
SLIDE 31

Betweenness ¡Centrality ¡on ¡calls ¡

# ¡BC ¡only ¡on ¡phone ¡call ¡edges ¡ G.addEFilter( ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡lambda ¡e: ¡e.isPhoneCall) ¡ bc ¡= ¡G.centrality(“approxBC”) ¡ # ¡draw ¡graph ¡with ¡node ¡sizes ¡ # ¡propor=onal ¡to ¡BC ¡score ¡ draw(G, ¡bc) ¡

slide-32
SLIDE 32

SEJITS ¡

  • Selecgve ¡Embedded ¡Just-­‑In-­‑Time ¡Specializagon ¡
  • 1. Take ¡Python ¡code ¡
  • 2. Translate ¡it ¡to ¡equivalent ¡C++ ¡code ¡
  • 3. Compile ¡with ¡GCC ¡
  • 4. Call ¡compiled ¡version ¡instead ¡of ¡Python ¡version ¡

The ¡way ¡to ¡make ¡Python ¡fast ¡is ¡to ¡not ¡use ¡Python. ¡

  • ­‑-­‑ ¡Me ¡
slide-33
SLIDE 33

BFS ¡with ¡SEJITS ¡

!"#$% !"$!% &"!!% #"!!% '"!!% ("!!% &)"!!% *#"!!% )'"!!% &#&% #$)% $+)% &!#'% #!#$% !"#$%&'(%)*"% +,*-".%/0%!12%3./4"55"5% ,-.% /012./3,-.% 456789:/%

Time ¡(in ¡seconds) ¡for ¡a ¡single ¡BFS ¡iteragon ¡on ¡Scale ¡25 ¡RMAT ¡(33M ¡vergces, ¡500M ¡ edges) ¡with ¡10% ¡of ¡elements ¡passing ¡filter. ¡Machine ¡is ¡NERSC’s ¡Hopper. ¡

slide-34
SLIDE 34

!" #" $" %&" '!" &#" %!$" !(&" %" !" #" $" %&" '!" &#" !"#$%&'(%)*"% +,*-".%/0%!12%3./4"55"5% )*+" ,-./+,0)*+" 1234567,"

BFS ¡with ¡SEJITS ¡

Time ¡(in ¡seconds) ¡for ¡a ¡single ¡BFS ¡iteragon ¡on ¡Scale ¡23 ¡RMAT ¡(8M ¡vergces, ¡130M ¡ edges) ¡with ¡10% ¡of ¡elements ¡passing ¡filter. ¡Machine ¡is ¡Mirasol. ¡

slide-35
SLIDE 35

Roofline ¡

  • A ¡way ¡to ¡find ¡what ¡your ¡bohleneck ¡is ¡
  • MEASURE ¡and ¡PLOT ¡potengal ¡limigng ¡factors ¡

in ¡your ¡exact ¡system ¡and ¡program ¡

– compute ¡power ¡ – RAM ¡stream ¡speed ¡ – RAM ¡random ¡access ¡speed ¡ – disk ¡ – etc ¡

  • Your ¡Roofline ¡is ¡the ¡minimum ¡of ¡your ¡plots ¡
slide-36
SLIDE 36

KDT ¡+ ¡SEJITS ¡Roofline ¡

!" !#" !##" !###" !####" !#####" !$" !#$" !##$"

!"##"$%&'$(')*+,&'-.$/,&&,*'0,.'1,/$%*'

2"#3,.'-,.4,56"#"37'

!".5&$#'89,$%'):';;:<='>?'/$.,&@'

  • 73A$%'BCD'-,.($.45%/,'E$F%*'

1)GHD1IBCD'-,.($.45%/,'E$F%*' J$46EKL1'-,.($.45%/,'E$F%*' CML!'-,.($.45%/,'E$F%*'

Good ¡ (limited ¡by ¡DRAM) ¡ Bad ¡ (Compute ¡limited) ¡

slide-37
SLIDE 37

Is ¡MapReduce ¡any ¡good ¡for ¡graphs? ¡

The ¡prospect ¡of ¡the ¡en=re ¡graph ¡ traversing ¡the ¡cloud ¡fabric ¡for ¡each ¡ MapReduce ¡job ¡is ¡disturbing. ¡

  • ­‑ ¡Jonathan ¡Cohen ¡
slide-38
SLIDE 38

PageRank ¡comparison ¡with ¡Pegasus ¡

Core ¡ Count ¡ Task ¡ Count ¡ Code ¡ Problem ¡Size ¡ Scale ¡19 ¡ Scale ¡21 ¡

  • ­‑ ¡

4 ¡ Pegasus ¡ 2h ¡35m ¡10s ¡ 6h ¡06m ¡10s ¡ 4 ¡

  • ­‑ ¡

KDT ¡ 55s ¡ 7m ¡12s ¡

  • ­‑ ¡

16 ¡ Pegasus ¡ 33m ¡09s ¡ 4h ¡40m ¡08s ¡ 16 ¡

  • ­‑ ¡

KDT ¡ 13s ¡ 1m ¡34s ¡

Performance ¡comparison ¡of ¡KDT ¡and ¡Pegasus ¡PageRank ¡(ε ¡= ¡10−7). ¡The ¡graphs ¡are ¡ Graph500 ¡RMAT ¡graphs. ¡The ¡machine ¡is ¡Neumann, ¡a ¡32-­‑core ¡shared ¡memory ¡ machine ¡with ¡HDFS ¡mounted ¡in ¡a ¡ramdisk. ¡

MapReduce-­‑based ¡

slide-39
SLIDE 39

A ¡Scalability ¡limit ¡for ¡matrix-­‑matrix ¡ mulgplicagon: ¡sqrt(p) ¡

25 50 75 100 125 150 175 200 1 4 9 16 36 64 121 256

MTEPS Number of Cores

Scale-17 Scale-18 Ideal

Million ¡Traversed ¡Edges ¡Per ¡Second ¡in ¡Betweenness ¡Centrality ¡computagon. ¡BC ¡algorithm ¡ is ¡composed ¡of ¡mulgple ¡BFS ¡searches ¡batched ¡together ¡into ¡matrices ¡and ¡using ¡SpGEMM ¡ for ¡traversals. ¡