29
Deploying Accelerators At Datacenter Scale Using Spark Di Wu and Muhuan Huang University of California, Los Angeles, Falcon Computing Solutions, Inc. UCLA Collaborators: Cody Hao Yu, Zhenman Fang, Tyson Condie and Jason Cong

Deploying Accelerators At Datacenter Scale Using Spark

Embed Size (px)

Citation preview

Page 1: Deploying Accelerators At Datacenter Scale Using Spark

Deploying Accelerators At Datacenter Scale Using SparkDi Wu and Muhuan HuangUniversity of California, Los Angeles,Falcon Computing Solutions, Inc.UCLA Collaborators: Cody Hao Yu, Zhenman Fang,

Tyson Condie and Jason Cong

Page 2: Deploying Accelerators At Datacenter Scale Using Spark

3x speedup in 3 hours

Page 3: Deploying Accelerators At Datacenter Scale Using Spark

Accelerators in Datacenter• CPU core scaling coming to an end

– Datacenters demand new technology to sustain scaling

• GPU is popular, FPGA is gaining popularity– Intel prediction: 30% datacenter nodes with FPGA by 2020

Page 4: Deploying Accelerators At Datacenter Scale Using Spark

About us• UCLA Center for Domain-Specific Computing

– Expeditions in Computing program from NSF in 2009– Public-private partnership between NSF and Intel in 2014– http://cdsc.ucla.edu

• Falcon Computing Solutions, Inc.– Founded in 2014– Enable customized computing for big data applications– http://www.falcon-computing.com

Page 5: Deploying Accelerators At Datacenter Scale Using Spark

What is FPGA?• Field Programmable Gate Array

(FPGA)

– Reconfigurable hardware

– Can be used to accelerate specific computations

• FPGA benefits

– Low-power, energy efficient

– Customized high performance

PCI-E FPGA- IBM CAPI

FPGA in CPU socket- Intel HARP

Page 6: Deploying Accelerators At Datacenter Scale Using Spark

Problems of deploying accelerators in datacenters efficiently …

Page 7: Deploying Accelerators At Datacenter Scale Using Spark

1. Complicated Programming Model

• Too much hardware specific knowledge

• Lack of platform-portability

Page 8: Deploying Accelerators At Datacenter Scale Using Spark

2. JVM-to-ACC data transfer overheads

• Data serialization/deserialization

• Additional data transfer

Page 9: Deploying Accelerators At Datacenter Scale Using Spark

3. Accelerator management is non-trivial

Accelerator designer

System administrator

Big-data application developer

Does my accelerator work in

your cluster …?

Which cluster node has the

accelerator …?

How can I use your accelerator …?

Page 10: Deploying Accelerators At Datacenter Scale Using Spark

More Challenges for FPGAs4. Reconfiguration time is long

• Takes about 0.5 - 2 seconds

– Transfer FPGA Binary

– Reset the bits

– …

• Naïve runtime FPGA sharing may slow down the

performance by 4x

Page 11: Deploying Accelerators At Datacenter Scale Using Spark

What we did• Provide a better programming model:

– APIs for accelerator developers• Easier to integrate into big-data workload, e.g. Spark and Hadoop

– APIs for big-data application developers• Requires no knowledge about accelerators

• Provide an accelerator management runtime– Currently supports FPGAs and GPUs

è Blaze: a system providing Accelerator-as-a-Service

Page 12: Deploying Accelerators At Datacenter Scale Using Spark

YARN Today

Client RMAMNM

NMContainerContainer

NodestatusJobsubmissionResource requestApplication status

Page 13: Deploying Accelerators At Datacenter Scale Using Spark

Blaze: Accelerator Runtime SystemClient RM

AM

NM

NM

ContainerContainer

Acceleratorstatus

GAMNAM

NAM

FPGA

GPU

Global Accelerator Manageraccelerator-centric scheduling

Node Accelerator ManagerLocal accelerator service management, JVM-to-ACC communication optimization

GAM

NAM

Page 14: Deploying Accelerators At Datacenter Scale Using Spark

Details on Programming Interfaces and Runtime Implementation

Page 15: Deploying Accelerators At Datacenter Scale Using Spark

Interface for Sparkval points = sc.textfile().cachefor (i <- 1 to ITERATIONS) {val gradient = points.map(p =>(1 / (1 + exp(-p.y*(w dot p.x))) - 1) * p.y * p.x).reduce(_ + _)

w -= gradient}

val points = blaze.wrap(sc.textfile().cache) for (i <- 1 to ITERATIONS) {val gradient = points.map(

new LogisticGrad(w)).reduce(_ + _)

w -= gradient}

