A Preliminary Study of Compiler Transformations for Graph - - PowerPoint PPT Presentation

a preliminary study of compiler transformations for graph
SMART_READER_LITE
LIVE PREVIEW

A Preliminary Study of Compiler Transformations for Graph - - PowerPoint PPT Presentation

A Preliminary Study of Compiler Transformations for Graph Applications on the EMU System Prasanth Chatarasi and Vivek Sarkar Habanero Extreme Scale Software Research Project Georgia Institute of Technology, Atlanta, USA 1 Prasanth Chatarasi


slide-1
SLIDE 1

CS 6245, Fall 2018 (V.Sarkar)

1

A Preliminary Study of Compiler Transformations for Graph Applications on the EMU System

Prasanth Chatarasi and Vivek Sarkar

Habanero Extreme Scale Software Research Project Georgia Institute of Technology, Atlanta, USA

Prasanth Chatarasi et al, MCHPC 18

slide-2
SLIDE 2

CS 6245, Fall 2018 (V.Sarkar)

2

Introduction – Graph applications

  • Increasing in importance for high-performance

—With the advent of "big data"

  • Random memory access patterns

—Inefficient utilization of memory & cache in CPU and GPU’s

  • Growing interest to innovate architectures

—To handle applications with weak-locality

Prasanth Chatarasi et al, MCHPC 18

slide-3
SLIDE 3

CS 6245, Fall 2018 (V.Sarkar)

3

EMU [Kogge et al. IA3’16]

  • A highly scalable near-memory

multi-processor

—8 nodes à 8 nodelets/node à 4 cores/nodelet à 64 threads/core —Cilk programming model for expressing parallelism

Prasanth Chatarasi et al, MCHPC 18

http://www.emutechnology.com/products/ #lightbox/0/

A Comparison b/w EMU and Xeon

  • n a pointer-chasing benchmark
  • - Hein et al. [IPDPSW’18]
slide-4
SLIDE 4

CS 6245, Fall 2018 (V.Sarkar)

4

1) Key features – Thread migration

  • Automatic thread migrations on

an access to a non-local data

—Computation moves instead of data

  • Benefits of thread migration

—Sparse matrix vector multiply – Kogge et al. [IA3’17] —BFS algorithm – Belviranli et al. [HPEC’18]

Prasanth Chatarasi et al, MCHPC 18

http://www.emutechnology.com/products/ #lightbox/0/

x y z y = x+1 z = y+1 x y z y

slide-5
SLIDE 5

CS 6245, Fall 2018 (V.Sarkar)

5

2) Key features – Remote atomic updates

  • Atomic updates that do NOT

cause a thread migration

—Sends a packet having data and

  • peration to be performed
  • Used when a thread doesn’t

need a return value of atomic

  • peration

—Otherwise, explicit FENCE required to block the thread

Prasanth Chatarasi et al, MCHPC 18

http://www.emutechnology.com/products/ #lightbox/0/

x y z

ATOMIC_ADD (Z, 1) Data:1 Operation: Add

slide-6
SLIDE 6

CS 6245, Fall 2018 (V.Sarkar)

6

Challenges with the EMU system

Prasanth Chatarasi et al, MCHPC 18

  • Overheads from thread migrations, thread creation and

synchronization.

  • We focus on exploring compiler transformations to reduce

the overheads and improve performance

—High-level compiler transformations – Node fusion and Edge flipping —Low-level compiler transformations – Use of remote atomic updates

slide-7
SLIDE 7

CS 6245, Fall 2018 (V.Sarkar)

7

Agenda

  • Introduction
  • Compiler transformations
  • Evaluation

—Conductance —Bellman-Ford’s algorithm for single-source shortest path —Triangle counting

  • Conclusions and future work

Prasanth Chatarasi et al, MCHPC 18

slide-8
SLIDE 8

CS 6245, Fall 2018 (V.Sarkar)

8

1) Node fusion

1: parallel-for(v ∈ vertices) { 2: p1[v] = … 3: } // Implicit barrier 4: parallel-for(v ∈ vertices) { 5: p2[v] = f(p1[v], …) 6: } 1: parallel-for(v ∈ vertices) { 2: p1[v] = … 3: p2[v] = f(p1[v], …) 4: }

Prasanth Chatarasi et al, MCHPC 18

  • Repeated migrations for

—Same property across parallel loops —Different properties of same vertex across parallel loops – Can be reduced with fusing parallel loops Can reduce thread creation and synchronization overhead

slide-9
SLIDE 9

CS 6245, Fall 2018 (V.Sarkar)

9 1: for(t-loop) { 2: parallel-for(v ∈ vertices) 3: for(u ∈ incoming_neighbors(v)) 4: p1[v] = f(p1[u], …); 5: }

2) Edge flipping

Prasanth Chatarasi et al, MCHPC 18

1: for(t-loop) { 2: parallel-for(v ∈ vertices) 3: cont = f(p1[v], …); 4: for(u ∈ outgoing_neighbors(v)) 5: atomic_update(p1[u], cont); 6: }

  • Back and forth migrations

