GraphLab: how I understood it with sample code Aapo Kyrola, Carnegie Mellon Univ. Oct 1, 2009.

Slides:



Advertisements
Similar presentations
Exact Inference. Inference Basic task for inference: – Compute a posterior distribution for some query variables given some observed evidence – Sum out.
Advertisements

Matrices, Digraphs, Markov Chains & Their Use by Google Leslie Hogben Iowa State University and American Institute of Mathematics Leslie Hogben Iowa State.
Exact Inference in Bayes Nets
Junction Trees And Belief Propagation. Junction Trees: Motivation What if we want to compute all marginals, not just one? Doing variable elimination for.
WORK STEALING SCHEDULER 6/16/2010 Work Stealing Scheduler 1.
Spark: Cluster Computing with Working Sets
Belief Propagation by Jakob Metzler. Outline Motivation Pearl’s BP Algorithm Turbo Codes Generalized Belief Propagation Free Energies.
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
Graphical models: approximate inference and learning CA6b, lecture 5.
Markov Networks.
DATA MINING LECTURE 12 Link Analysis Ranking Random walks.
Junction Trees: Motivation Standard algorithms (e.g., variable elimination) are inefficient if the undirected graph underlying the Bayes Net contains cycles.
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Task Scheduling and Distribution System Saeed Mahameed, Hani Ayoub Electrical Engineering Department, Technion – Israel Institute of Technology
Reference: Message Passing Fundamentals.
Scaling Distributed Machine Learning with the BASED ON THE PAPER AND PRESENTATION: SCALING DISTRIBUTED MACHINE LEARNING WITH THE PARAMETER SERVER – GOOGLE,
Global Approximate Inference Eran Segal Weizmann Institute.
Group Communication Phuong Hoai Ha & Yi Zhang Introduction to Lab. assignments March 24 th, 2004.
GraphLab A New Parallel Framework for Machine Learning Carnegie Mellon Based on Slides by Joseph Gonzalez Mosharaf Chowdhury.
Key-Key-Value Stores for Efficiently Processing Graph Data in the Cloud Alexander G. Connor Panos K. Chrysanthis Alexandros Labrinidis Advanced Data Management.
Belief Propagation, Junction Trees, and Factor Graphs
Computer vision: models, learning and inference Chapter 10 Graphical Models.
7/14/2015EECS 584, Fall MapReduce: Simplied Data Processing on Large Clusters Yunxing Dai, Huan Feng.
Dreams in a Nutshell Steven Sommer Microsoft Research Institute Department of Computing Macquarie University.
Norman SecureTide Powerful cloud solution to stop spam and threats before it reaches your network.
GraphLab A New Framework for Parallel Machine Learning
Computer vision: models, learning and inference
CSC2535 Spring 2013 Lecture 2a: Inference in factor graphs Geoffrey Hinton.
Carnegie Mellon University GraphLab Tutorial Yucheng Low.
Nachos Phase 1 Code -Hints and Comments
Distributed shared memory. What we’ve learnt so far  MapReduce/Dryad as a distributed programming model  Data-flow (computation as vertex, data flow.
CSE 486/586 CSE 486/586 Distributed Systems Graph Processing Steve Ko Computer Sciences and Engineering University at Buffalo.
Lab 2 Group Communication Farnaz Moradi Based on slides by Andreas Larsson 2012.
The PageRank Citation Ranking: Bringing Order to the Web Lawrence Page, Sergey Brin, Rajeev Motwani, Terry Winograd Presented by Anca Leuca, Antonis Makropoulos.
Java Threads. What is a Thread? A thread can be loosely defined as a separate stream of execution that takes place simultaneously with and independently.
MATRIX MULTIPLY WITH DRYAD B649 Course Project Introduction.
Tool Integration with Data and Computation Grid GWE - “Grid Wizard Enterprise”
Farnaz Moradi Based on slides by Andreas Larsson 2013.
Readings: K&F: 11.3, 11.5 Yedidia et al. paper from the class website
CS533 - Concepts of Operating Systems 1 The Mach System Presented by Catherine Vilhauer.
Carnegie Mellon Yucheng Low Aapo Kyrola Danny Bickson A Framework for Machine Learning and Data Mining in the Cloud Joseph Gonzalez Carlos Guestrin Joe.
Computing Simulation in Orders Based Transparent Parallelizing Pavlenko Vitaliy Danilovich, Odessa National Polytechnic University Burdeinyi Viktor Viktorovych,
1 Mean Field and Variational Methods finishing off Graphical Models – Carlos Guestrin Carnegie Mellon University November 5 th, 2008 Readings: K&F:
Thinking in Parallel – Implementing In Code New Mexico Supercomputing Challenge in partnership with Intel Corp. and NM EPSCoR.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
Belief Propagation and its Generalizations Shane Oldenburger.
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
Data Structures and Algorithms in Parallel Computing
A N I N - MEMORY F RAMEWORK FOR E XTENDED M AP R EDUCE 2011 Third IEEE International Conference on Coud Computing Technology and Science.
Tool Integration with Data and Computation Grid “Grid Wizard 2”
Today Graphical Models Representing conditional dependence graphically
1 Relational Factor Graphs Lin Liao Joint work with Dieter Fox.
1 Chapter 11 Global Properties (Distributed Termination)
Distributed cooperation and coordination using the Max-Sum algorithm
Importance Measures on Nodes Lecture 2 Srinivasan Parthasarathy 1.
Perfect recall: Every decision node observes all earlier decision nodes and their parents (along a “temporal” order) Sum-max-sum rule (dynamical programming):
NCBI Grid Presentation. NCBI Grid Structure NetCache NetSchedule Load Balancer (LBSM) Load Balancer (LBSM) Worker Nodes CGI Gateway.
Concurrent Programming in Java Based on Notes by J. Johns (based on Java in a Nutshell, Learning Java) Also Java Tutorial, Concurrent Programming in Java.
Department of Computer Science, Johns Hopkins University Pregel: BSP and Message Passing for Graph Computations EN Randal Burns 14 November 2013.
Spark Presentation.
Parallel Programming By J. H. Wang May 2, 2017.
PREGEL Data Management in the Cloud
MapReduce Computing Paradigm Basics Fall 2013 Elke A. Rundensteiner
湖南大学-信息科学与工程学院-计算机与科学系
COS 518: Advanced Computer Systems Lecture 12 Mike Freedman
CSCI 5822 Probabilistic Models of Human and Machine Learning
Readings: K&F: 11.3, 11.5 Yedidia et al. paper from the class website
TensorFlow: A System for Large-Scale Machine Learning
Markov Networks.
Mean Field and Variational Methods Loopy Belief Propagation
Presentation transcript:

GraphLab: how I understood it with sample code Aapo Kyrola, Carnegie Mellon Univ. Oct 1, 2009

To test if I got your idea… … I created two imaginary GraphLab sample applications by using imaginary GraphLab Java API Is this how you imagined GraphLab applications would look like?

Technology layers GraphLab GraphLab API – Defined and maintained by us GraphLab Engine – Reference implementation done by us – Others encouraged to implement their own GraphLab API – Defined and maintained by us GraphLab Engine – Reference implementation done by us – Others encouraged to implement their own OpenGL OpenGL API – Maintained by Khronos group glVertex3f(a,b,c,d) glTransform(…) OpenGL graphics card drivers – By Nvidia, ATI, …; interface with their hardware OpenGL API – Maintained by Khronos group glVertex3f(a,b,c,d) glTransform(…) OpenGL graphics card drivers – By Nvidia, ATI, …; interface with their hardware

Contents 1.GraphLab sample code for belief propagation –based inference ML practitioner’s (end-user’s) point of view What happens in the Engine? 2.Sample code for stochastic matrix eigenvector calculation by iteration Issue with syncs and aggregation functions

Note about BP Bishop’s text uses BP on bipartite graph (variable + factor nodes), while Keller’s book uses Cluster Factor graphs – I will use Keller’s representation because it is simpler

Sample program User has huge Bayes network that models weather in USA He knows it is 37F in Philadelphia and it rained yesterday in Pittsburgh, and it is October (evidence) – What is the probability of rain in Pittsburgh today? See main() below (no GraphLab –stuff here yet)

Initialization of BP Create cluster factor graph with special nodes for Belief Propagation (have storage for messages; edges contain the shared variables between factors) This implicitly marks each node ‘dirty’ (which the engine will add to task queue) BayesNetwork and ClusterFactorGraph are classes defined by the GraphLab API or/and extend some more abstract Graph class

Node function (kernel) To run the distributed BP algorithm, we need to define function (kernel) that runs on each factor node --- always when the factor is “dirty” (task queue is not visible?) Only if message changes significantly, do we send it. Sending a message flags recipient as dirty -> it will be added to task queue. Note: edge might be remote or local, depending on graph partitioning. Kernel may or may not care about it. (For example, threshold could be higher for remote edges?)

Executing the engine User can execute the algorithm on different GraphLab implementations – Data cluster version, multicore version, GPU version, DNA computer version, Quantum computer etc. Advanced users can customize graph partitioning algorithm, scheduling priority, timeout etc. – For example, loopy BP may not converge everywhere, but still be usable?? Need timeout our relaxed convergence criteria. After lightning fast computation, we have calibrated belief network. We can use this to efficiently ask marginal distributions.

What Engine does? 1.Client sends the graph data and functions to be run to the Computation Parent 1.How code is delivered? Good question. In Java, easy to send class files. 2.Graph is partitioned to logical partitions (minimizing of links between partitions) 1.Edges that cross partitions are made into remote edges 2.Each CPU is assigned one or more logical partitions by the Computation Parent 3.In each logical partition, computation is done sequentially 1.In the beginning of each iteration, partition collects the dirty nodes (-> taskqueue(T)) 2.… and calls each dirty node with node function sequentially 3.This will result into new set of dirty nodes (-> taskqueue(T+1)) via remote edges, nodes in other partitions are flagged dirty 4.Computation Parent monitors each logical partition for number of dirty nodes 1.When dirty count is zero or under defined limit, computation is finished. 5.Graph state in the end of computation is sent back to client. Next example of eigenvalue calculation shows how we can calculate partition-level accumulative functions efficiently and deliver them to the central unit Note: in this model, nodes are not able to read from other nodes. Instead they can send data to other nodes, which can then cache this information.

A posteriori

Stochastic Matrix Eigenvector Task: to iterate x = Mx, where x is a probability distribution over (X1..Xn) and M is a stochastic matrix (Markov transition matrix), until we reach convergence (“fixed point”) – Existence of eigenvector (limit distribution) is guaranteed in all but pathological cases? (= periodic chains?) Running iteration in parallel is not stable because of “feedback loops” – In serial computation, |Mx| = 1 (norm is L1 norm, right?) – Normalization factor is needed to keep computation in control – But calculation of |Mx| needs input from all Xi synchronously Sync is costly, so we want to do this infrequently – how well is the effect studied? Are the some runaway problems? Two players in Markov’s chain talking

Normalization 1.Each logical partition has its on SumAccumulator 1.This is passed to each node on function computation. Node discounts its previous value and adds new (=> we need not to enumerate al nodes to get an updated sum) 2.After iteration, partition sends its accumulator value to the computation parent, which has its own SumAccumulator Amount of remote accumulator communication = N(num of partitions) 3.Before each iteration, partition queries parent for current value of normalization. This is passed to all nodes when node function is computed. If normalization factor changes significantly, all nodes are renormalized. But does it work? Good question!

Initialization

Node Function Invokes update on outbound nodes only if its value changed significantly. When converging, there are less and less dirty nodes.

Partition Interceptor Interceptor-idea is copied from certain web application frameworks

Computation Parent code

Putting it together…