GraphLab Introduction

GraphLab Introduction

图文畅读版下载


[摘要:本文介绍了GraphLab处理分布式机器学习算法的优势,以及这些优势的底层实现机制]

  1. 机器学习算法的特点以及GraphLab的应运而生

    大多数机器学习算法具有一些共通的特点,利用这些特点,分布式计算性能将能够得到提高:

    1.1. 稀疏的数据依赖(Sparse Computational Dependencies)

     从应用场景的角度看,图模型能够良好地表达数据之间的关联关系,从数据之间的关联关系中可以获得更有价值的信息. 
     例如推荐系统领域里的协同过滤(Collaborative Filtering)  
    
     从计算的角度来看,在参数的求解中,通常只需要局部数据参与运算. 例如求条件概率
    
     GraphLab采用图模型来表示数据,计算的操作对象是图中的节点以及与该节点邻接的所有节点.  
     而不用考虑所有数据同时参与计算.  
    
     在迭代计算过程中,图上的节点以及边的值做相应更新,但是整个图模型的结构始终不会被改变.  
     因此,使用GraphLab开发算法时只需要关注
     迭代计算的设计,不需要像使用MPI编程时那样关注数据在集群中的分配问题.
    

    1.2. 异步迭代计算(Asynchronous Iterative Computation)

     同步迭代计算在进行下一次迭代之前需要使用上一轮迭代更新之后的参数值,  
     在参数数量庞大的情况下,有些参数值更新快,另一些参数更新得慢,采用同步,  
     因此采用同步更新方式,计算速度受限于部分参数的更新速度.     
    
     GraphLab采用异步迭代计算,异步迭代计算在进行下一次迭代时,采用的是最近更新的参数值,  
     不需要等上一次参数的迭代计算完成,因而能够加快计算.
    
     参数更新快慢的影响因素包括:
     1. 集群计算节点的计算能力不均衡
     2. 集群中网络的延迟,影响数据传输的快慢
     3. 每个节点的计算量不均衡,如著名的power-law
    

    1.3. 动态计算(Dynamic Computation)

     机器学习算法的参数收敛速度不一致,导致求解各个参数的计算量也不一致.  
     例如PageRank算法,大多数节点只需少量的迭代就能够收敛,而少数节点则需要多次迭代.  
     GraphLab能够在算法的计算过程中自适应地调整计算任务的优先级.
    

    1.4. 数据的一致性问题(Sequential Consistency)

     有些算法要求数据能够分布式计算中保持一致性,例如Gibbs sampling  
     此外,数据保持一致性有利于提高随机优化算法的收敛速度.
    

Alt text

  1. GraphLab Abstraction

    2.1 The Data Graph

    The data graph represents user modifiable program state and stores both the mutable user-defined data and encodes the sparse computational dependencies.

    2.2 The Update Functions

f(υ,Sυ)(Sυ,T)

Sυ is the scope of vertex υ (denoted by Sυ). This is showd in Fig 2a.
The returned set of μT are eventually executed by applying the update function f(μ,Sυ).
GraphLab allows the user defined update functions complete freedom to read and modify in the scope Sυ. This simplifies user code and eliminates the need for the users to reason about the movement of data. Further more, by controlling what vertices are returned in T and thus to be executed, GraphLab update functions can efficiently express adaptive computation. For example, an update function may choose to return (schedule) its neighbors only when it has made a substantial change to its local data.

Alt text

2.3 The GraphLab Execution Model

The GraphLab Execution Model, presented in Alg.2 follows a simple single loop semantics.
Alt text
The only requirement imposed by the GraphLab abstraction is that all vertices in T are eventually executed

2.4 Ensuring Serializability

The GraphLab runtime ensures a serializable execution. A serializable execution implies that there exists a corresponding serial schedule of update functions that when executed by Alg.2 produces
the same values in the data-graph. In such way, GraphLab ensures that the scopes of concurrently executing update functions do not overlap.

