GithubHelp home page GithubHelp logo

hush-z / cuda_cublas_dp_implementation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from olegkonings/cuda_cublas_dp_implementation

0.0 2.0 0.0 116 KB

A conversion of a 64 bit Dynamic Programming problem to a Linear Algebra CUDA implementation

Cuda 100.00%

cuda_cublas_dp_implementation's Introduction

CUDA_cuBLAS_DP_implementation

A conversion of a 64 bit Dynamic Programming problem to a Linear Algebra CUDA implementation.

A serial CPU DP approach and a CUDA cuBLAS approach to the TopCoder problem 'CandyBox';

http://community.topcoder.com/stat?c=problem_statement&pm=10744&rd=14147&rm=&cr=22653720

Wo ist die Liebe Deutschland?

I see you Chicago!

This problem has a number of ways it can be solved, and in this case the GPU version uses Linear Algebra (cuBLAS) to raise the probability Matrix to large powers (through exponentiating by squaring method). Since GPUs excel at Linear Algebra, this implementation runs much faster on the GPU than a straight translation of the CPU DP implementation to the CUDA equivalent. A CPU Linear Algebra version would be much slower, so the faster DP CPU version was compared.

A relatively small test was used for now, and there was at least a 86x speedup over the CPU version, but as all variables get larger the relative difference in running time will be larger (favoring the GPU version).


Num Pieces CandyNum different CandiesNum SwapsCPU timeGPU timeCUDA Speedup
1005010000 86 ms1 ms 86.x
____

NOTE: All CUDA GPU times include all device memsets, host-device memory copies and device-host memory copies.

Will create larger data sets for bigger tests, and this is just the first beta version. The CUDA implementation can be further optimized as well, but already solves the problem (including all memory ops and copies) in under 1 ms, so that is impressive.

War gegen Python!


CPU= Intel I-7 3770K 3.5 Ghz with 3.9 Ghz target

GPU= Tesla K20c 5GB

Windows 7 Ultimate x64

Visual Studio 2010 x64

<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-43459430-1', 'github.com'); ga('send', 'pageview'); </script>

githalytics.com alpha githalytics.com alpha

cuda_cublas_dp_implementation's People

Contributors

olegkonings avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.