31
Concurrency Control for Parallel Machine Learning Dimitris Papailiopoulos Xinghao Pan, Joseph Gonzalez, Stefanie Jegelka, Tamara Broderick, Dimitris Papailiopoulos, Joseph Bradley, Michael I. Jordan

Concurrency Control for Parallel Machine Learning

Embed Size (px)

DESCRIPTION

"Concurrency Control for Parallel Machine Learning" presentation at AMPCamp 5 by Dimitris Papailiopoulos

Citation preview

Page 1: Concurrency Control for Parallel Machine Learning

Concurrency Control for

Parallel Machine Learning

Dimitris Papailiopoulos

Xinghao Pan, Joseph Gonzalez, Stefanie Jegelka, Tamara Broderick, Dimitris Papailiopoulos, Joseph Bradley, Michael I. Jordan

Page 2: Concurrency Control for Parallel Machine Learning

Data

Model

State

Serial Inference

Page 3: Concurrency Control for Parallel Machine Learning

Model

State

Parallel Inference

Processor 1

Processor 2

Data

Page 4: Concurrency Control for Parallel Machine Learning

Data

Model

State

Parallel Inference

Processor 1

Processor 2

Concurrency:more machines = less time

Correctness:serial equivalence

?

Page 5: Concurrency Control for Parallel Machine Learning

Data

Model

State

Coordination Free Parallel

Inference

Processor 1

Processor 2

Ignore collisions

?

Concurrency:(almost) free

+

Speedup = #CPU

Correctness?Not always...

Page 6: Concurrency Control for Parallel Machine Learning

Correctness

Serial

Low High

Page 7: Concurrency Control for Parallel Machine Learning

Correctness

Concurrency

Coordination-

free

Serial

High

Low High

Low

Page 8: Concurrency Control for Parallel Machine Learning

Correctness

Concurrency

Coordination-

free

Serial

High

Low High

Low

Concurrency

ControlDatabase mechanismso Guarantee correctnesso Maximize concurrency Mutual exclusion Optimistic CC

Page 9: Concurrency Control for Parallel Machine Learning

Data

Model

State

Mutual Exclusion Through

Locking

Processor 1

Processor 2

Introduce locking (scheduling) protocols to prevent

conflicts.

Page 10: Concurrency Control for Parallel Machine Learning

Data

Model

State

Processor 1

Processor 2

Enforce local serialization to avoid conflicts.

Mutual Exclusion Through

Locking

Page 11: Concurrency Control for Parallel Machine Learning

Data

Model

State

Optimistic Concurrency Control

Processor 1

Processor 2

Allow computation to proceed without blocking.

Kung & Robinson. On optimistic methods for concurrency

control.

ACM Transactions on Database Systems 1981

Page 12: Concurrency Control for Parallel Machine Learning

Data

Model

State

Optimistic Concurrency Control

Processor 1

Processor 2

✗ ✗

Validate potential conflicts.

Invalid Outcome

Kung & Robinson. On optimistic methods for concurrency

control.

ACM Transactions on Database Systems 1981

Page 13: Concurrency Control for Parallel Machine Learning

Data

Model

State

Optimistic Concurrency Control

Processor 1

Processor 2

✗ ✗Rollback and Redo

Take a compensating action.

Kung & Robinson. On optimistic methods for concurrency

control.

ACM Transactions on Database Systems 1981

Page 14: Concurrency Control for Parallel Machine Learning

Concurrency Control

14

Coordination Free:

Provably fast and correct under key assumptions.

Concurrency Control:

Provably correct and fast under key assumptions.

Systems Ideas to

Improve Efficiency

Page 15: Concurrency Control for Parallel Machine Learning

Clusteri

ng

Online

Facility

Location

Submodular

MaximizationSubset selection, diminishing

marginal gainsMax Graph

Cut

Set

Cover

Sensor Placement

Social Network

Influence

Propagation

Document

Summarization

Machine Learning + Concurrency

Control(Xinghao Pan et al.)

SportsFootball

Word Series

Giants

Cardinals

PoliticsMidterm

Obama

Democrat

Tea

FinanceQE

market

interest

Dow

Topic Modelling

Correlation

Clustering

Community

Detection

Deduplication

Page 16: Concurrency Control for Parallel Machine Learning

Clusteri

ng

Online

Facility

Location

Submodular

MaximizationSubset selection, diminishing

marginal gainsMax Graph

Cut

Set

Cover

Sensor Placement

Social Network

Influence

Propagation

Document

Summarization

SportsFootball

Word Series

Giants

Cardinals

PoliticsMidterm

Obama

Democrat