—From a vertex to each of its incoming neighbor vertices – Can be reduced by pushing vertex contribution to its outgoing neighbors

slide-10
SLIDE 10

CS 6245, Fall 2018 (V.Sarkar)

10

Agenda

  • Introduction
  • Compiler transformations
  • Evaluation

—Conductance —Bellman-Ford’s algorithm for single-source shortest path —Triangle counting

  • Conclusions and future work

Prasanth Chatarasi et al, MCHPC 18

slide-11
SLIDE 11

CS 6245, Fall 2018 (V.Sarkar)

11

Experimental setup

  • Evaluation on a single node of the Emu system

—Actual hardware on FPGA

  • Two experimental variants

—Original version of a graph algorithm —Transformed version after manually applying compiler transformations

Prasanth Chatarasi et al, MCHPC 18

slide-12
SLIDE 12

CS 6245, Fall 2018 (V.Sarkar)

12

Graph applications

  • Graph applications

—Conductance —Bellman-Ford’s algorithm for single-source shortest path —Triangle counting – Developed using the MEATBEE framework

  • Input data sets

—RMAT graphs from scale of 6 to 14 as specified by Graph500 – #vertices = !"#$%& – #edges = 16 * #vertices

Prasanth Chatarasi et al, MCHPC 18

https://github.gatech.edu/ehein6/meatbee

slide-13
SLIDE 13

CS 6245, Fall 2018 (V.Sarkar)

13

1) Conductance algorithm

  • Computes a flow from a given partition of graph to others
  • All the parallel loops can be fused to avoid the overheads

Prasanth Chatarasi et al, MCHPC 18

  • Repeated migrations to same

nodelet for the same property from multiple parallel loops

slide-14
SLIDE 14

CS 6245, Fall 2018 (V.Sarkar)

14

Results after node fusion

  • Speedups of up to 2.2x (geometric mean: 1.95x)

—Also, a geometric mean reduction of 6.06% in thread migrations

Prasanth Chatarasi et al, MCHPC 18

0.0 0.8 1.5 2.3 3.0 Scale of RMAT graphs specified by Graph500 6 7 8 9 10 11 12 13 14

1.66 2.06 1.97 2.02 2.08 2.17 2.12 2.01 1.58

Speedup after applying loop fusion

slide-15
SLIDE 15

CS 6245, Fall 2018 (V.Sarkar)

15

2) Bellman-Ford’s algorithm

  • Compute shortest paths from a single source vertex to all the
  • ther vertices in a weighted directed graph
  • Edge flipping followed by remote updates can avoid back and

forth migrations

Prasanth Chatarasi et al, MCHPC 18

Back and forth migration for every incoming neighbor

slide-16
SLIDE 16

CS 6245, Fall 2018 (V.Sarkar)

16

Results after Edge flipping + Remote updates

  • Speedups of up to 3.8x (geometric mean: 1.38x)

—Also, a geometric mean reduction of 36.39% in thread migrations

Prasanth Chatarasi et al, MCHPC 18

0.0 1.0 2.0 3.0 4.0 Scale of RMAT graphs specified by Graph500 6 7 8 9 10 11 12

3.76 1.94 1.80 0.74 0.99 0.83 1.16

Speedup after applying edge-flipping + remote updates

slide-17
SLIDE 17

CS 6245, Fall 2018 (V.Sarkar)

17

3) Triangle counting

  • Computes the number of triangles in a given undirected graph

—Also computes the number of triangles that each node belongs to

  • Regular atomic updates can be replaced with remote updates

Prasanth Chatarasi et al, MCHPC 18

slide-18
SLIDE 18

CS 6245, Fall 2018 (V.Sarkar)

18

Results after using Remote updates

  • Speedups of up to 1.3x (geometric mean: 1.05x)

—Also, a geometric mean reduction of 54.55% in thread migrations

Prasanth Chatarasi et al, MCHPC 18

0.0 0.5 1.0 1.5 Scale of RMAT graphs specified by Graph500 6 7 8 9 10 11 12 13 14

1.01 1.01 1.01 1.03 1.01 1.03 1.26 1.10 1.01

Speedup after using remote atomic updates

slide-19
SLIDE 19

CS 6245, Fall 2018 (V.Sarkar)

19

Conclusions & Future work

  • EMU architecture is a potential choice for graph applications

—But, a careful attention is required to make sure that overheads don’t hurt the benefits —Evaluated compiler transformations for three graph applications

  • Future work

—Systematically explore & evaluate more compiler transformations

Any questions?

Prasanth Chatarasi et al, MCHPC 18

Applications Transformations Conductance Node fusion Bellman-Ford’s algorithm Edge flipping + Remote updates Triangle counting Remote updates

slide-20
SLIDE 20

CS 6245, Fall 2018 (V.Sarkar)

20

Acknowledgements

  • MCHPC’18 Program committee
  • Eric Hein and Jeff Young

—Getting setup with EMU machine and the MEATBEE framework

  • CRNCH center at Georgia Tech

—Rogues gallery

Prasanth Chatarasi et al, MCHPC 18

http://crnch.gatech.edu/rogues-emu