class LogisticGrad(..) extends Accelerator[T, U] {

val id: String = “Logistic”}

RDD AccRDDdef compute():

serialize datacommunicate with NAMdeserialize results

blaze.wrap()

Page 16: Deploying Accelerators At Datacenter Scale Using Spark

Interface for Acceleratorsclass LogisticACC : public Task {// extend the basic Task interface

LogisticACC(): Task() {;} // overwrite the compute functionvirtual void compute() {

// get input/output using provided APIs// perform computation

}};

Page 17: Deploying Accelerators At Datacenter Scale Using Spark

Interface for Deployment• Managing accelerator services: through labels• [YARN-796] allow for labels on nodes and resource-

requests

Page 18: Deploying Accelerators At Datacenter Scale Using Spark

Putting it All Together• Register

– Interface to add accelerator service to corresponding nodes

• Request– Use acc_id as label

– GAM allocates corresponding nodes

User Application

Global ACC Manager

Node ACCManager

FPGA

GPU

ACC

ACC Labels Containers

Container Info ACC Info

ACC InvokeInput dataOutput data

Page 19: Deploying Accelerators At Datacenter Scale Using Spark

Accelerator-as-a-Service• Logical Accelerators

– Accelerator function

– Services for applications

• Physical Accelerators– Implementation on a specific

device (FPGA/GPU)

NAM

Logical Queue

Logical Queue

Logical Queue

PhysicalQueue Physical Queue

FPGA GPU

Task Scheduler

Application Scheduler

Task Task

Task Task

Task

Page 20: Deploying Accelerators At Datacenter Scale Using Spark

JVM-to-ACC Transfer Optimization

• Double-buffering / Accelerator Sharing

• Data caching– On GPU/FPGA device memory

• Broadcast

Page 21: Deploying Accelerators At Datacenter Scale Using Spark

Global FPGA Allocation Optimization• Avoid reprogramming• GAM policy

– Group the containers that need the same accelerator to the same set of nodes

Node

ACC1 ACC2

App1 container

App3 container

Node

ACC1 ACC2

App2 container

App4 container

Better container allocation

Node

ACC1 ACC 2

App1 container

App2 container

Node

ACC1 ACC2

App3 container

App4 container

Bad container allocation

Page 22: Deploying Accelerators At Datacenter Scale Using Spark

Programming Efforts ReductionLines of Code Accelerator Management

Logistic Regression (LR) 325 à 0

Kmeans (KM) 364 à 0

Compression (ZIP) 360 à 0

Genome Sequency Alignment (GSA) 896 à 0

Page 23: Deploying Accelerators At Datacenter Scale Using Spark

Heterogeneous Clusters• CDSC and Falcon Clusters

– Low-power GPUs– PCI-E FPGAs

• Workloads– Genome sequencing– Machine learning

Page 24: Deploying Accelerators At Datacenter Scale Using Spark

3.0

2.01.7

3.2

2.6

1.81.5

2.8

0.0

1.0

2.0

3.0

4.0

LR KM GSA ZIP

Impr

ovem

ent O

ver

CPU

Bas

elin

e (x

)

Job latency Energy

1.7x ~ 3.2x Speedup

System Performance and Energy Efficiency

1.5x ~ 2.8x Energy reduction

Page 25: Deploying Accelerators At Datacenter Scale Using Spark

DEMO

Page 26: Deploying Accelerators At Datacenter Scale Using Spark

Take Away• Accelerator deployment can be made easy• FPGA requires special considerations• Key to efficiency is JVM-to-ACC overheads

– Looking for new ideas

• Blaze is an open-source project– Looking for collaboration

Page 27: Deploying Accelerators At Datacenter Scale Using Spark

About Falcon Computing

Runtime VirtualizationOffline customization

Accelerated Applications(Spark/MapReduce/C/Java)

FalconAccelerator Libraries

FalconMerlin Compiler

FalconKestrel Runtime

Blaze

Customized Platform Support

Management tools

Acce

lera

tors

Page 28: Deploying Accelerators At Datacenter Scale Using Spark

We thank our sponsors:• NSF/Intel Innovation Transition Grant awarded to the Center for

Domain-Specific Computing • Intel for funding and machine donations• Xilinx for FPGA board donations

Page 29: Deploying Accelerators At Datacenter Scale Using Spark

THANK YOU.Di Wu, [email protected] Huang, [email protected]

Blaze: http://www.github.com/UCLA-VAST/blaze

Center for Domain-Specific Computing: http://cdsc.ucla.eduFalcon Computing Solutions, Inc.: http://www.falcon-computing.com