Hadoop + GPU

48
© ALTOROS Systems | CONFIDENTIAL “The norm for data analytics is now to run them on commodity clusters with MapReduce-like abstractions. One only needs to read the popular blogs to see the evidence of this. We believe that we could now say that nobody ever got fired for using Hadoop on a cluster ”!

description

Brief intro into the problem and perspectives of OpenCL and distributed heterogeneous calculations with Hadoop. For Big Data Dive 2013 (Belarus Java User Group).

Transcript of Hadoop + GPU

Page 1: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

“The norm for data analytics is now to run them on commodity clusters with MapReduce-like abstractions. One only needs to read the popular blogs to see the evidence of this. We believe that we could now say that

“nobody ever got firedfor using Hadoop on a cluster”!

Page 2: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

BreakingNews

IBM Keynote at JavaOne 2013: Java Flies in Blue Skies and Open Clouds

Java and GPUs open up a world of new opportunities for GPU accelerators and Java programmers alike.

Page 3: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

BreakingNews

Duimovich showed an example of GPU acceleration of sorting using standard NVIDIA CUDA libraries

that are already available!

The speedups are phenomenal — ranging from 2x to 48x faster!

Page 4: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

BreakingNews?

Page 5: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

BreakingNews?

Page 6: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

BreakingHadoop

Page 7: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

BreakingHadoop

10 000x faster

Page 8: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

BreakingHadoop

10 000x faster

Page 9: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop vs GPU

Hadoop & GPU

Hadoop + GPU

HPC

Big Data

GPGPU in JavaHeterogeneous systems

Horizontal and vertical scalability

Page 10: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

file01 file02 file03

Page 11: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

file01 file02 file03

Page 12: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

file01 file02 file03

Node 1 Node 2 Node 3

01 02 03 04 05 06 07 08 09 10

01

02

03

04

05 0607 0809 10

Page 13: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

file01 file02 file03

Node 1 Node 2 Node 3

01 02 03 04 05 06 07 08 09 10

01

02

03

04

05 0607 0809 10

3 4 3

Page 14: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

file01 file02 file03

Node 1 Node 2 Node 3

01 02 03 04 05 06 07 08 09 10

01

02

03

04

05 0607 0809 10

3 4 3

Node 1 Node 2 Node 3

01 02

03 04

05 06

07 08

09 10

Node 4 Node 5 Node 6

01 02 03

04

05 06 07

08 09 10

Page 15: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

file01 file02 file03

Node 1 Node 2 Node 3

01 02 03 04 05 06 07 08 09 10

01

02

03

04

05 0607 0809 10

3 4 3

Node 1 Node 2 Node 3

01 02

03 04

05 06

07 08

09 10

Node 4 Node 5 Node 6

01 02 03

04

05 06 07

08 09 10

221 1 2 2

Page 16: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

Node 1 Node 2 Node 3

01 02

03 04

05 06

07 08

09 10

Node 4 Node 5 Node 6

01 02 03

04

05 06 07

08 09 10

221 1 2 2

Page 17: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Hadoop horizontal scalability

Node 1 Node 2 Node 3

01 02

03 04

05 06

07 08

09 10

Node 4 Node 5 Node 6

01 02 03

04

05 06 07

08 09 10

221 1 2 2

Page 18: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Use GPU to scale vertically

Node 1 Node 2 Node 3

01 02

03 04

05 06

07 08

09 10

Node 4 Node 5 Node 6

01 02 03

04

05 06 07

08 09 10

221 1 2 20.5 1 1 0.5 1 1

Page 19: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Profit estimation

“Debunking the 100X GPU vs. CPU myth: an evaluation of throughput computing on CPU and GPU” by Intel

NVidia GTX280vs

Intel Core i7-960

Page 20: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Profit estimation

“Debunking the 100X GPU vs. CPU myth: an evaluation of throughput computing on CPU and GPU” by Intel

“OpenCL: the advantages of heterogeneous approach” by Intel

NVidia GTX280vs

Intel Core i7-960

Page 21: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

How to use OpenCL?

Page 22: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

How to use OpenCL?

Page 23: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

How to use OpenCL?

Hadoop streaming

Page 24: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

MyKernel.class

Page 25: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

MyKernel.classPlatformSupportsOpenCL?

Page 26: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

MyKernel.classPlatformSupportsOpenCL?

Execute usingJava Thread Pool

Page 27: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

MyKernel.classPlatformSupportsOpenCL?

Bytecode canbe convertedto OpenCL?

Execute usingJava Thread Pool

Page 28: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

MyKernel.classPlatformSupportsOpenCL?

Bytecode canbe convertedto OpenCL?

Convert it

Execute OpenCLKernel on DeviceExecute using

Java Thread Pool

Page 29: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

Page 30: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

Page 31: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

Page 32: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

lambda

Page 33: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Expands Java's “Write Once Run Anywhere” to include APU and GPU devices by expressing data parallel algorithm through extending Kernel base class.

lambda

HSA

Page 34: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Characteristics of ideal data parallel workload

Page 35: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Characteristics of ideal data parallel workload

Code which iterates over large arrays of primitives

- 32/64 bit data types preferred

- where the order of iterations is not critical

avoid data dependencies between iterations

- each iteration contains sequential code (few branches)

Page 36: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Aparapi

Characteristics of ideal data parallel workload

Code which iterates over large arrays of primitives

- 32/64 bit data types preferred

- where the order of iterations is not critical

avoid data dependencies between iterations

- each iteration contains sequential code (few branches)

Balance between data size (low) and compute (high)

- data transfer to/from the GPU can be costly

- trivial compute not worth the transfer cost

- may still benefit by freeing up CPU for other work(?)

Page 37: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

HadoopCL

Rice University, AMD

Page 38: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

HadoopCL

Page 39: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

HadoopCL

Page 40: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

HadoopCL

Page 41: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

HadoopCL

2 six-core Intel X5660(48 GB mem)

2 NVidia Tesla M2050(2*2.5 GB mem)

AMD A10-5800K APU(16 GB mem)

Page 42: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

HadoopCL

2 six-core Intel X5660(48 GB mem)

2 NVidia Tesla M2050(2*2.5 GB mem)

AMD A10-5800K APU(16 GB mem)

WHY?

Page 43: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

HadoopCL

Page 44: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Back to OpenCL, Aparapi and heterogeneous computing

Page 45: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

OpenCL, Aparapi and heterogeneous computing

GPU cache

GPU GDDR5

CPU cache

SATA 3.0 (HDD)

SATA 2.0 (SSD)

1 GBit networkFormula in terms of time:

(CPU calc1) + disk read + disk write>

(CPU calc2 + GPU calc + GPU-write + GPU-read) + disk read + disk write

Page 46: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

OpenCL future

Page 47: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

OpenCL future

http://streamcomputing.eu/

Page 48: Hadoop + GPU

© ALTOROS Systems | CONFIDENTIAL

Questions?

Big Data Experts FB group