Sunteți pe pagina 1din 31

GPU ACCELERATED DATABASES

Database Driven OpenCL Programming


Tim Child 3DMashUp CEO

OUTLINE

3 | GPU Accelerated Databses | June 6, 2011

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,

30+ years experience in 3D, CAD, GIS and DBMS

4 | GPU Accelerated Databses | June 6, 2011

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 | GPU Accelerated Databses | June 6, 2011

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  Enhance existing database internal operations

6 | GPU Accelerated Databses | June 6, 2011

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 Programming

7 | GPU Accelerated Databses | June 6, 2011

REVIEW OF GPU ACCELERATED DATABASE ARCHITECTURES

8 | GPU Accelerated Databses | June 6, 2011

GPU CO-PROCESS

TCP/IP DBMS Client DBMS Server

IPC / RPC

PCI Bus GPU Language Co-Process

GPGPU DRAM

Examples 2004 Bandi, Sun, et al Many others GPGPU

Data Tables

9 | GPU Accelerated Databses | June 6, 2011

GPU HOSTED DATA ARCHITECTURE


GPGPU DRAM TCP/IP DBMS Client PCI Bus DBMS Sever + GPU Host Data Tables Copy

Data Indices Copy GPGPU

Examples 2008 Bakkum, Skardon 2010 Palo OLAP 2010 ParStream 2011 Kaczmarski

Data Tables

10 | GPU Accelerated Databses | June 6, 2011

PROCEDURAL LANGUAGE ARCHITECTURE

DBMS Client

TCP/IP DBMS Server Results 10G B RAM Cache GPGPU Host

PCI Bus

GPGPU DRAM

Queries GPGPU

Examples 1995 Illustra/Intel 2010 3DMashUp

Data Tables

10T B

11 | GPU Accelerated Databses | June 6, 2011

SWISS ARMY KNIFE OF DATA

12 | GPU Accelerated Databses | June 6, 2011

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 ( { 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1 } );

13 | GPU Accelerated Databses | June 6, 2011

DATABASE DRIVEN OPENCL

PostgreSQL Sever

Web Browser

HTTP

Web Server App Server


TCP/IP

SQL Statement

PgOpenCL PgOpenCL SQL SQL Procedure Procedure


PCIe x2 Bus

PostgreSQL
GPGPU
TCP/IP

PostgreSQL

Disk I/O

Data Tables

Client

14 | GPU Accelerated Databses | June 6, 2011

OPENCL BINDINGS TO POSTGRESQL

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

__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]; }

$BODY$
Language PgOpenCL; Select VectorAadd(Id, a, c) from Vectors;

15 | GPU Accelerated Databses | June 6, 2011

COMPARISON TABLE

16 | GPU Accelerated Databses | June 6, 2011

DATABASE DRIVEN OPENCL


A B Select Table to Array xPU 100s - 1000s of Threads (Kernels)

Table

VectorAdd(A, B) Returns C

=
Copy

Copy

Unnest Array To Table

Table

17 | GPU Accelerated Databses | June 6, 2011

OPENCL TIME SERIES TYPE

CL_UNSIGNED_INT, CL_INTENSITY

CL_FLOAT, CL_INTENSITY

18 | GPU Accelerated Databses | June 6, 2011

TIME SERIES DATA

34 Years IBM data in 3NF = 8734 records

As Time Series = 34 Records, 6 Series Columns (~250 Values/Series)

19 | GPU Accelerated Databses | June 6, 2011

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

Demo

20 | GPU Accelerated Databses | June 6, 2011

DEMO SCREEN 1

21 | GPU Accelerated Databses | June 6, 2011

DEMO SCREEN 2

22 | GPU Accelerated Databses | June 6, 2011

DEMO SCREEN 3

23 | GPU Accelerated Databses | June 6, 2011

DEMO SCREEN

24 | GPU Accelerated Databses | June 6, 2011

DEMO SCREEN 5

25 | GPU Accelerated Databses | June 6, 2011

CHALLENGES Type Mapping


Extend SQL Types with  OpenCL Vectors Types  OpenCL Image Types

Problem Size
DBMS Table Size >> GPU RAM # Work Groups / # Work Items
 Runtime Partitioning

Setup > Runtime


 Caching kernel info

Device Management
CPU vs. GPU
 Runtime Selection

Data Transfer
CPU GPU  Still present SQL Queries  + Overhead ( < 4 s )  Map Array Bulk Data Loaders
 New Task

Concurrency
No Pre-emptive Multi-Tasking
 Time-out Long Queries  Partitioning / Scheduling

26 | GPU Accelerated Databses | June 6, 2011

BENEFITS OF THE APPROACH


PostgreSQL

OpenCL

Open Source Release

Database Internal Operations

27 | GPU Accelerated Databses | June 6, 2011

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 | GPU Accelerated Databses | June 6, 2011

OPTIONAL: INSTRUCTIONS FOR ADDING YOUR OWN CORPORATE OR UNIVERSITY LOGO TO THE PRESENTATION
 You may, if you desire to, include your corporate or university logo on the slide deck  The logo should be the approximate size shown in the upper right corner of this slide.  The logo should be located in the position shown on this slide.  The easiest way to add the logo is to add it to the slide template, that way it will appear automatically on every slide. Alternatively, it can be added manually to individual slides. The slide template is accessed (assuming Office 2007), by selecting the View tab, selecting the Slide Master, and then pasting the logo into the correct position on the slide master.

29 | GPU Accelerated Databses | June 6, 2011

POWERPOINT 2011 AMD COLOR PALETTE

AMD RICH BLACK R0 G0 B0

AMD WHITE R255 G255 B255

AMD GREEN PMS 347 R0 G153 B102

AMD GRAY R27 G27 B27

AMD RED PMS 186 R211 G25 B25

AMD PURPLE PMS 272 R118 G125 B197

AMD ORANGE PMS 1505 R252 G101 B0

AMD GRAY Cool Gray 10 R128 G127 B130

INTEL BLUE R8 G96 B168

30 | GPU Accelerated Databses | June 6, 2011

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. [For AMD-speakers only] 2011 Advanced Micro Devices, Inc. [For non-AMD speakers only] 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 AMDs positions, strategies or opinions. Unless explicitly stated, AMD is not responsible for the content herein and no endorsements are implied.

31 | GPU Accelerated Databses | June 6, 2011

S-ar putea să vă placă și