Upload
scdn
View
1.016
Download
0
Tags:
Embed Size (px)
Citation preview
Ruby Summer of Code: NArray on OpenCL
Kazu@ktanimur
https://github.com/kazuyukitanimura
Who is @ktanimur
• Ph.D. Student in computer science at UC Irvine• Research
o Embedded Systems / CAD / Security• Programing Languages
o Ruby+OpenCL Today's topic
o JavaScript (Node.js) Designo: twitter client
Demo: designo.pictshare.me Code: https://github.com/kazuyukitanimura
o Verilog-HDL, VHDLo C, C++o etc...
Electric Design Automation
Source: EE Times
DAC 2011
Keynote:Steve Wozniak Fusion-io
Why Ruby?
• One of my senpai is a rubyist• Ruby for making simulation framework of my research
o Easy to make prototypes• Ruby != Rails
• Ruby cannot handle muti-core CPUs• Wanted to contribute the Ruby community
• 2010 Summer• Ruby version of Google Summer of Code
o Students propose projects 70 applicants 20 selected
o 3 mentors / studento $5,000 salary
Sponsored by Ruby communities
NArray
• N-dimensional Numerical Array for Ruby o https://github.com/masa16/narray
• Fixed-type datao sint, int, sloat, scomplex, float, complex
• Fast !!o Loop in C
• Applicationso Dennou Ruby, etc...
• Single Threado Do not scale in the multicore era
OpenCL
• Open Standard for parallel programming of heterogeneous systems by Khronos groupo Similar to Nvidia CUDA
• OpenCL is a specification, not a technology
• Online & Offline compile• Hardware agnostic
o CPU, GPU, ASIP, FPGA, etc...
• AMD, Nvidia, Apple, Foxco Intel started the OpenCL support recently
Proposed Project
NArray on OpenCL• Want to use Ruby with NArray
o No need to worry about memory• It takes time to learn OpenCL
o Need to worry about memory model
• Main Idea: Translate NArray into OpenCL!!o Programmers can utilize the power of Multicore/GPU
using Ruby• Why OpenCL?
o Hardware agnostic Exploit the available hardware e.g. GPU, CPU
pthread, OpenMP cannot run on GPU
Results
• Mac mini mid 2010, CPU:Intel Core 2 Duo 2.4GHz, Memory:DDR3 1067MHz 2GB
• Successfully received $5,000• https://github.com/kazuyukitanimura/narray/wiki
Original$ ruby bench/bench.rb scomplex atanh 1000000 1000Ruby NArray type=scomplex size=1000000 op=atanh repeat=1000 Time: 98.95 sec
OpenCL$ ruby bench/bench.rb scomplex atanh 1000000 1000Ruby NArray type=scomplex size=1000000 op=atanh repeat=1000 Time: 42.46 sec
Future Work
• Currently Multicore CPUs only• GPU Support is delayed
o Explicit data transportation between main memory and GPU memory
o Overheado Applications
• Hope: AMD Fusion (APU) and Intel's GPU in Sandy Bridgeo Shared GPU/CPU memoery
• Post an article to the Ruby Magazine
Q & A
Thank you!