Presentation is loading. Please wait.

Presentation is loading. Please wait.

Enhancing GPU for Scientific Computing Some thoughts.

Similar presentations


Presentation on theme: "Enhancing GPU for Scientific Computing Some thoughts."— Presentation transcript:

1 Enhancing GPU for Scientific Computing Some thoughts

2 Outline Motivation Related work BLAS Library Execution Model Benchmarks Recommendations

3 Motivation GPU Computing Vector and Fragment Processor streaming (super)-computers enormous performance! ATI 9700, NV30 They have become programmable Emerging application areas Numerical Sim.[Schroder’03], Sorting, Genomics, etc. Goal: Scientific Computing

4 Motivation Most software built from small-efficient parts Scientific apps built on top of s/w library routines Harnessing GPU resources Arithmetic Intensive Data parallel BLAS Library

5 Related work Using non-programmable GPUs [Erik’01] prog. vertex engine for lighting/morphing [Oskin’02] vector processing using VP [Ian’03] stream processing using FP Problems : Monolithic Big Programs One of VP or FP CPU – Passive Mode No Cascading Loop-backs (Parallelism, Setup Times)

6 BLAS Library BLAS (Basic Linear Algebra Subprograms) Building blocks for vector and matrix operations development of highly efficient linear algebra software LINPACK and LAPACK Operations Scalar – Vector Vector – Vector Vector – Matrix Matrix – Matrix

7 Mapping Operation processor CPU/FP - All ops VP - no memory access Restricted data-flows CPU FP VP CPU CPU VP FP Non-matrix ops All operations CPUVPFPCPU

8 Execution graph Vector Scalar Add Operation 1.In this example, a Vector of length n is segmented into m other vectors of length 4 in the CPU function vsAdd. 2.The vertex program vsAdd.cg is loaded onto the vertex processor and the scalar value is passed as a parameter. 3.Subsequently, CPU function vsAdd will stream the set of m vectors onto the CPU as openGL primitive points. Our vertex program, vsAdd.cg will add the scalar value to all fields in the m vertices. 4.Consequently, these vertices will proceed to the fragment processor and written onto the framebuffer memory. 5.The CPU function vsADD continues to read the color values off each pixel representation of the vertices. These color values contain result of a Vector Scalar add. 6.Lastly the CPU function concatenates the sequence of color values into a vector of length n as result. vAdd CPU [vAdd.cg] Vertex Processor vAdd CPU (Vector s, Vector s ) (Vector s ) [Vertex] m (GL_POINTS) [Texture Color values] m [None] Fragment Processor [Vertex] m GPUGPU Texture MemPBuffer vAdd.cg TextureData m

9 vAdd CPU [None] Vertex Processor vAdd CPU GL_QUAD [Vector 4 ] m (Vector s ) [Vertex 4 ] m GL_QUAD [Texture Color values] m [vAdd.cg] Fragment Processor [Vertex 4 ] m Execution graph Vector Vector Add Operation 1.In this example, 2 vectors of length s are transformed into texture data in the CPU function vAdd. 2.The vertex program vAdd.cg, and texture data are loaded onto the fragment processor GPU memory respectively. 3.Subsequently, CPU function vAdd will draw a quadrilateral primitive having s pixels. 4.The vertex processor does nothing and passes on the vertices to the rasterizer to process into pixel representation. 5.The rasterizer creates the s pixels for fragment processing. 6.For each pixel, our fragment processor will lookup the values from both textures and determine the color value of each pixel. These pixels are written onto the Pbuffer memory. 7.The CPU function vADD continues to read the color values off each pixel representation of the vertices. These color values contain result of a Vector Vector add. 8.The output in Pbuffer is then converted into a texture entry. 9.Lastly the CPU function reads the texture entry and concatenates the sequence of color values into a vector of length s as result. GPUGPU TextureData1 m TextureData2 m Texture MemPBuffer vAdd.cg TextureData3 m

10 vAdd CPU [None] Vertex Processor vAdd CPU (Vector s ) [Vertex 4 ] m [Texture Color values] m [vAdd.cg] Fragment Processor [Vertex 4 ] m GPUGPU TextureData4 m Texture MemPBuffer TextureData3 m Execution graph 2 Vector Vector Add Operations 1.In this example, we perform 2 separate vector vector add operations. 2.The 1 st operation proceeds as described earlier in our vector vector add operation. 3.The output of the 1 st operation is used as input for the 2 nd operation. 4.Since it’s the same operation, we do not load a new Vertex or Fragment program. However we proceed to load a new texture data. 5.The 2 nd operation proceeds as normal. 6.Lastly the CPU function concatenates the sequence of color values into a vector of length s as result. GL_QUAD [Vectex 4 ] m

11 Performance Issues Representation inefficiency Memory Data stored both in CPU and GPU Communication costs Loading data onto GPU Reading data from GPU Execution inefficiencies Computation setup overhead Remodeling CPU data for GPU Problem execution time Rendering Texture lookups

12

13

14

15

16

17

18

19 Observations Fixed-point operations are much faster than FP16/FP32 operations FP16/FP32 operations have similar performance VP is slower than FP Operation mappings involving both VP and FP result in inefficient pipeline

20 Observations Simple operations perform better on CPU Best to design whole algorithm as single VP/FP program Memory cost for storing intermediate results Execution cost ? More textures result in decreased performance

21 Bug Reports Filed! Incorrect dump of floating point values after render to texture [NVIDIA confirmed] cgSetcolor parameter does not update alpha values [Awaiting reply]

22 Recommendations (3D Graphics Hackers) Load important data into Video memory Maximum use of Fixed-point Pipeline Code optimization important (Instr., Memory) Upgrade your video card drivers (must!) Hacking graphics hardware is a *real* pain!

23 Recommendations (Cg) Pointer meaningful for numerical computing Texture fetch instructions (add. Offsets) Accumulation registers (sum) Preserving State across multiple calls Introduce stack mechanisms Introduce bit wise operators

24 Recommendations (Hardware) Allow GPU to read/write from CPU memory VP and FP as 1 st class processors on GPU Similar cores and instruction sets Allow full parallelism Allow CPU to read/write all registers in GPU processors Introduce a stack Introduce bit wise operators

25 Deliverables! A draft subset of the BLAS library Architecture Insights (issues/constraints) NV30 Improvements (Bug reports) Technical Write-up

26 The End


Download ppt "Enhancing GPU for Scientific Computing Some thoughts."

Similar presentations


Ads by Google