Software Preservation: challenges and opportunities for reproductibility (Scilabtec 2015 keynote)
ScilabTec Gpu
-
Upload
eractus883023 -
Category
Documents
-
view
230 -
download
1
Transcript of ScilabTec Gpu
![Page 1: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/1.jpg)
1
Bringing GPU capabilities in Scilab
June 16th, 2010
![Page 2: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/2.jpg)
2
Sylvestre Ledru● In charge of R&D projects
● Responsible for GNU/Linux, Mac OS X and Unix version
● Developer
● Community management
● ...
Presentation
![Page 3: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/3.jpg)
3
GPGPU in Scilab
![Page 4: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/4.jpg)
4
● Use graphic cards for numerical computing purposes
● Much more powerful than CPU on some algorithms
● But hard to use...
What is GPGPU?
![Page 5: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/5.jpg)
5
● CUDA by Nvidia for NvidiaFocused on GPU computing
● OpenCL by the Khronos group More general
Two main solutions
![Page 6: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/6.jpg)
6
● To improve computation time
● Perfect to massively parallel algorithms
● To simplify its uses
Why GPU in Scilab?
![Page 7: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/7.jpg)
7
● Take advantages of all Scilab features (high-level, easy to use...)
● Hide a part of the complexity
● Integration in a current software solution
Advantages compared to ad-hoc devs
![Page 8: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/8.jpg)
8
Alpha version of Scilab GPU module
![Page 9: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/9.jpg)
9
Description
● One goal: leverage GPU capabilities from Scilab
● Started in the context of the Google Summer of Code 2009
● Continued within the OpenGPU context (System@tic and Cap Digital)
![Page 10: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/10.jpg)
10
● Handle both CUDA & OpenCL technologies
● Similar profiles and usages
● GPU functions (kernel) are compiled and transfered by the module
● Explicit transfert of variables
● Available on the Scilab forge :http://forge.scilab.org/index.php/p/sciCuda/
Features
![Page 11: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/11.jpg)
11
● CUDA & OpenCL managed transparently with same profiles:
Features
● cudaAlloc vs openclAlloccudaToGpu vs openclToGpubuildCuda vs buildOpenCLcudaApplyFunction vs openclApplyFunction...
![Page 12: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/12.jpg)
12
Code example - kernel
__global__ void someSimpleKernel(double* src,double* dst, int numberOfElement){ int idx=threadIdx.x+blockIdx.x*blockDim.x; if(idx<numberOfElement) { dst[idx]=src[idx]; }}
![Page 13: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/13.jpg)
13
Code example – Scilab code
buildCuda(abs_path+"simple.cu");
A_host=rand(256,256);A=cudaToGpu(A_host);B=cudaAlloc(256,256);
kernel=cudaLoadFunction("simple.ptx","someSimpleKernel");lst=list(A,B,int32(256*256));cudaApplyFunction(kernel,lst,128,1,256*256/128,1);B_host=cudaFromGpu(B);
![Page 14: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/14.jpg)
14
Example: Channel flow past a cylinderical obstacle
![Page 15: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/15.jpg)
15
● A first tagged release
● More transparent uses
● Code generation to GPU
● Xcos integration
● Linear algebra features based on cublas
Future
![Page 16: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/16.jpg)
16
Thanks for your attention
www.scilab.org
![Page 17: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/17.jpg)
Introduction
![Page 18: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/18.jpg)
Scilab on steroïds
Objective : Provide an easy way to go from a scripted prototype
in Scilab to a full-fledged application In fact an application taking advantage of GPU
acceleration
![Page 19: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/19.jpg)
3
Integrating GPU-enabled libraries Introducing a pragma-based typing system Enabling the generation of an autonomous application on GPU Extending the typing system with automated type inferences
Several steps
![Page 20: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/20.jpg)
HPC Project - Corporate Presentation
![Page 21: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/21.jpg)
2
How to go from Scilab…
An interpreted Dynamical environment Ideal for prototyping
![Page 22: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/22.jpg)
3
… to a full application
Typed variable To enable a compilation For performance To directly go to production
![Page 23: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/23.jpg)
4
Producing application from Scilab scripts
If you write a less dynamic code Due to an internal representation of the code A code C can be generated from a Scilab script So you could get an autonomous application From there, you could get a GPU-accelerated application
![Page 24: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/24.jpg)
Par4All source-to-source compiler
What is it ?
Some feedback on code quality
source to source Compiler
Benefit : only one code
Additional Tools
Back-end compiler
You can work on it:
![Page 25: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/25.jpg)
6
Par4All – the compiling flow
Hundreds of code analysis phases and reorganizations
Scripting Metalanguage
C Fortran
C + Cuda code OpenMP MPI
![Page 26: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/26.jpg)
Scilab to GPU
A natural extension High-level scripting languages :
Scilab
![Page 27: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/27.jpg)
Generating type by inference
To ease development Provide an environment able to produce type
Type generation during script writing by inference Something that is provided in some strongly typed formal
langages Of course, it is currently possible to write a script and no
coherent typing can be generated This will result in some limitation on “acceptable” scripts
![Page 28: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/28.jpg)
Appliances Wild Systems A packaged system for immediate use
High-end Configuration : dual-socket X5570 & GPU Tesla
Best HW Optimized App Best Math
In an Appliance
No Cost of Operation
Ethernet
![Page 29: ScilabTec Gpu](https://reader033.fdocuments.us/reader033/viewer/2022042513/577ccd721a28ab9e788c6572/html5/thumbnails/29.jpg)
Thank you Any question ?