Robert Liao Tracy Wang CS252 Spring 2007
24 Slides1.14 MB
Robert Liao Tracy Wang CS252 Spring 2007
Overview Traditional GPU Architecture The NVIDIA G80 Processor CUDA (Compute Unified Device Architecture) LAPACK Performance and Issues
A Quick Note on Naming “G80” is the codename for the GPU found in the following graphics cards. NVIDIA GeForce 8 Series Graphics Cards NVIDIA Quadro FX 4600 NVIDIA Quadro FX 5600
Traditional GPUs From Intel Corporation
Traditional GPUs GPUs talk Polygons From CPU Vertex Processor Pixel Fragmenti ng Creation Process Fragment s Merge Output Display
Traditional GPUs OpenGL and DirectX abstract this away. From CPU Vertex Processor Pixel Fragmenti ng Creation Process Fragment s Merge Output Display
The NVIDIA G80 Architecture Reconfigurable Processor Pipeline From NVIDIA
G80 History and Specifications Project Started in Summer of 2002. 128 Compute Cores 1.35 GHz in the GeForce 8800 Floating Point Ops Stream Processor Architecture One Computing Unit Streams into another Computing Unit
The CUDA Interface to the G80 Compute Unified Device Architecture C Interface for Performing Operations on the NVIDIA Processor Contains traditional C memory semantics with the context of a GPU
Working with CUDA Custom compiler provided to compile C code that the GPU can understand. The API functions provide a whole host of ways to interface with the GPU. CUDA Libraries are provided for common tasks. CUDA Runtime helps management of memory No DirectX or OpenGL knowledge needed!
Working with CUDA Running C on the CPU Running C on the GPU malloc cudaMalloc free cudaFree CPU Code GPU Code Pointers on one side stay on one side. This will create issues for existing applications
LAPACK Linear Algebra PACKage Implemented in Fortran 77 Interfaces with BLAS (Basic Linear Algebra Subprograms) Professor James Demmel involved in Project
CLAPACK An F2C’ed version of LAPACK. Very ugly! s rsle(&io 8); do lio(&c 3, &c 1, (char *)&nm, (ftnlen)sizeof(integer)); e rsle(); if (nm 1) { s wsfe(&io 10); do fio(&c 1, " NM ", (ftnlen)4); do fio(&c 1, (char *)&nm, (ftnlen)sizeof(integer)); do fio(&c 1, (char *)&c 1, (ftnlen)sizeof(integer)); e wsfe(); nm 0; fatal TRUE ; } else if (nm 12) { s wsfe(&io 11); do fio(&c 1, " NM ", (ftnlen)4); do fio(&c 1, (char *)&nm, (ftnlen)sizeof(integer)); do fio(&c 1, (char *)&c 12, (ftnlen)sizeof(integer)); e wsfe(); nm 0;
CUBLAS NVIDIA’s CUDA Based Implementation of BLAS Many functions are similar, but argument signatures are slightly different Adds some other functions as well cublasAlloc cublasFree CUBLAS lives in the GPU world
CLAPACK and CUBLAS Putting them together is not as easy as just linking CLAPACK to CUBLAS. Matrices and data structures must be moved into GPU memory space. CLAPACK executes on the CPU. CUBLAS executes on the GPU. CLAPACK Function Memory copy CPU GPU Memory CUBLAS copy GPU CPU
CLAPACK Concentration General Solve sgesv Computes solution to linear system of equations A X B To Solve, A is factored into three matrices, P, L, and U. P Permutation Matrix L Lower Triangular U Upper Triangular Currently, our results cover the triangular factoring step
Performance Results
Performance Results
Performance Issues Much copying must be done from the CPU to GPU and GPU to CPU to communicate results. Why not convert all pointers into GPU pointers? Requires CLAPACK to run in GPU memory. Could be someone’s research paper
Other Issues Floating Point Behaves Differently Section 5.2 of the CUDA Programming Guide Discusses Deviations from IEEE-754 No support for denormalized numbers Underflowed numbers are flushed to zero We noticed some results appearing as 0.0001 instead of 0, for example
Current State Investigating some interesting memory issues on the GPU side. Allocations Mysteriously Fail.
Conclusions To Date Small data sets are better left off on the CPU. GPU calculations may not be appropriate for scientific computing depending on needs.
Future Directions Moving all of LAPACK into GPU Resolving the copying issue Perhaps resolved by unifying the CPU and GPU? Want to give it a try? Can’t find Quadro FX 5600 on Market (MSRP 2,999) GeForce 8 Series have the G80 Processor GeForce 8500GT ( 99.99) GeForce 8800GTX ( 939.99)