Ruby Summer of Code: NArray on OpenCL Kazu @ktanimur https://github.com/kazuyukitanimura
Who is @ktanimur <ul><ul><li>Ph.D. Student in computer science at UC Irvine </li></ul></ul><ul><ul><li>Research </li></ul>...
Electric Design Automation <ul><li>Source: EE Times </li></ul>
DAC 2011 <ul><li>Keynote: </li></ul><ul><li>Steve Wozniak </li></ul><ul><li>     Fusion-io </li></ul>
 
Why Ruby? <ul><ul><li>One of my senpai is a rubyist </li></ul></ul><ul><ul><li>Ruby for making simulation framework of my ...
<ul><ul><li>2010 Summer </li></ul></ul><ul><ul><li>Ruby version of Google Summer of Code </li></ul></ul><ul><ul><ul><li>St...
  <ul><li>  </li></ul>
NArray  <ul><ul><li>N-dimensional Numerical Array for Ruby  </li></ul></ul><ul><ul><ul><li>https://github.com/masa16/narra...
OpenCL <ul><ul><li>Open Standard for parallel programming of heterogeneous systems by Khronos group </li></ul></ul><ul><ul...
 
Proposed Project <ul><li>NArray on OpenCL </li></ul><ul><ul><li>Want to use Ruby with NArray </li></ul></ul><ul><ul><ul><l...
Results <ul><ul><li>Mac mini mid 2010, CPU:Intel Core 2 Duo 2.4GHz, Memory:DDR3 1067MHz 2GB </li></ul></ul><ul><ul><li>Suc...
Future Work <ul><ul><li>Currently Multicore CPUs only </li></ul></ul><ul><ul><li>GPU Support is delayed </li></ul></ul><ul...
Q & A Thank you!
Upcoming SlideShare
Loading in …5
×

第5回SCDN - Ruby Summer of Code: NArray on OpenCL

1,278 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,278
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

第5回SCDN - Ruby Summer of Code: NArray on OpenCL

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

×