参考文献:

  1. Low Y, Bickson D, Gonzalez J, et al. Distributed GraphLab: A framework for machine learning and data mining in the cloud[J]. Proceedings of the VLDB Endowment, 2012, 5(8): 716-727.

  2. C. Guestrin. NIPS Big Learning Workshop 12/18/2011

  3. Technical report describing the GraphLab abstraction
  4. GraphLab A Distributed Abstraction for Large Scale Machine Learning
GraphLab%20Introduction%0A%3D%3D%3D%20%20%0A%23%23%23%5B%u56FE%u6587%u7545%u8BFB%u7248%u4E0B%u8F7D%5D%28http%3A//pan.baidu.com/s/1sjGs3YP%29%20%20%20%20%0A----%0A%20%20%0A%20%20%0A%20%20%0A%5B%u6458%u8981%3A%u672C%u6587%u4ECB%u7ECD%u4E86GraphLab%u5904%u7406%u5206%u5E03%u5F0F%u673A%u5668%u5B66%u4E60%u7B97%u6CD5%u7684%u4F18%u52BF%uFF0C%u4EE5%u53CA%u8FD9%u4E9B%u4F18%u52BF%u7684%u5E95%u5C42%u5B9E%u73B0%u673A%u5236%5D%20%20%0A%0A%0A1.%20%23%23%u673A%u5668%u5B66%u4E60%u7B97%u6CD5%u7684%u7279%u70B9%u4EE5%u53CAGraphLab%u7684%u5E94%u8FD0%u800C%u751F%20%20%0A%09%u5927%u591A%u6570%u673A%u5668%u5B66%u4E60%u7B97%u6CD5%u5177%u6709%u4E00%u4E9B%u5171%u901A%u7684%u7279%u70B9%uFF0C%u5229%u7528%u8FD9%u4E9B%u7279%u70B9%uFF0C%u5206%u5E03%u5F0F%u8BA1%u7B97%u6027%u80FD%u5C06%u80FD%u591F%u5F97%u5230%u63D0%u9AD8%uFF1A%20%20%0A%09%23%23%231.1.%20%u7A00%u758F%u7684%u6570%u636E%u4F9D%u8D56%28Sparse%20Computational%20Dependencies%29%20%20%0A%09%20%20%20%20%u4ECE%u5E94%u7528%u573A%u666F%u7684%u89D2%u5EA6%u770B%uFF0C%u56FE%u6A21%u578B%u80FD%u591F%u826F%u597D%u5730%u8868%u8FBE%u6570%u636E%u4E4B%u95F4%u7684%u5173%u8054%u5173%u7CFB%uFF0C%u4ECE%u6570%u636E%u4E4B%u95F4%u7684%u5173%u8054%u5173%u7CFB%u4E2D%u53EF%u4EE5%u83B7%u5F97%u66F4%u6709%u4EF7%u503C%u7684%u4FE1%u606F.%20%0A%20%20%20%20%20%20%20%20%u4F8B%u5982%u63A8%u8350%u7CFB%u7EDF%u9886%u57DF%u91CC%u7684%u534F%u540C%u8FC7%u6EE4%28Collaborative%20Filtering%29%20%20%0A%0A%20%20%20%20%20%20%20%20%u4ECE%u8BA1%u7B97%u7684%u89D2%u5EA6%u6765%u770B%uFF0C%u5728%u53C2%u6570%u7684%u6C42%u89E3%u4E2D%uFF0C%u901A%u5E38%u53EA%u9700%u8981%u5C40%u90E8%u6570%u636E%u53C2%u4E0E%u8FD0%u7B97.%20%u4F8B%u5982%u6C42%u6761%u4EF6%u6982%u7387%0A%09%09%0A%09%09GraphLab%u91C7%u7528%u56FE%u6A21%u578B%u6765%u8868%u793A%u6570%u636E%uFF0C%u8BA1%u7B97%u7684%u64CD%u4F5C%u5BF9%u8C61%u662F%u56FE%u4E2D%u7684%u8282%u70B9%u4EE5%u53CA%u4E0E%u8BE5%u8282%u70B9%u90BB%u63A5%u7684%u6240%u6709%u8282%u70B9.%20%20%0A%09%09%u800C%u4E0D%u7528%u8003%u8651%u6240%u6709%u6570%u636E%u540C%u65F6%u53C2%u4E0E%u8BA1%u7B97.%20%20%0A%09%09%0A%09%09%u5728%u8FED%u4EE3%u8BA1%u7B97%u8FC7%u7A0B%u4E2D%uFF0C%u56FE%u4E0A%u7684%u8282%u70B9%u4EE5%u53CA%u8FB9%u7684%u503C%u505A%u76F8%u5E94%u66F4%u65B0%uFF0C%u4F46%u662F%u6574%u4E2A%u56FE%u6A21%u578B%u7684%u7ED3%u6784%u59CB%u7EC8%u4E0D%u4F1A%u88AB%u6539%u53D8.%20%20%0A%09%09%u56E0%u6B64%uFF0C%u4F7F%u7528GraphLab%u5F00%u53D1%u7B97%u6CD5%u65F6%u53EA%u9700%u8981%u5173%u6CE8%0A%09%09%u8FED%u4EE3%u8BA1%u7B97%u7684%u8BBE%u8BA1%uFF0C%u4E0D%u9700%u8981%u50CF%u4F7F%u7528MPI%u7F16%u7A0B%u65F6%u90A3%u6837%u5173%u6CE8%u6570%u636E%u5728%u96C6%u7FA4%u4E2D%u7684%u5206%u914D%u95EE%u9898.%0A%09%09%0A%09%23%23%231.2.%20%u5F02%u6B65%u8FED%u4EE3%u8BA1%u7B97%28Asynchronous%20Iterative%20Computation%29%20%20%0A%09%09%u540C%u6B65%u8FED%u4EE3%u8BA1%u7B97%u5728%u8FDB%u884C%u4E0B%u4E00%u6B21%u8FED%u4EE3%u4E4B%u524D%u9700%u8981%u4F7F%u7528%u4E0A%u4E00%u8F6E%u8FED%u4EE3%u66F4%u65B0%u4E4B%u540E%u7684%u53C2%u6570%u503C%uFF0C%20%20%0A%09%09%u5728%u53C2%u6570%u6570%u91CF%u5E9E%u5927%u7684%u60C5%u51B5%u4E0B%uFF0C%u6709%u4E9B%u53C2%u6570%u503C%u66F4%u65B0%u5FEB%uFF0C%u53E6%u4E00%u4E9B%u53C2%u6570%u66F4%u65B0%u5F97%u6162%uFF0C%u91C7%u7528%u540C%u6B65%uFF0C%20%20%0A%20%20%20%20%20%20%20%20%u56E0%u6B64%u91C7%u7528%u540C%u6B65%u66F4%u65B0%u65B9%u5F0F%uFF0C%u8BA1%u7B97%u901F%u5EA6%u53D7%u9650%u4E8E%u90E8%u5206%u53C2%u6570%u7684%u66F4%u65B0%u901F%u5EA6.%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%09%09GraphLab%u91C7%u7528%u5F02%u6B65%u8FED%u4EE3%u8BA1%u7B97%uFF0C%u5F02%u6B65%u8FED%u4EE3%u8BA1%u7B97%u5728%u8FDB%u884C%u4E0B%u4E00%u6B21%u8FED%u4EE3%u65F6%uFF0C%u91C7%u7528%u7684%u662F%u6700%u8FD1%u66F4%u65B0%u7684%u53C2%u6570%u503C%uFF0C%20%20%0A%09%09%u4E0D%u9700%u8981%u7B49%u4E0A%u4E00%u6B21%u53C2%u6570%u7684%u8FED%u4EE3%u8BA1%u7B97%u5B8C%u6210%uFF0C%u56E0%u800C%u80FD%u591F%u52A0%u5FEB%u8BA1%u7B97.%0A%09%09%0A%09%09%u53C2%u6570%u66F4%u65B0%u5FEB%u6162%u7684%u5F71%u54CD%u56E0%u7D20%u5305%u62EC%uFF1A%0A%09%091.%20%u96C6%u7FA4%u8BA1%u7B97%u8282%u70B9%u7684%u8BA1%u7B97%u80FD%u529B%u4E0D%u5747%u8861%0A%09%092.%20%u96C6%u7FA4%u4E2D%u7F51%u7EDC%u7684%u5EF6%u8FDF%uFF0C%u5F71%u54CD%u6570%u636E%u4F20%u8F93%u7684%u5FEB%u6162%0A%09%093.%20%u6BCF%u4E2A%u8282%u70B9%u7684%u8BA1%u7B97%u91CF%u4E0D%u5747%u8861%uFF0C%u5982%u8457%u540D%u7684power-law%0A%09%0A%09%23%23%231.3.%20%u52A8%u6001%u8BA1%u7B97%28Dynamic%20Computation%29%20%20%0A%09%09%u673A%u5668%u5B66%u4E60%u7B97%u6CD5%u7684%u53C2%u6570%u6536%u655B%u901F%u5EA6%u4E0D%u4E00%u81F4%uFF0C%u5BFC%u81F4%u6C42%u89E3%u5404%u4E2A%u53C2%u6570%u7684%u8BA1%u7B97%u91CF%u4E5F%u4E0D%u4E00%u81F4.%20%20%0A%20%20%20%20%20%20%20%20%u4F8B%u5982PageRank%u7B97%u6CD5%uFF0C%u5927%u591A%u6570%u8282%u70B9%u53EA%u9700%u5C11%u91CF%u7684%u8FED%u4EE3%u5C31%u80FD%u591F%u6536%u655B%uFF0C%u800C%u5C11%u6570%u8282%u70B9%u5219%u9700%u8981%u591A%u6B21%u8FED%u4EE3.%20%20%0A%09%09GraphLab%u80FD%u591F%u5728%u7B97%u6CD5%u7684%u8BA1%u7B97%u8FC7%u7A0B%u4E2D%u81EA%u9002%u5E94%u5730%u8C03%u6574%u8BA1%u7B97%u4EFB%u52A1%u7684%u4F18%u5148%u7EA7.%0A%09%0A%09%23%23%231.4.%20%u6570%u636E%u7684%u4E00%u81F4%u6027%u95EE%u9898%28Sequential%20Consistency%29%20%20%0A%09%09%u6709%u4E9B%u7B97%u6CD5%u8981%u6C42%u6570%u636E%u80FD%u591F%u5206%u5E03%u5F0F%u8BA1%u7B97%u4E2D%u4FDD%u6301%u4E00%u81F4%u6027%uFF0C%u4F8B%u5982Gibbs%20sampling%20%20%0A%09%09%u6B64%u5916%uFF0C%u6570%u636E%u4FDD%u6301%u4E00%u81F4%u6027%u6709%u5229%u4E8E%u63D0%u9AD8%u968F%u673A%u4F18%u5316%u7B97%u6CD5%u7684%u6536%u655B%u901F%u5EA6.%0A%20%20%0A%20%20%0A%0A%21%5BAlt%20text%5D%28data%3Aimage%2Clocal%3A//1..jpg%29%20%20%0A%20%20%0A%20%20%0A2.%20%23%23GraphLab%20Abstraction%0A%20%20%20%23%23%232.1%20The%20Data%20Graph%20%20%0A%20%20%20%20The%20data%20graph%20represents%20user%20modifiable%20program%20state%20and%20stores%20both%20the%20mutable%20user-defined%20data%20and%20encodes%20the%20sparse%20computational%20***dependencies***.%20%0A%20%20%20%23%23%232.2%20The%20Update%20Functions%20%20%0A%20%20%20%20%60%60%60mathjax%0A%20%20%20%20%09f%28%5Cupsilon%2CS_%5Cupsilon%29%5Crightarrow%28S_%5Cupsilon%2C%20T%29%0A%20%20%20%20%60%60%60%0A%0A%20%20%20%20%60%24%20S_%5Cupsilon%20%24%60%20is%20the%20***scope***%20of%20%20vertex%20%60%24%5Cupsilon%24%60%20%28denoted%20by%20%60%24S_%5Cupsilon%24%60%29.%20This%20is%20showd%20in%20Fig%202a.%20%20%0A%20%20%20%20The%20returned%20set%20of%20%60%24%5Cmu%20%5Cin%20T%24%60%20are%20***eventually***%20executed%20by%20applying%20the%20update%20function%20%60%24f%28%5Cmu%2C%20S_%5Cupsilon%29%24%60.%20%20%0A%20%20%20%20GraphLab%20allows%20the%20user%20defined%20update%20functions%20complete%20freedom%20to%20read%20and%20modify%20in%20the%20scope%20%60%24S_%5Cupsilon%24%60.%20This%20simplifies%20user%20code%20and%20eliminates%20the%20need%20for%20the%20users%20to%20reason%20about%20the%20movement%20of%20data.%20Further%20more%2C%20by%20controlling%20what%20vertices%20are%20returned%20in%20%60%24T%24%60%20and%20thus%20to%20be%20executed%2C%20GraphLab%20update%20functions%20can%20efficiently%20express%20***adaptive%20computation***.%20For%20example%2C%20an%20update%20function%20may%20choose%20to%20return%20%28schedule%29%20its%20neighbors%20only%20when%20it%20has%20made%20a%20substantial%20change%20to%20its%20local%20data.%20%20%20%0A%20%20%20%20%0A%20%20%20%20%21%5BAlt%20text%5D%28data%3Aimage%2Clocal%3A//Fig%202a.jpg%29%20%20%0A%20%20%20%20%0A%20%20%20%20%23%23%232.3%20The%20GraphLab%20Execution%20Model%0A%20%20%20%20The%20GraphLab%20Execution%20Model%2C%20presented%20in%20Alg.2%20follows%20a%20simple%20single%20loop%20semantics.%20%20%0A%20%20%20%20%21%5BAlt%20text%5D%28data%3Aimage%2Clocal%3A//Execution%20Model.jpg%29%20%20%0A%20%20%20%20The%20only%20requirement%20imposed%20by%20the%20GraphLab%20abstraction%20is%20that%20all%20vertices%20in%20%60%24T%24%60%20are%20**eventually%20executed**%20%20%0A%20%20%20%20%0A%20%20%20%20%23%23%232.4%20Ensuring%20Serializability%20%20%0A%20%20%20%20The%20GraphLab%20runtime%20ensures%20a%20**serializable**%20execution.%20A%20serializable%20execution%20implies%20that%20there%20exists%20a%20corresponding%20serial%20schedule%20of%20update%20functions%20that%20when%20executed%20by%20Alg.2%20produces%0Athe%20same%20values%20in%20the%20data-graph.%20In%20such%20way%2C%20GraphLab%20ensures%20that%20the%20scopes%20of%20concurrently%20executing%20update%20functions%20do%20not%20overlap.%20%20%0A%0A%0A%23%23%23%u53C2%u8003%u6587%u732E%3A%0A1.%20%5BLow%20Y%2C%20Bickson%20D%2C%20Gonzalez%20J%2C%20et%20al.%20Distributed%20GraphLab%3A%20A%20framework%20for%20machine%20learning%20and%20data%20mining%20in%20the%20cloud%5BJ%5D.%20Proceedings%20of%20the%20VLDB%20Endowment%2C%202012%2C%205%288%29%3A%20716-727.%5D%28http%3A//arxiv.org/pdf/1204.6078.pdf%29%0A%0A2.%20%5BC.%20Guestrin.%20NIPS%20Big%20Learning%20Workshop%2012/18/2011%5D%28C.%20Guestrin.%20NIPS%20Big%20Learning%20Workshop%2012/18/2011%29%20%20%0A3.%20%5BTechnical%20report%20describing%20the%20GraphLab%20abstraction%5D%28http%3A//select.cs.cmu.edu/code/graphlab/abstractiononly.pdf%29%20%20%0A4.%20%5BGraphLab%20A%20Distributed%20Abstraction%20for%20Large%20Scale%20Machine%20Learning%5D%28http%3A//reports-archive.adm.cs.cmu.edu/anon/ml2013/CMU-ML-13-104.pdf%29%0A%09%09


comments powered by Disqus