Tea

FinanceQE

market

interest

Dow

Topic Modelling

Correlation

Clustering

Community

Detection

Deduplication

Serial ML

algorithm

Sequence of

transactions

Identify potential

conflicts

Apply Concurrency

Control

mechanisms

Parallel ML

algorithm

Machine Learning + Concurrency

Control(Xinghao Pan et al.)

Page 17: Concurrency Control for Parallel Machine Learning

Application: Deduplication

Computer Science

Division – University of

California Berkeley CA

University of California at Berkeley

Department of

Physics Stanford

University California

Lawrence Berkeley National

Labs <ref>California</ref>

Computer Science

Division – University of

California Berkeley CA

University of California at Berkeley

Department of

Physics Stanford

University California

Lawrence Berkeley National

Labs <ref>California</ref>

Page 18: Concurrency Control for Parallel Machine Learning

Application: Deduplication

Page 19: Concurrency Control for Parallel Machine Learning

Serial Correlation Clustering

Nir Ailon, Moses Charikar, and Alantha Newman.Aggregating inconsistent information: ranking and clustering.

Journal of the ACM (JACM), 55(5):23, 2008.

Serially process vertices

Page 20: Concurrency Control for Parallel Machine Learning

Serial Correlation Clustering

Nir Ailon, Moses Charikar, and Alantha Newman.Aggregating inconsistent information: ranking and clustering.

Journal of the ACM (JACM), 55(5):23, 2008.

Serially process vertices

Page 21: Concurrency Control for Parallel Machine Learning

Serial Correlation Clustering

Nir Ailon, Moses Charikar, and Alantha Newman.Aggregating inconsistent information: ranking and clustering.

Journal of the ACM (JACM), 55(5):23, 2008.

Serially process vertices

Page 22: Concurrency Control for Parallel Machine Learning

Serial Correlation Clustering

Nir Ailon, Moses Charikar, and Alantha Newman.Aggregating inconsistent information: ranking and clustering.

Journal of the ACM (JACM), 55(5):23, 2008.

Serially process vertices

Page 23: Concurrency Control for Parallel Machine Learning

Serial Correlation Clustering

Nir Ailon, Moses Charikar, and Alantha Newman.Aggregating inconsistent information: ranking and clustering.

Journal of the ACM (JACM), 55(5):23, 2008.

Serially process vertices

Approximation 3 OPT (in expectation)

Page 24: Concurrency Control for Parallel Machine Learning

Parallel Correlation Clustering

Page 25: Concurrency Control for Parallel Machine Learning

Concurrency Control Correlation Clustering

(C4)Parallel Correlation ClusteringCannot introduce

adjacent cluster

centers

Resolve by

Mutual Exclusion

Page 26: Concurrency Control for Parallel Machine Learning

Concurrency Control Correlation Clustering

(C4)Common neighbor must be

assigned to earliest center

Resolve by

Optimistic Concurrency

Control

ResolutionAssign common neighbor to earliest cluster

Optimistic AssumptionNo other new cluster created

?

Page 27: Concurrency Control for Parallel Machine Learning

Properties of C4(Concurrency Control Correlation Clustering)

Theorem: C4 is correct.

C4 preserves same guarantees as serial algorithm (3

OPT).Co

rre

ctn

es

sC

on

cu

rren

cy

Theorem: C4 has provably small overheads.

= almost linear speedupExpected #blocked transactions < 2τ |E| / |V|.

τ ≡ diff in parallel cpu’s progress

Page 28: Concurrency Control for Parallel Machine Learning

Empirical Validation on Billion Edge

Graphs

Amazon EC2 r3.8xlarge instances

Multicore up to 16 threads

Real and synthetic graphs

100 runs (10 random orderings x 10 runs)

Graph Vertices Edges

IT-2004 Italian web-graph 41 Million 1.14 Billion

Webbase-2001 WebBase crawl 118 Million 1.02 Billion

Erdos-Renyi Synthetic random 100 Million ≈ 1.0 Billion

Page 29: Concurrency Control for Parallel Machine Learning

C4: Cost of Coordination

< 0.02% blocked

Page 30: Concurrency Control for Parallel Machine Learning

C4: Speed-up

Ideal

10x

speedu

p

Page 31: Concurrency Control for Parallel Machine Learning

ConclusionConcurrency Control

for Parallel ML

o Guarantee

correctness

o Maximize

concurrency

Code release in the works!

https://amplab.cs.berkeley.edu/projects/cc

ml/

[email protected]

ApplicationsCorrelation Clustering

Submodular Maximization

Clustering

Online Facility Location

Feature Modeling