Finally… back to Science.
Posted November 7th, 2008 by SpicyWith the election behind and a collective sigh of relief from the science community we can get back to the good stuff– throwing some fuel into the engine we call SCIENCE! For my part, I got some much needed time to learn about and implement some simple algorithms utilizing CUDA. CUDA is a c-extension from Nvidia for leveraging the massive computational power in your GPU. In my case my GeForce 8600M graphics card in my MacBook Pro.
I have to give some serious props to the devs of CUDA because it is very straight forward and makes programming for the GPU rather intuitive. I have been able to implement the Lloyd’s Algorithm for the K-Means problem in just a few days. The speed increase is graphically represented in the following graph.
In green is the time in seconds required to compute the kmeans solution using the CPU and in red is the time required for the GPU. The variance in the times comes from the nature of Lloyd’s algorithm which, depding on the input, can take a variable amount of time. The GPU times are also varied but it is difficult to see in the figure.
These results are just from running the application on my MBP. If you have a machine with many graphics processors (or many machines each with their own GPU) then you can parallelize this even more and massively boost your computational power. In my opinion the GPU architecture is the future of scientific computing as so many of our computational challenges can be addressed using parallelization.
For those that are interested I will be writing up some CUDA tutorials covering Installation/Set Up, A “Hello World” example, and the full K-Means implementation over at MacResearch.org.
Tags: algorithm, CUDA, GPU, k-means, Science

4 Responses to “Finally… back to Science.”
April 17th, 2009 at 1:58 pm
Hey Nick,
Any updates on the tutorial ? I could use some help with k-means on the GPU
April 17th, 2009 at 2:03 pm
Yes, I’ll email you a pdf of the tutorials. They haven’t been polished but they give the general idea.
April 17th, 2009 at 2:10 pm
Thanks a lot Nick, yeah any starting point would be good
April 17th, 2009 at 2:15 pm
No problem.
If anyone else wants these tutorials you can download them here:
CUDA Programming Tutorial (Part I): Setup and Installation
http://thespicychicken.com/uploads/cuda_tutorial_part1.pdf
CUDA Programming Tutorial (Part II): Hello Data Model
http://thespicychicken.com/uploads/cuda_tutorial_part2.pdf
Leave a Reply