• No results found

GPU ACCELERATED DATABASES Database Driven OpenCL Programming. Tim Child 3DMashUp CEO

N/A
N/A
Protected

Academic year: 2021

Share "GPU ACCELERATED DATABASES Database Driven OpenCL Programming. Tim Child 3DMashUp CEO"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

GPU ACCELERATED DATABASES

Database Driven OpenCL Programming

Tim Child 3DMashUp CEO

(3)

SPEAKERS BIO

ƒ

Tim Child

ƒ

35 years experience of software development

ƒ

Formerly

VP Engineering, Oracle Corporation

VP Engineering, BEA Systems Inc.

VP Engineering , Informix

Leader at Illustra, Autodesk, Navteq, Intuit, …

(4)

OUTLINE

ƒ

Speakers Biography

ƒ

Outline

ƒ

Solution Goals

ƒ

OpenCL Programming Challenge

ƒ

Review of GPU Accelerated Databases

ƒ

Swiss Army Knife of Data

ƒ

OpenCL Bindings to PostgreSQL

ƒ

Challenges

ƒ

Example Use Cases

ƒ

Benefits of the Approach

ƒ

Q&A

(5)

GOALS

ƒ

Develop New Applications

Develop new GPU Accelerated Database Applications that are computationally intensive.

ƒ

Ease of Use

Make use GPU accelerated code easier to use

Make GPU accelerated code more mainstream to Information Technology

ƒ

Data Scalability

Scale GPU application data size

(6)

OPENCL PROGRAMMING CHALLENGE

ƒ

Write an OpenCL Application that

:-–

Reads data from DBMS or File

Publishes Results as Web Pages

Handles Frequent Data Updates

Data Size >> System RAM >> GPU RAM

ƒ

Possible Solutions

C/C++ Binding using Web CGI

Java/Perl/Python Bindings in App Server

Other Choices ??

or

Database Driven

GPU

(7)

REVIEW OF GPU ACCELERATED

DATABASE ARCHITECTURES

(8)

GPU CO-PROCESS

DBMS

Server

GPU

Language

Co-Process

IPC /

RPC

GPGPU

Data

Tables

PCI Bus

DBMS

Client

TCP/IP

GPGPU

DRAM

Examples

2004 Bandi, Sun, et al

Many others

(9)

GPU HOSTED DATA ARCHITECTURE

DBMS

Sever

+ GPU Host

GPGPU

Data

Tables

PCI Bus

DBMS

Client

TCP/IP

GPGPU

DRAM

Data

Tables

Copy

Examples

• 2008 Bakkum, Skardon

• 2010 Palo OLAP

• 2010 ParStream

• 2011 Kaczmarski

Data

Indices

Copy

(10)

PROCEDURAL LANGUAGE ARCHITECTURE

Data

Tables

PCI Bus

DBMS

Client

TCP/IP

GPGPU

DRAM

DBMS

Server

GPGPU

Host

GPGPU

Examples

1995 Illustra/Intel

2010 3DMashUp

RAM Cache

Queries

Results

10G B

10T B

(11)
(12)

SQL OPENCL TYPES

ƒ

Vector Types

cl_charX

cl_ucharX

cl_shortX

cl_ushortX

cl_floatX

cl_doubleX

ƒ

Images Types

image2d_t

Image3d_t

Create table opencltypes

( id serial,

matrix cl_double4[4],

image image2d

);

Insert into opencltypes ( matrix) values

(13)

DATABASE DRIVEN OPENCL

PostgreSQL

PgOpenCL

SQL

Procedure

Web

Server

App

Server

Web

Browser

Data

 

Tables

PostgreSQL

Client

SQL

Statement

Disk I/O

TCP/IP

TCP/IP

HTTP

PgOpenCL

SQL

Procedure

GPGPU

PCIe x2 Bus

PostgreSQL

Sever

(14)

OPENCL BINDINGS TO POSTGRESQL

CREATE or REPLACE FUNCTION VectorAdd(IN Id int[], IN a real[], IN B real[], OUT C real[] ) AS $BODY$

$BODY$

Language PgOpenCL;

Select VectorAadd(Id, a, c) from Vectors; __kernel void VectorAdd( __global int * id,

__global float *a, __global float *b, __global float *c) {

int i = get_global_id(0); /* Query OpenCL for the Array Subscript **/ c[i] = a[i] + b[i];

(15)
(16)

DATABASE DRIVEN OPENCL

A

B

A

B

C

Select Table

to Array

Unnest Array

To Table

Copy

Copy

100’s - 1000’s of

Threads (Kernels)

Table

Table

VectorAdd(A, B)

Returns C

+

=

PU

C

C

C

C

C

C

C

C

C

C

C

C

C

(17)

OPENCL TIME SERIES TYPE

CL_UNSIGNED_INT,

    

CL_INTENSITY

(18)

TIME SERIES DATA

34 Years IBM data in 3NF = 8734 records

(19)

EXAMPLE USE CASES

ƒ

GPU Accelerated Time Series

ƒ

3D Content Management / GIS

Spatial Selections

Coordinate Transformations

Image Processing

ƒ

Bioinformatics

DNA & Protein Sequence Matching

ƒ

Database Internal Operations

Joins

Sorting

Query Planning

(20)
(21)
(22)
(23)
(24)
(25)

CHALLENGES

ƒ

Type Mapping

Extend SQL Types with

ƒ

OpenCL Vectors Types

ƒ

OpenCL Image Types

ƒ

Setup –> Runtime

ƒ

Caching kernel info

ƒ

Data Transfer

CPU

GPU

ƒ

Still present

SQL Queries

ƒ

+

Overhead ( < 4µs )

ƒ

Map – Array

Bulk Data Loaders

ƒ

Problem Size

DBMS Table Size >> GPU RAM

# Work Groups / # Work Items

ƒ

Runtime Partitioning

ƒ

Device Management

CPU vs. GPU

ƒ

Runtime Selection

ƒ

Concurrency

No Pre-emptive Multi-Tasking

ƒ

Time-out Long Queries

(26)

BENEFITS OF THE APPROACH

Database

Internal

Operations

Open Source

Release

OpenCL

PostgreSQL

(27)

Q&A

ƒ

PgOpenCL

ƒ

Twitter @3DMashUp

ƒ

Blog

www.scribd.com/3dmashup

ƒ

OpenCL

ƒ

www.khronos.org/opencl/

ƒ

www.amd.com/us/products/technologies/stream-technology/opencl/

ƒ

http://software.intel.com/en-us/articles/intel-opencl-sdk

ƒ

http://www.nvidia.com/object/cuda_opencl_new.html

(28)

Disclaimer & Attribution

The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions and typographical errors.

The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. There is no

obligation to update or otherwise correct or revise this information. However, we reserve the right to revise this information and to make changes from time to time to the content hereof without obligation to notify any person of such revisions or changes. NO REPRESENTATIONS OR WARRANTIES ARE MADE WITH RESPECT TO THE CONTENTS HEREOF AND NO RESPONSIBILITY IS ASSUMED FOR ANY INACCURACIES, ERRORS OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION.

ALL IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. IN NO EVENT WILL ANY LIABILITY TO ANY PERSON BE INCURRED FOR ANY DIRECT, INDIRECT, SPECIAL OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

AMD, the AMD arrow logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. All other names used in this presentation are for informational purposes only and may be trademarks of their respective owners.

The contents of this presentation were provided by individual(s) and/or company listed on the title page. The information and opinions presented in this presentation may not represent AMD’s positions, strategies or opinions. Unless explicitly stated, AMD is not responsible for the content herein and no endorsements are implied.

References

Related documents